Ejemplo n.º 1
0
        public Cart(Data data)
        {
            Dock        = DockStyle.Fill;
            ColumnCount = 3;
            RowCount    = 2;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.333F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.333F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.333F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 100));
            RowStyles.Add(new RowStyle(SizeType.Absolute, 140));



            this.data = data;

            this.data.cart.ForEach(p => totalCost += p.Cost);

            cartGrid = CreateCartGrid();
            SetColumnSpan(cartGrid, 3);
            Controls.Add(cartGrid);

            checkOutCalculationsCorner = CreateCheckoutCalculationsCorner();
            SetColumnSpan(checkOutCalculationsCorner, 3);
            Controls.Add(checkOutCalculationsCorner);
        }
        /// <summary>
        /// Initialization and setup method
        /// </summary>
        /// <param name="name"></param>
        private void InitializeLowerTableLayout(string name)
        {
            Name = name;

            Dock = DockStyle.Fill;

            Location = new Point(0, 0);
            Size     = new Size(334, 327);
            Margin   = new Padding(6);

            ColumnCount = 4;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));

            RowCount = 7;
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 14.28571F));

            TabIndex = 0;

            SuspendLayout();
            ResumeLayout(false);
            PerformLayout();
        }
Ejemplo n.º 3
0
        public RealPlayerGrid(PlayerManager mgr, int row, int column)
        {
            this.RowCount    = row;
            this.ColumnCount = column;

            // 设置行属性
            float rowHeight   = 100 / row;
            float columnWidth = 100 / column;

            for (int i = 0; i < row; i++)
            {
                RowStyles.Add(new RowStyle(SizeType.Percent, rowHeight));
            }
            for (int i = 0; i < column; i++)
            {
                ColumnStyles.Add(new ColumnStyle(SizeType.Percent, columnWidth));
            }

            // 添加播放器
            for (int r = 0; r < RowCount; r++)
            {
                for (int c = 0; c < ColumnCount; c++)
                {
                    FormRealPlayer player = new FormRealPlayer(mgr);
                    player.Dock            = DockStyle.Fill;
                    player.FormBorderStyle = FormBorderStyle.None;
                    player.TopLevel        = false;
                    this.Controls.Add(player, c, r);
                    player.setGrid(this, c, r);
                    player.Show();
                }
            }
        }
Ejemplo n.º 4
0
        public BoardPanel(Board i_Board)
        {
            m_Board = i_Board;

            int size = m_Board.Size;

            m_Cells = new CellBox[size, size];

            for (int i = 0; i < size; i++)
            {
                ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, CellBox.ItemSize));
            }

            for (int i = 0; i < size; i++)
            {
                RowStyles.Add(new RowStyle(SizeType.Absolute, CellBox.ItemSize));
            }

            for (int row = 0; row < size; row++)
            {
                for (int col = 0; col < size; col++)
                {
                    CellBox cell = new CellBox(m_Board.GetCell(row, col), new EventHandler(OnCellClicked));
                    m_Cells[row, col] = cell;
                    Controls.Add(cell, col, row);
                }
            }

            Padding = new Padding(0);
            Size    = new Size(size * CellBox.ItemSize, size * CellBox.ItemSize);
        }
Ejemplo n.º 5
0
        private void Render()
        {
            SuspendLayout();
            List <Group> groups = new List <Group>();

            if (gameID > 0)
            {
                groups = Attendance.GetPresent(gameID);
                groups.Sort((x, y) => Score.GetGame(gameID, y.ID).CompareTo(Score.GetGame(gameID, x.ID)));
            }
            else
            {
                groups = Group.GetAll();
                groups.Sort((x, y) => Score.GetTotal(y.ID).CompareTo(Score.GetTotal(x.ID)));
            }
            foreach (Group group in groups)
            {
                RowCount += 1;
                RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
                LabelGroup lblGroup = new LabelGroup(group.Name, layout);
                short      score    = (gameID > 0) ? Score.GetGame(gameID, group.ID) : Score.GetTotal(group.ID);
                LabelScore lblScore = new LabelScore(score, layout);
                Controls.Add(lblGroup, 0, RowCount - 1);
                Controls.Add(lblScore, 1, RowCount - 1);
            }
            ResumeLayout(false);
            PerformLayout();
        }
 protected FileOverviewTableLayoutPanel(int rowCount)
 {
     Name = "overviewTableLayoutPanel";
     SuspendLayout();
     DirectoryNameLabel   = CreateLabel("directoryNameLabel");
     DirectoryNameTextBox = CreateTextBox("directoryNameTextBox");
     FileNameLabel        = CreateLabel("fileNameLabel");
     FileNameTextBox      = CreateTextBox("fileNameTextBox");
     AutoSize             = true;
     Dock        = DockStyle.Fill;
     ColumnCount = 2;
     rowCount    = (RowCount = (rowCount < 4) ? 4 : RowCount) - 1;
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0f));
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50.0f));
     for (int i = 0; i < rowCount; i++)
     {
         RowStyles.Add(new RowStyle());
     }
     RowStyles.Add(new RowStyle(SizeType.Percent, 100.0f));
     Controls.Add(DirectoryNameLabel, 0, 0);
     SetColumnSpan(DirectoryNameLabel, 2);
     Controls.Add(DirectoryNameTextBox, 0, 1);
     SetColumnSpan(DirectoryNameTextBox, 2);
     Controls.Add(FileNameLabel, 0, 2);
     Controls.Add(FileNameLabel, 0, 3);
 }
Ejemplo n.º 7
0
        private void Render()
        {
            SuspendLayout();
            checkboxGroups = new List <CheckBoxGroup>();
            List <Group> presentGroups = Attendance.GetPresent(question.Game);

            RowCount = 2;
            RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
            RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
            ColumnCount = 4;
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            int row = 0, col = 0;

            foreach (Group group in presentGroups)
            {
                if (col == 4)
                {
                    row = 1;
                    col = 0;
                }
                CheckBoxGroup checkboxGroup = new CheckBoxGroup(group.ID, group.Name);
                checkboxGroups.Add(checkboxGroup);
                Controls.Add(checkboxGroup, col, row);
                col++;
            }
            ResumeLayout(false);
            PerformLayout();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Initialization and setup method
        /// </summary>
        /// <param name="name"></param>
        public void InitializeTable(string name)
        {
            //Table name
            Name = name;

            //Column count & tab index
            ColumnCount = 3;
            TabIndex    = 0;

            //Column Styles
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 37.5F));
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 37.5F));

            //Row Styles
            RowStyles.Add(new RowStyle(System.Windows.Forms.SizeType.Percent, 100F));

            //Location and other settings
            Dock     = DockStyle.Fill;
            Location = new Point(0, 0);
            Size     = new Size(764, 40);

            //Suspended layout
            SuspendLayout();

            //Resume layout
            ResumeLayout(false);
        }
        public void alterRowAndColumnCount()
        {
            ColumnStyles.Clear();
            RowStyles.Clear();
            var count = Controls.Count;

            if (count != 0)
            {
                ColumnCount = (int)Math.Floor(Math.Log(count, 2)) + 1;
                RowCount    = (int)Math.Ceiling((double)count / ColumnCount);
                for (int i = 1; i <= this.RowCount; i++)
                {
                    //RowStyles.Add(new RowStyle(SizeType.AutoSize, StudentCell.MINIMUM_SIZE.Height));
                    RowStyles.Add(new RowStyle()
                    {
                        Height = 100 / RowCount, SizeType = SizeType.Percent
                    });
                }
                for (int i = 1; i <= this.ColumnCount; i++)
                {
                    //ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, Width / ColumnCount));
                    ColumnStyles.Add(new ColumnStyle()
                    {
                        Width = 100 / ColumnCount, SizeType = SizeType.Percent
                    });
                }
            }
        }
Ejemplo n.º 10
0
            public void SetData()
            {
                ColumnCount = columns;
                RowCount    = rows;
                Day day = null;

                for (int i = 0; i < 50; i++)
                {
                    days[i] = new Day();
                }
                for (int i = 0; i < ColumnCount; i++)
                {
                    ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
                }
                for (int i = 0; i < RowCount; i++)
                {
                    RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
                }


                for (int row = 0; row < RowCount; row++)
                {
                    for (int col = 0; col < ColumnCount; col++)
                    {
                        day = new Day();
                        days[row * 7 + col] = day;
                    }
                }
            }
Ejemplo n.º 11
0
        public void Add(Control control, bool fill = false)
        {
            var sizeType = fill ? SizeType.Percent : SizeType.AutoSize;

            if (isVertical)
            {
                Controls.Add(control, 0, next);

                RowStyles.Add(new RowStyle {
                    Height   = 100.0f,
                    SizeType = sizeType
                });

                Trace.Assert(RowStyles.Count == next + 1);
            }
            else
            {
                Controls.Add(control, next, 0);

                ColumnStyles.Add(new ColumnStyle {
                    Width    = 100.0f,
                    SizeType = sizeType
                });
            }
            next++;
        }
 public CustomTableLayoutPanel()
 {
     RowStyles.Clear();
     RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F));
     RowStyles.Add(new RowStyle(SizeType.Percent, 0.75F));
     BackColor = Color.Beige;
 }
Ejemplo n.º 13
0
        //private buttons_class buttons;
        //System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;


        /// <summary>
        /// Quick little summary of what I'm about to do, why I'm going to do it,
        /// and we'll see if it makes sense.
        ///
        /// What this will be:  A little 12to15-key keypad, with a clear and an enter
        /// hopefully tied-to some common control
        ///
        /// How to get this done.  The first thing that jumps-out at a person is,
        /// "hey, we could use buttons, and that would be AWESOME."
        ///
        /// The next thing, do a table layout of sorts.  Each button takes
        /// up the full thing.  Shouldn't be too bad.
        ///
        ///
        /// </summary>

        public PSI_Keypad()
        {
            bool enable_accumulator_display = true;

            // 4 is enough for normal keypad
            local_rows    = enable_accumulator_display?5:4;
            local_columns = 3;             //someday in the near future, we may change this.

            gs = new GlareSet("default");
            gs.attrib.Primary   = Color.Blue;          // Color.FromArgb( 64, Color.Blue );
            gs.attrib.Secondary = Color.SkyBlue;
            gs.attrib.TextColor = Color.White;

            InitializeComponent();

            if (enable_accumulator_display)
            {
                accumulator = new TextBox();
                Controls.Add(accumulator, 0, 0);
                SetColumnSpan(accumulator, 3);
                accumulator.Dock = DockStyle.Fill;
            }

            ColumnCount = local_columns;
            for (int i = 0; i < local_columns; i++)
            {
                ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F / (float)local_columns));
            }
            Location = new System.Drawing.Point(0, 0);
            Name     = "tableLayoutPanel1";
            RowCount = local_rows;
            if (enable_accumulator_display)
            {
                RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F / (float)(local_rows * 2)));
            }
            for (int i = enable_accumulator_display ? 1 : 0; i < local_rows; i++)
            {
                RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F / (float)local_rows));
            }
            Size     = this.Size;         //new System.Drawing.Size(529, 419);
            TabIndex = 0;

            //And now, for the buttons
            button_grid = new PSI_Button[local_columns, local_rows];

            for (int i = 0; i < local_columns; i++)
            {
                for (int j = enable_accumulator_display ? 1 : 0; j < local_rows; j++)
                {
                    button_grid[i, j] = new PSI_Button(this.Parent as Canvas);
                    Controls.Add(button_grid[i, j], i, j);
                    this.button_grid[i, j].Dock     = System.Windows.Forms.DockStyle.Fill;
                    this.button_grid[i, j].Name     = "button" + i.ToString() + j.ToString();
                    this.button_grid[i, j].TabIndex = 0;
                    this.button_grid[i, j].Text     = i.ToString() + "," + j.ToString();
                    //this.button_grid[i, j].UseVisualStyleBackColor = true;
                }
            }
        }
Ejemplo n.º 14
0
        public void addRowTable(Dictionary <string, double> pricePerYard, Dictionary <int, double> rslArea, AnalysisRowPanel currentRow)
        {
            double totalRowCost = 0.0;
            double totalRowArea = 0.0;

            foreach (int i in rslArea.Keys)
            {
                if (rslArea[i] > 0)
                {
                    rowStyle = RowStyles[0];
                    Height  += (int)(rowStyle.Height - 70);
                    RowStyles.Add(new RowStyle(rowStyle.SizeType, rowStyle.Height));
                    Controls.Add(new TextBox()
                    {
                        Text = i.ToString(), ReadOnly = true
                    }, 0, RowCount++);
                    NumericUpDown budgetUpDown = new NumericUpDown()
                    {
                        Increment = 100,
                        Minimum   = 0,
                        Maximum   = (decimal)(pricePerYard[currentRow.getTreatment()] * (rslArea[i] / 9)),
                        Value     = (decimal)(pricePerYard[currentRow.getTreatment()] * (rslArea[i] / 9)),
                    };
                    NumericUpDown areaUpDown = new NumericUpDown()
                    {
                        Increment = 100,
                        Minimum   = 0,
                        Maximum   = (decimal)(rslArea[i] / 9),
                        Value     = (decimal)(rslArea[i] / 9)
                    };
                    NumericUpDown percentCoveredUpDown = new NumericUpDown()
                    {
                        Increment = 5,
                        Minimum   = 0,
                        Maximum   = 100,
                        Value     = 100
                    };

                    double costPerYard = (double)(budgetUpDown.Value / areaUpDown.Value);

                    budgetUpDown.ValueChanged         += new EventHandler(delegate(object sender, EventArgs e) { BudgetUpDown_ValueChanged(sender, e, costPerYard, budgetUpDown, areaUpDown, percentCoveredUpDown); });
                    areaUpDown.ValueChanged           += new EventHandler(delegate(object sender, EventArgs e) { AreaUpDown_ValueChanged(sender, e, costPerYard, budgetUpDown, areaUpDown, percentCoveredUpDown); });
                    percentCoveredUpDown.ValueChanged += new EventHandler(delegate(object sender, EventArgs e) { PercentCoveredUpDown_ValueChanged(sender, e, costPerYard, budgetUpDown, areaUpDown, percentCoveredUpDown); });

                    costBreakdown[budgetUpDown] = budgetUpDown.Value;
                    areaBreakdown[areaUpDown]   = areaUpDown.Value;
                    Controls.Add(budgetUpDown, 1, RowCount - 1);
                    Controls.Add(areaUpDown, 2, RowCount - 1);
                    Controls.Add(percentCoveredUpDown, 3, RowCount - 1);
                    totalRowCost += (double)budgetUpDown.Value;
                    totalRowArea += (double)areaUpDown.Value;
                }
            }
            formAnalysis.textBoxRowCost.Text    = "$" + String.Format("{0:n0}", totalRowCost);;
            formAnalysis.textBoxRowArea.Text    = String.Format("{0:n0}", (Math.Round(totalRowArea, 2))) + " yds\u00b2";;
            formAnalysis.textBoxRowPercent.Text = "100.00";
            currentRow.tableCreated             = true;
        }
Ejemplo n.º 15
0
 public PlayingView(Level level)
 {
     this.level = level;
     coins      = new Label {
         Text = "Монеты: " + level.PlayerCoins, Dock = DockStyle.Fill
     };
     swordsmanButton = new Button {
         Text = "Мечник (" + new Swordsman(true).Cost + ")", Dock = DockStyle.Fill
     };
     archerButton = new Button {
         Text = "Лучник (" + new Archer(true).Cost + ")", Dock = DockStyle.Fill
     };
     magicianButton = new Button {
         Text = "Маг (" + new Magician(true).Cost + ")", Dock = DockStyle.Fill
     };
     gameInterface = new TableLayoutPanel();
     gameInterface.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
     gameInterface.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33f));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33f));
     gameInterface.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33f));
     gameInterface.Controls.Add(coins, 0, 0);
     gameInterface.Controls.Add(swordsmanButton, 1, 0);
     gameInterface.Controls.Add(archerButton, 2, 0);
     gameInterface.Controls.Add(magicianButton, 3, 0);
     gameInterface.Dock   = DockStyle.Fill;
     gameInterface.Margin = Padding.Empty;
     gameField            = new GameField(level);
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
     RowStyles.Add(new RowStyle(SizeType.Absolute, 100));
     RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
     Dock = DockStyle.Fill;
     Controls.Add(gameInterface, 0, 0);
     Controls.Add(gameField, 0, 1);
     swordsmanButton.Click   += (s, a) => level.BuyCharacter(new Swordsman(true));
     archerButton.Click      += (s, a) => level.BuyCharacter(new Archer(true));
     magicianButton.Click    += (s, a) => level.BuyCharacter(new Magician(true));
     level.PlayerCoinsChange += (coins) => this.coins.Text = "Монеты: " + coins;
     level.Message           += (message) => MessageBox.Show(message);
     timer          = new Timer();
     timer.Interval = 100;
     timer.Tick    += (s, e) => level.DoNextStep();
     timer.Start();
     level.EndWin += (win) =>
     {
         timer.Stop();
         if (win)
         {
             MessageBox.Show("Вы победили!");
         }
         else
         {
             MessageBox.Show("Вы проиграли(");
         }
     };
 }
Ejemplo n.º 16
0
        public void PopulateTable()
        {
            RowStyles.Clear();
            Controls.Clear();
            if (LocalReferencedArticles.Count + SitecoreReferencedArticles.Count > 0)
            {
                Label ReferencedArticlesHeader = CreateHeaderLabel(@"Referenced Articles: ");
                SetColumnSpan(ReferencedArticlesHeader, ColumnCount);
                RowStyles.Add(new RowStyle(SizeType.Absolute, 20F));
                Controls.Add(ReferencedArticlesHeader);
                ConfigureLabel(ReferencedArticlesHeader);
                foreach (ArticlePreviewInfo article in LocalReferencedArticles)
                {
                    bool bold = !SitecoreReferencedArticles.Select(a => a.ArticleNumber).Contains(article.ArticleNumber);
                    AddRow(article, false, bold, false);
                }
                foreach (ArticlePreviewInfo article in SitecoreReferencedArticles.Where(a => !LocalReferencedArticles.Select(b => b.ArticleNumber).Contains(a.ArticleNumber)))
                {
                    bool italic = !LocalReferencedArticles.Select(a => a.ArticleNumber).Contains(article.ArticleNumber);
                    AddRow(article, italic, false, false);
                }
            }

            if (LocalRelatedArticles.Count + SitecoreRelatedArticles.Count > 0)
            {
                Label RelatedArticlesHeader = CreateHeaderLabel(@"Related Articles: ");
                SetColumnSpan(RelatedArticlesHeader, ColumnCount);
                RowStyles.Add(new RowStyle(SizeType.Absolute, 20F));
                Controls.Add(RelatedArticlesHeader);
            }
            foreach (ArticlePreviewInfo article in SitecoreRelatedArticles)
            {
                if (LocalReferencedArticles.Select(a => a.ArticleNumber).Contains(article.ArticleNumber))
                {                 //sitecore related article already referenced inline locally, so strikeout
                    AddRow(article, true, false, false);
                }
                else
                {
                    AddRow(article);
                }
            }
            foreach (ArticlePreviewInfo article in LocalRelatedArticles)
            {
                if (!HasArticle(SitecoreRelatedArticles, article))
                {
                    AddRow(article, false, true);
                }
            }
            if (IsDifferentFromSitecore())
            {
                MenuItem.HasChanged = true;
                MenuItem.UpdateBackground();
                MenuItem.Refresh();
            }
            UpdateMenuItem();
        }
Ejemplo n.º 17
0
 public QuadSplitControl()
 {
     MinimumViewSize = 2;
     _resizing       = _inH = _inV = false;
     RowCount        = ColumnCount = 2;
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
     RowStyles.Add(new RowStyle(SizeType.Percent, 50));
     RowStyles.Add(new RowStyle(SizeType.Percent, 50));
 }
Ejemplo n.º 18
0
        public Layout(MenuStrip menu, Control control)
        {
            Dock        = DockStyle.Fill;
            RowCount    = 2;
            ColumnCount = 1;
            RowStyles.Add(new RowStyle(SizeType.AutoSize));

            Controls.Add(menu, 0, 0);
            Controls.Add(control, 0, 1);
        }
Ejemplo n.º 19
0
 private void addProperty(Property p)
 {
     RowCount++;
     RowStyles.Clear();
     for (int i = 0; i < RowCount; i++)
     {
         RowStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0f / RowCount));
     }
     Controls.Add(p, 0, RowCount - 1);
 }
Ejemplo n.º 20
0
        public void Add(Form1.cprinter p, string name, string error)
        {
            RowStyles.Add(new RowStyle(SizeType.Absolute, 65F));
            RowCount++;
            var msng3 = new msng(p, name, error);

            Controls.Add(msng3, 0, RowCount - 1);

            //var q = new msng(name, error) {Location = new System.Drawing.Point( };
            //msngs.Add(q);
        }
Ejemplo n.º 21
0
        public void updateRowTable(Dictionary <string, double> pricePerYard, Dictionary <int, double> rslArea, AnalysisRowPanel currentRow)
        {
            for (int i = 5; i < Controls.Count; i++)
            {
                Controls.RemoveAt(i);
            }
            foreach (int i in rslArea.Keys)
            {
                if (rslArea[i] > 0)
                {
                    rowStyle = RowStyles[0];
                    Height  += (int)(rowStyle.Height - 60);
                    RowStyles.Add(new RowStyle(rowStyle.SizeType, rowStyle.Height));
                    Controls.Add(new TextBox()
                    {
                        Text = i.ToString(), ReadOnly = true
                    }, 0, RowCount++);
                    NumericUpDown budgetUpDown = new NumericUpDown()
                    {
                        Increment = 100,
                        Minimum   = 0,
                        Maximum   = (decimal)(pricePerYard[currentRow.getTreatment()] * (rslArea[i] / 9)),
                        Value     = (decimal)(pricePerYard[currentRow.getTreatment()] * (rslArea[i] / 9)),
                    };
                    NumericUpDown areaUpDown = new NumericUpDown()
                    {
                        Increment = 100,
                        Minimum   = 0,
                        Maximum   = (decimal)(rslArea[i] / 9),
                        Value     = (decimal)(rslArea[i] / 9)
                    };
                    NumericUpDown percentCoveredUpDown = new NumericUpDown()
                    {
                        Increment = 5,
                        Minimum   = 0,
                        Maximum   = 100,
                        Value     = 100
                    };

                    double costPerYard = (double)(budgetUpDown.Value / areaUpDown.Value);

                    budgetUpDown.ValueChanged         += new EventHandler(delegate(object sender, EventArgs e) { BudgetUpDown_ValueChanged(sender, e, costPerYard, budgetUpDown, areaUpDown, percentCoveredUpDown); });
                    areaUpDown.ValueChanged           += new EventHandler(delegate(object sender, EventArgs e) { AreaUpDown_ValueChanged(sender, e, costPerYard, budgetUpDown, areaUpDown, percentCoveredUpDown); });
                    percentCoveredUpDown.ValueChanged += new EventHandler(delegate(object sender, EventArgs e) { PercentCoveredUpDown_ValueChanged(sender, e, costPerYard, budgetUpDown, areaUpDown, percentCoveredUpDown); });

                    costBreakdown[budgetUpDown] = budgetUpDown.Value;
                    areaBreakdown[areaUpDown]   = areaUpDown.Value;
                    Controls.Add(budgetUpDown, 1, RowCount - 1);
                    Controls.Add(areaUpDown, 2, RowCount - 1);
                    Controls.Add(percentCoveredUpDown, 3, RowCount - 1);
                }
            }
            currentRow.tableValid = true;
        }
Ejemplo n.º 22
0
 public void clearProperties()
 {
     SuspendLayout();
     Controls.Clear();
     ColumnCount = 1;
     RowCount    = 0;
     ColumnStyles.Clear();
     ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     RowStyles.Clear();
     RowStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     ResumeLayout();
 }
Ejemplo n.º 23
0
 public PluginView()
 {
     AutoScroll  = true;
     BackColor   = SystemColors.Window;
     ColumnCount = 1;
     ColumnStyles.Add(new ColumnStyle());
     Padding  = new Padding(0, 0, 6, 0);
     RowCount = 1;
     RowStyles.Add(new RowStyle());
     BorderStyle     = BorderStyle.FixedSingle;
     VisibleChanged += PluginView_VisibleChanged;
 }
 void nomalizeRowStyles()
 {   // set all rows to absolute and the last one to percent=100!
     if (rowHeights.Length <= 0) return;
     rowHeights = GetRowHeights();
     RowStyles.Clear();
     for (int i = 0; i < RowCount - 1; i++)
     {
         RowStyle cs = new RowStyle(SizeType.Absolute, rowHeights[i]);
         RowStyles.Add(cs);
     }
     RowStyles.Add ( new RowStyle(SizeType.Percent, 100) );
     isNormal = true;
 }
        InitializeComponent()
        {
            SuspendLayout();

            Size        = new Size(200, 300);
            BorderStyle = BorderStyle.Fixed3D;
            ColumnCount = 1;
            RowCount    = 3;

            rowImage = new RowStyle(SizeType.Absolute, 200F);
            RowStyles.Add(rowImage);

            pcbImage = new PictureBox()
            {
                Name     = "pcbImage",
                Size     = new Size(200, 200),
                SizeMode = PictureBoxSizeMode.Zoom
            };
            Controls.Add(pcbImage, 0, 0);

            rowCaption = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowCaption);

            lblCaption = new Label()
            {
                Name     = "lblCaption",
                AutoSize = true
            };
            Controls.Add(lblCaption, 0, 1);

            rowRegion = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowRegion);

            lblRegion = new Label()
            {
                Name      = "lblRegion",
                ForeColor = Color.FromArgb(175, 175, 175),
                AutoSize  = true
            };
            Controls.Add(lblRegion, 0, 2);

            MouseHover += new EventHandler(ToggleTranslation);
            MouseLeave += new EventHandler(ToggleTranslation);
            foreach (Control control in Controls)
            {
                control.MouseHover += new EventHandler(ToggleTranslation);
                control.MouseLeave += new EventHandler(ToggleTranslation);
            }

            ResumeLayout(false);
        }
        InitializeComponent()
        {
            SuspendLayout();

            Size = new Size(600, 450);
            Font = Properties.Settings.Default.DisplayFont;

            ColumnCount = 1;
            RowCount    = 3;

            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));

            rowHeader = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowHeader);

            rowSentence = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowSentence);

            rowChallenge = new RowStyle(SizeType.AutoSize);
            RowStyles.Add(rowChallenge);

            lblHeader = new Label()
            {
                Name     = "lblHeader",
                AutoSize = true,
                Font     = new Font(Font.FontFamily, 32, FontStyle.Bold,
                                    GraphicsUnit.Pixel),
                MaximumSize = new Size(Width, 0)
            };
            Controls.Add(lblHeader, 0, 0);

            lblSentence = new Label()
            {
                Name     = "lblSentence",
                Font     = new Font(Font, FontStyle.Italic),
                AutoSize = true,
            };
            lblSentence.Margin = new Padding(lblSentence.Margin.Left,
                                             lblSentence.Margin.Top + 24, lblSentence.Margin.Right,
                                             lblSentence.Margin.Bottom + 24);
            Controls.Add(lblSentence, 0, 1);

            flpChallenge = new FlowLayoutPanel()
            {
                Name = "flpChallenge",
                Dock = DockStyle.Fill
            };
            Controls.Add(flpChallenge, 0, 2);

            ResumeLayout(false);
        }
        public void UpdateRows()
        {
            Controls.Clear();
            RowStyles.Clear();

            RowCount = Documents.Count;
            InitScrollBar();

            for (int i = 0; i < Documents.Count; i++)
            {
                Controls.Add(Documents[i], 0, i);                   //add control to view
                RowStyles.Add(new RowStyle(SizeType.Absolute, 95)); //style the just added row
            }
        }
Ejemplo n.º 28
0
        private void BuildBoxes(MultiText multiText)
        {
            SuspendLayout();

            if (Controls.Count > 0)
            {
                _inputBoxes.Clear();
                Controls.Clear();
                RowCount = 0;
                RowStyles.Clear();
            }
            Debug.Assert(RowCount == 0);
            foreach (IWritingSystemDefinition writingSystem in WritingSystemsForThisField)
            {
                RowStyles.Add(new RowStyle(SizeType.AutoSize));


                var box = AddTextBox(writingSystem, multiText);
                if (box == null)
                {
                    continue;
                }

                Label label = AddWritingSystemLabel(((IControlThatKnowsWritingSystem)box).WritingSystem.Abbreviation);
                label.Click      += subControl_Click;
                label.MouseWheel += subControl_MouseWheel;

                Controls.Add(label, 0, RowCount);
                Controls.Add(box, 1, RowCount);

                if (_showAnnotationWidget)                 //false for ghosts
                {
                    //TODO: THIS IS TRANSITIONAL CODE... AnnotationWidget should probably become a full control (or go away)
                    AnnotationWidget aw = new AnnotationWidget(multiText,
                                                               writingSystem.Id,
                                                               box.Name + "-annotationWidget");
                    Control annotationControl = aw.MakeControl(new Size());                     //p.Size);
                    annotationControl.Click += subControl_Click;
                    annotationControl.Anchor = AnchorStyles.Right;
                    Controls.Add(annotationControl, 2, RowCount);
                }
                //else
                //{
                //    SetColumnSpan(box, 2);
                //}
                RowCount++;
            }

            ResumeLayout(false);
        }
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the ByteViewer class.
 /// </summary>
 public KryptonByteViewer()
 {
     SuspendLayout();
     CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset;
     ColumnCount     = 1;
     ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
     RowCount = 1;
     RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
     InitUI();
     ResumeLayout();
     _displayMode   = DisplayMode.Hexdump;
     DoubleBuffered = true;
     SetStyle(ControlStyles.ResizeRedraw, value: true);
     SetBytes(new byte[] { });
 }
Ejemplo n.º 30
0
 // Sets up the grid with the appropriate dimensions
 private void SetupGridStyles()
 {
     // Loops through each column
     for (uint i = 0; i < ColumnCount; i++)
     {
         // Adds a column style which gives each column an equal amount of space
         ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100 / ColumnCount));
     }
     // Loops through each row
     for (uint i = 0; i < RowCount; i++)
     {
         // Adds a row style which gives each column an equal amount of space
         RowStyles.Add(new RowStyle(SizeType.Percent, 100 / RowCount));
     }
 }