Esempio n. 1
0
 private void EnsureOrientation()
 {
     if (Orientation == Orientation.Vertical && tableLayoutPanel1.ColumnStyles.Count < 3)
     {
         tableLayoutPanel1.SuspendLayout();
         tableLayoutPanel1.RowStyles.Clear();
         tableLayoutPanel1.ColumnStyles.Clear();
         tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
         tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, (Panel1Visible && !Collapsed) ? SplitterDistance : 0));
         tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, Panel1Visible ? SplitterWidth : 0));
         tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
         tableLayoutPanel1.SetCellPosition(panel1, new TableLayoutPanelCellPosition(0, 0));
         tableLayoutPanel1.SetCellPosition(splitter, new TableLayoutPanelCellPosition(1, 0));
         tableLayoutPanel1.SetCellPosition(panel2, new TableLayoutPanelCellPosition(2, 0));
         EnsureFixedSize();
         tableLayoutPanel1.ResumeLayout();
     }
     else if (Orientation == Orientation.Horizontal && tableLayoutPanel1.RowStyles.Count < 3)
     {
         tableLayoutPanel1.SuspendLayout();
         tableLayoutPanel1.RowStyles.Clear();
         tableLayoutPanel1.ColumnStyles.Clear();
         tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
         tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, (Panel1Visible && !Collapsed) ? SplitterDistance : 0));
         tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, Panel1Visible ? SplitterWidth : 0));
         tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.AutoSize));
         tableLayoutPanel1.SetCellPosition(panel1, new TableLayoutPanelCellPosition(0, 0));
         tableLayoutPanel1.SetCellPosition(splitter, new TableLayoutPanelCellPosition(0, 1));
         tableLayoutPanel1.SetCellPosition(panel2, new TableLayoutPanelCellPosition(0, 2));
         EnsureFixedSize();
         tableLayoutPanel1.ResumeLayout();
     }
 }
Esempio n. 2
0
        public void ItemSelect(List <Elem> selected, bool refocus)
        {
            m_selected = selected;

            try
            {
                updating       = true;
                alreadyChanged = false;
                tableLayoutPanel.SuspendLayout();

                labelEditRichEditBox.Reset();
                lexEditRichEditBox.Reset();

                ItemSelectLexEdit();
                ItemSelectNodeEdit(refocus);
                ItemSelectNodeActions();
                ItemSelectTracePane();
            }
            finally
            {
                updating = false;
                tableLayoutPanel.ResumeLayout(true);
                tableLayoutPanel.PerformLayout();
            }
        }
Esempio n. 3
0
            public void AddToTable(TableLayoutPanel table, int row)
            {
                table.SuspendLayout();
                table.Controls.Add(Name, 0, row);
                table.Controls.Add(ActionKind, 1, row);
                table.Controls.Add(AirSuperiority, 2, row);
                table.Controls.Add(Distance, 3, row);
                table.Controls.Add(Squadrons, 4, row);
                table.ResumeLayout();

                #region set RowStyle
                RowStyle rs = new RowStyle(SizeType.Absolute, 21);

                if (table.RowStyles.Count > row)
                {
                    table.RowStyles[row] = rs;
                }
                else
                {
                    while (table.RowStyles.Count <= row)
                    {
                        table.RowStyles.Add(rs);
                    }
                }
                #endregion
            }
Esempio n. 4
0
        private void PopulateColors(TableLayoutPanel t)
        {
            t.SuspendLayout();
            ClearTable(t);
            //string name = "Background";
            //Color c = Color.FromArgb(255, 255, 255);
            //Control con = null;

            foreach (string name in ThemeHelper.SystemColorPropertyNames)
            {
                if (ActiveFile == null)
                {
                    //populate from current system colors
                    AddRow(t, name, ThemeHelper.SystemColorFromSystemName(name), null, null);
                }
                else
                {
                    if (ActiveFile.TryGetColor(name, out Color c))
                    {
                        AddRow(t, name, c, null, null);
                    }
                }
            }

            //pad the rest with autosize row
            t.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            t.RowCount = t.RowCount + 1;
            t.ResumeLayout(true);
        }
Esempio n. 5
0
 public static void ClearValues(TableLayoutPanel tp)
 {
     tp.SuspendLayout();
     foreach (Control item in tp.Controls)
     {
         if (item is TextEdit)
         {
             item.Text = "";
         }
         if (item is ComboBoxEdit)
         {
             item.Text = "";
         }
         if (item is DateEdit)
         {
             item.Text = "";
         }
         if (item is MemoEdit)
         {
             item.Text = "";
         }
         //if (item is GridLookUpEdit) { item.Text = ""; }
     }
     tp.ResumeLayout();
 }
Esempio n. 6
0
 public static void DisableControls(TableLayoutPanel tp)
 {
     tp.SuspendLayout();
     foreach (Control item in tp.Controls)
     {
         if (item is TextEdit)
         {
             item.Enabled = false;
         }
         if (item is ComboBoxEdit)
         {
             item.Enabled = false;
         }
         if (item is DateEdit)
         {
             item.Enabled = false;
         }
         //if (item is GridLookUpEdit) { item.Enabled = false; }
         if (item is SimpleButton)
         {
             item.Enabled = false;
         }
         if (item is CheckEdit)
         {
             item.Enabled = false;
         }
     }
     tp.ResumeLayout();
 }
Esempio n. 7
0
        public static void RemoveRow(this TableLayoutPanel tableLayoutPanel, int rowNumber)
        {
            ArrayList controls = new ArrayList(tableLayoutPanel.Controls);

            foreach (Control control in controls)
            {
                int row = tableLayoutPanel.GetRow(control);
                if (row == rowNumber)
                {
                    tableLayoutPanel.Controls.Remove(control);
                }
            }
            tableLayoutPanel.RowStyles.RemoveAt(rowNumber);
            foreach (Control control in tableLayoutPanel.Controls)
            {
                int row = tableLayoutPanel.GetRow(control);
                if (row > rowNumber)
                {
                    tableLayoutPanel.SetRow(control, row - 1);
                }
            }
            tableLayoutPanel.PerformLayout();
            tableLayoutPanel.ResumeLayout(true);
            tableLayoutPanel.Refresh();
        }
        private void InitializeComponent2()
        {
            TableLayoutPanel tableLayoutPanel1 = new TableLayoutPanel();

            mainView            = new SimpleScrollableControlMainView(this);
            horizontalScrollBar = new HorizontalScrollBarView(this);
            verticalScrollBar   = new VerticalScrollBarView(this);
            smallCornerView     = new ScrollableControlSmallCornerView();
            tableLayoutPanel1.SuspendLayout();
            SuspendLayout();
            tableLayoutPanel1.ColumnCount = 2;
            tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, CompoundScrollableControl.scrollBarWidth));
            mainControl = mainView.CreateControl();
            tableLayoutPanel1.Controls.Add(mainControl, 0, 0);
            tableLayoutPanel1.Controls.Add(horizontalScrollBar.CreateControl(), 0, 1);
            tableLayoutPanel1.Controls.Add(verticalScrollBar.CreateControl(), 1, 0);
            tableLayoutPanel1.Controls.Add(smallCornerView.CreateControl(), 1, 1);
            tableLayoutPanel1.Dock     = DockStyle.Fill;
            tableLayoutPanel1.Location = new Point(0, 0);
            tableLayoutPanel1.Margin   = new Padding(0);
            tableLayoutPanel1.Name     = "tableLayoutPanel1";
            tableLayoutPanel1.RowCount = 2;
            tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, CompoundScrollableControl.scrollBarWidth));
            tableLayoutPanel1.Size     = new Size(409, 390);
            tableLayoutPanel1.TabIndex = 0;
            AutoScaleDimensions        = new SizeF(6F, 13F);
            AutoScaleMode = AutoScaleMode.Font;
            Controls.Add(tableLayoutPanel1);
            Name = "ScrollableControl2";
            Size = new Size(409, 390);
            tableLayoutPanel1.ResumeLayout(false);
            ResumeLayout(false);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            if (currentImage == null)
            {
                return;
            }


            if (MetroMessageBox.Show(this, "Confirmez-vous la suppression de la cellule?", "Question", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                TableLayoutPanel parent = (TableLayoutPanel)currentImage.Parent.Parent;

                parent.SuspendLayout();

                parent.ColumnStyles.RemoveAt(parent.ColumnCount - 1);
                //parent.ColumnCount--;
                //var pos = parent.ColumnCount - 1;
                //parent.ColumnStyles.Insert(pos, new ColumnStyle(SizeType.Percent, 100f));

                //var pb = getIndicImageCtrl(c);

                //parent.Controls.Add(pb, pos, 0);

                //if (c == null) pb.Tag = new TabloidConfigCell();

                parent.ResumeLayout();
            }
        }
Esempio n. 10
0
        private void Build()
        {
            var textArea = new RichTextBox();

            textArea.Multiline = true;

            var pnlTable = new TableLayoutPanel();

            pnlTable.SuspendLayout();
            pnlTable.Dock = DockStyle.Fill;

            var btFirst = new Button
            {
                Text = "Generar HTML",
                Dock = DockStyle.Top
            };

            btFirst.ForeColor = Color.White;
            btFirst.Click    += (sender, args) => ActionParse(textArea.Text);

            pnlTable.Controls.Add(btFirst);
            textArea.Parent = pnlTable;
            textArea.Dock   = DockStyle.Fill;

            pnlTable.ResumeLayout(false);
            this.Controls.Add(pnlTable);

            textArea.BackColor      = Color.FromArgb(63, 63, 63);
            textArea.SelectionColor = Color.White;
            this.BackColor          = Color.FromArgb(63, 63, 63);

            this.MinimumSize = new Size(320, 240);
            this.Text        = "TextBook";
        }
Esempio n. 11
0
        private void Build()
        {
            this.SuspendLayout();

            var pnlDisponibilidad = new TableLayoutPanel {
                Dock = DockStyle.Fill
            };

            pnlDisponibilidad.SuspendLayout();
            this.Controls.Add(pnlDisponibilidad);

            var pnlTexto = this.BuildPnlTexto();

            pnlDisponibilidad.Controls.Add(pnlTexto);
            var pnlBotones = this.BuildPnlBotones();

            pnlDisponibilidad.Controls.Add(pnlBotones);
            pnlDisponibilidad.ResumeLayout(true);

            this.Text = "Comprobacion de Disponibilidad ";
            this.Size = new Size(600,
                                 pnlBotones.Height + pnlTexto.Height);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MinimizeBox     = false;
            this.MaximizeBox     = false;
            this.StartPosition   = FormStartPosition.CenterParent;
            this.ResumeLayout(false);
        }
        private void Build()
        {
            this.SuspendLayout();

            var pnlFiltroPorPersona = new TableLayoutPanel {
                Dock = DockStyle.Fill
            };

            pnlFiltroPorPersona.SuspendLayout();
            this.Controls.Add(pnlFiltroPorPersona);

            var pnlFiltro = this.BuildPnlFiltroPersona();

            pnlFiltroPorPersona.Controls.Add(pnlFiltro);

            var pnlBotones = this.BuildPnlBotones();

            pnlFiltroPorPersona.Controls.Add(pnlBotones);

            pnlFiltroPorPersona.ResumeLayout(true);

            this.Text = "Filtro Por Persona ";
            this.Size = new Size(600,
                                 pnlFiltro.Height + pnlBotones.Height);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MinimizeBox     = false;
            this.MaximizeBox     = false;
            this.StartPosition   = FormStartPosition.CenterParent;
            this.ResumeLayout(false);
        }
Esempio n. 13
0
        public void FillWaitInfoListIntoTabelLayoutPanel(TableLayoutPanel layoutPanel, List <WaitInfoV1d0> waitInfoList)
        {
            int waitInfoCount = waitInfoList.Count;

            layoutPanel.GetType().GetProperty("DoubleBuffered",
                                              System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(layoutPanel, true, null);
            layoutPanel.SuspendLayout();
            if (layoutPanel.RowCount != waitInfoCount)
            {
                layoutPanel.Height   = waitInfoCount * 100;
                layoutPanel.RowCount = waitInfoCount;
                layoutPanel.RowStyles.Clear();
                for (int i = 0; i < waitInfoCount; i++)
                {
                    if (i < (waitInfoCount - 1))
                    {
                        layoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 100));
                    }
                    else
                    {
                        layoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
                    }
                }
            }
            layoutPanel.Controls.Clear();
            for (int i = 0; i < waitInfoCount; i++)
            {
                QueueInfoDisplayBarV1d0 displayBar = new QueueInfoDisplayBarV1d0(waitInfoList[i]);
                displayBar.Dock = DockStyle.Fill;
                layoutPanel.Controls.Add(displayBar, 1, i);
            }
            layoutPanel.ResumeLayout();
        }
Esempio n. 14
0
        // создаЄт вдумерный массив текстарий, встав뤤 каждую в таблицу расположени¤
        private TextBox[,] InitTextBoxMatrix(TableLayoutPanel layoutPanel, int count, bool readOnly)
        {
            layoutPanel.SuspendLayout();

            layoutPanel.Controls.Clear();

            layoutPanel.ColumnStyles.Clear();
            layoutPanel.ColumnCount = count;

            layoutPanel.RowStyles.Clear();
            layoutPanel.RowCount = count;

            TextBox[,] result = new TextBox[count, count];
            float cellSize = 1f / count * 100f;

            for (int col = 0; col < count; ++col)
            {
                layoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, cellSize));
                for (int row = 0; row < count; ++row)
                {
                    layoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, cellSize));

                    TextBox textBox = InitTextBox(readOnly);

                    layoutPanel.Controls.Add(textBox, col, row);
                    result[col, row] = textBox;
                }
            }

            layoutPanel.ResumeLayout(true);

            return(result);
        }
 private void AdjustAppWindowSize()
 {
     this.SuspendLayout();
     _tablepanel.SuspendLayout();
     _employee_info_entry_panel.SuspendLayout();
     _training_info_entry_panel.SuspendLayout();
     _picturebox.Width  = _picturebox.Image.Width;
     _picturebox.Height = _picturebox.Image.Height;
     _employee_info_entry_panel.Height = EMPLOYEE_INFO_PANEL_HEIGHT;
     _employee_info_entry_panel.Width  = EMPLOYEE_INFO_PANEL_WIDTH;
     _training_info_entry_panel.Height = TRAINING_INFO_PANEL_HEIGHT;
     _training_info_entry_panel.Width  = TRAINING_INFO_PANEL_WIDTH;
     _training_textbox.Width           = TRAINING_TEXTBOX_WIDTH;
     _training_textbox.Height          = TRAINING_TEXTBOX_HEIGHT;
     _tablepanel.Width = (_picturebox.Width + _flowpanel.Width +
                          _employee_info_entry_panel.Width + SMALL_PADDING);
     _tablepanel.Height = (_picturebox.Image.Height + _training_textbox.Height +
                           SMALL_PADDING);
     this.Width  = _tablepanel.Width + SMALL_PADDING;
     this.Height = _tablepanel.Height;
     _training_info_entry_panel.ResumeLayout();
     _employee_info_entry_panel.ResumeLayout();
     _tablepanel.ResumeLayout();
     this.ResumeLayout();
 }
Esempio n. 16
0
        /// <summary>
        /// <see cref="TableLayoutPanel"/> の内容をクリアする
        /// </summary>
        public void Clear()
        {
            // 対象のTableLayoutPanelコントロール取得
            TableLayoutPanel tablePanel = PlListTable;

            // 描画処理を一時中断
            tablePanel.SuspendLayout();

            try
            {
                // 全てのコントロールをクリア
                // (下からクリアしていく)
                for (int row = tablePanel.RowCount - 1; row > -1; row--)
                {
                    RemoveRow(row, true);
                }

                // 最初の1行目を生成(TableLayoutPanelは0行を認めていないため1行目を生成する)
                tablePanel.RowCount = 1;

                // 行のスタイル設定を初期化(引数にNULLを指定することで初期化を行わせる)
                SetRowStyle(null);
            }
            finally
            {
                // 描画処理を再開
                tablePanel.ResumeLayout(false);
                tablePanel.PerformLayout();
            }
        }
    public void InitializeComponents(MainApp ma)
    {
        _panel = new TableLayoutPanel();
        _panel.SuspendLayout();
        _panel.ColumnCount  = 10;
        _panel.RowCount     = 10;
        _panel.Dock         = DockStyle.Top;
        _panel.AutoSize     = true;
        _panel.AutoSizeMode = AutoSizeMode.GrowAndShrink;

        for (int i = 0; i < _floor.GetLength(0); i++)
        {
            for (int j = 0; j < _floor.GetLength(1); j++)
            {
                _floor[i, j]        = new Button();
                _floor[i, j].Click += ma.MarkSpace;
                _panel.Controls.Add(_floor[i, j]);
            }
        }

        this.SuspendLayout();
        this.Text   = "TableLayoutGUI Window";
        this.Width  = 850;
        this.Height = 325;
        this.Controls.Add(_panel);
        _panel.ResumeLayout();
        this.ResumeLayout();
    } // end InitializeComponents() method
Esempio n. 18
0
        public HTMLWindow(string texto)
        {
            var textArea = new RichTextBox
            {
                Multiline = true,
                BackColor = Color.FromArgb(63, 63, 63),
                ForeColor = Color.White,
                Text      = texto
            };

            var pnlTable = new TableLayoutPanel();

            pnlTable.SuspendLayout();
            pnlTable.Dock = DockStyle.Fill;

            textArea.Parent = pnlTable;
            textArea.Dock   = DockStyle.Fill;

            pnlTable.ResumeLayout(false);
            this.Controls.Add(pnlTable);

            this.BackColor = Color.FromArgb(63, 63, 63);

            this.MinimumSize = new Size(320, 240);
            this.Text        = "HTML Generated";
        }
Esempio n. 19
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="FormProcessDisplay" /> class.
        /// </summary>
        /// <param name="windowTitle">The description / form title</param>
        /// <param name="withLoggerDisplay">True if a debug logging windows should be shown</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        public FormProcessDisplay(string windowTitle, bool withLoggerDisplay, CancellationToken cancellationToken)
        {
            CancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
            m_ProcessDisplay        = new ProcessDisplayTime(CancellationTokenSource.Token);
            InitializeComponent();

            m_Title   = windowTitle;
            base.Text = windowTitle;

            Maximum = 0;
            SuspendLayout();
            m_TableLayoutPanel.SuspendLayout();
            if (withLoggerDisplay)
            {
                Height += 100;

                m_LoggerDisplay = new LoggerDisplay {
                    MinLevel = Logger.Level.Debug, Dock = DockStyle.Fill, Multiline = true, TabIndex = 8
                };
                m_TableLayoutPanel.Controls.Add(m_LoggerDisplay, 0, 3);
                m_LoggerDisplay.Dock = DockStyle.Fill;
            }

            m_TableLayoutPanel.ResumeLayout(false);
            m_TableLayoutPanel.PerformLayout();
            ResumeLayout(false);
            PerformLayout();
        }
            public void AddToTable(TableLayoutPanel table)
            {
                table.SuspendLayout();
                table.Controls.Add(Name, 0, 0);
                table.Controls.Add(StateMain, 1, 0);
                table.Controls.Add(AirSuperiority, 2, 0);
                table.Controls.Add(SearchingAbility, 3, 0);
                table.ResumeLayout();

                int row = 0;

                #region set RowStyle
                RowStyle rs = new RowStyle(SizeType.Absolute, 21);

                if (table.RowStyles.Count > row)
                {
                    table.RowStyles[row] = rs;
                }
                else
                {
                    while (table.RowStyles.Count <= row)
                    {
                        table.RowStyles.Add(rs);
                    }
                }
                #endregion
            }
Esempio n. 21
0
        private void Build()
        {
            var pnlTable = new TableLayoutPanel();

            pnlTable.SuspendLayout();
            pnlTable.Dock = DockStyle.Fill;
            pnlTable.Font = new Font("Century Gothic", 11F, FontStyle.Regular, GraphicsUnit.Point, 0);


            pnlTable.Controls.Add(BuildMatricula());
            pnlTable.Controls.Add(BuildTipo());
            pnlTable.Controls.Add(BuildCliente());
            pnlTable.Controls.Add(BuildFechaContrato());
            pnlTable.Controls.Add(BuildKm());
            pnlTable.Controls.Add(BuildFechaSalida());
            pnlTable.Controls.Add(BuildFechaEntrega());
            pnlTable.Controls.Add(BuildImporteDia());
            pnlTable.Controls.Add(BuildImporteKm());
            pnlTable.Controls.Add(BuildIva());
            pnlTable.Controls.Add(BuildbtAdd());


            pnlTable.ResumeLayout(false);
            this.Controls.Add(pnlTable);

            this.Text        = this.GetType().Name;
            this.MinimumSize = new Size(900, 750);
        }
            public void AddToTable(TableLayoutPanel table, int row)
            {
                table.SuspendLayout();
                table.Controls.Add(Name, 0, row);
                table.Controls.Add(Level, 1, row);
                table.Controls.Add(HP, 2, row);
                table.Controls.Add(Condition, 3, row);
                table.Controls.Add(ShipResource, 4, row);
                table.Controls.Add(Equipments, 5, row);
                table.ResumeLayout();

                #region set RowStyle
                RowStyle rs = new RowStyle(SizeType.Absolute, 21);

                if (table.RowStyles.Count > row)
                {
                    table.RowStyles[row] = rs;
                }
                else
                {
                    while (table.RowStyles.Count <= row)
                    {
                        table.RowStyles.Add(rs);
                    }
                }
                #endregion
            }
Esempio n. 23
0
        private void addTimerRow(ref TableLayoutPanel TLP, string boxText, bool relayout)
        {
            if (TLP.RowCount - StaticUtility.visualNonTimerRows >= StaticUtility.maximumRows) //don't let rows add past limit. Minus 1 is for zero index.
            {
                DialogResult result = MessageBox.Show(
                    "Maximum number of timers have been added. Modify the application config file and restart the application to change the maximum rows."
                    , ""
                    , MessageBoxButtons.OK
                    , MessageBoxIcon.Information
                    , MessageBoxDefaultButton.Button1);
                return;
            }

            TLP.SuspendLayout();
            addRow(TLP);
            int cntIx = TLP.RowCount - 1;

            StaticUtility.addLabel(ref TLP, ref tempLabel, theme.defStartBackColor, theme.defStartForeColor, 1, starts_Click, true, true, 0, cntIx);
            tempLabel.Text = "u";
            StaticUtility.addTextBox(ref TLP, ref tempTextBox, theme.defTxtBxBackColor, theme.defTxtBxForeColor, 0, false, false, 2, cntIx);
            tempTextBox.Text = boxText;
            StaticUtility.addLabel(ref TLP, ref tempLabel, theme.defStartBackColor, theme.defStartForeColor, 0, null, true, false, 3, cntIx);
            tempLabel.Text = "00:00:00";
            TLP.ResumeLayout(false);
            if (relayout)
            {
                TLP.PerformLayout();
            }
        }
Esempio n. 24
0
        private void removeRow(ref TableLayoutPanel TLP, bool relayout)
        {
            int bottomTimerIndex = returnTmrCnt() - 1;// -1 is to get to active's zero index.

            if (!timerCanBeRemoved())
            {
                return;
            }
            if (bottomTimerIndex == TIMEENGINE.getActiveRow())
            {
                TIMEENGINE.changeActive(-1);              // If the active row is to be removed stop.
            }
            TIMEENGINE.resetTimerValue(bottomTimerIndex); // make sure the removed value is zero. It might not be.
            disUpdTotal(TIMEENGINE.engCalcArrayTotal());  // if you removed an existing row you want to reset the total.

            int bottomRowIndex = baseTLP.RowCount - 1;

            TLP.SuspendLayout();
            Control c = TLP.GetControlFromPosition(0, bottomRowIndex);

            TLP.Controls.Remove(c);
            c.Dispose();
            Control d = TLP.GetControlFromPosition(2, bottomRowIndex);

            TLP.Controls.Remove(d);
            d.Dispose();
            Control e = TLP.GetControlFromPosition(3, bottomRowIndex);

            TLP.Controls.Remove(e);
            e.Dispose();
            TLP.RowStyles.RemoveAt(bottomRowIndex);
            TLP.RowCount--;
            TLP.ResumeLayout(false);
            TLP.PerformLayout();
        }
Esempio n. 25
0
        internal void Draw(TableLayoutPanel container)
        {
            container.SuspendLayout();

            int rowIndex = 0;

            if (_headCtrls.Count > 0)
            {
                FlowLayoutPanel headPanel = BuildPanel <FlowLayoutPanel>(container, rowIndex++);
                DoFlowLayout(_headCtrls, headPanel);
            }

            if (_bodyCtrls.Count > 0)
            {
                TableLayoutPanel bodyPanel = BuildPanel <TableLayoutPanel>(container, rowIndex++);
                bodyPanel.CellBorderStyle = _borderStyle;
                DoGridLayout(_bodyCtrls, bodyPanel);
            }

            if (_footCtrls.Count > 0)
            {
                FlowLayoutPanel footerPanel = BuildPanel <FlowLayoutPanel>(container, rowIndex++);
                DoFlowLayout(_footCtrls, footerPanel);
            }

            container.ResumeLayout(false);
        }
Esempio n. 26
0
        // Creating 1-dimensional textbox array by inserting each layout table.
        private TextBox[] InitTextBoxArray(TableLayoutPanel layoutPanel, int count, bool readOnly)
        {
            layoutPanel.SuspendLayout();

            layoutPanel.Controls.Clear();

            layoutPanel.ColumnStyles.Clear();
            layoutPanel.ColumnCount = 1;

            layoutPanel.RowStyles.Clear();
            layoutPanel.RowCount = count;

            var result   = new TextBox[count];
            var cellSize = 1f / count * 100f;

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

            for (var row = 0; row < count; ++row)
            {
                layoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, cellSize));

                TextBox textBox = InitTextBox(readOnly);

                layoutPanel.Controls.Add(textBox, 0, row);
                result[row] = textBox;
            }

            layoutPanel.ResumeLayout(true);

            return(result);
        }
Esempio n. 27
0
        public static SettingsProvider Create(DocumentWindow documentWindow, object[] selectedObjects, TableLayoutPanel layoutPanel, object anyData, bool update)
        {
            //create special
            SettingsProvider provider = null;

            CreateProvider?.Invoke(documentWindow, selectedObjects, layoutPanel, anyData, ref provider);

            //create default
            if (provider == null)
            {
                provider = new SettingsProvider(documentWindow, selectedObjects, layoutPanel, anyData);
            }

            if (update)
            {
                try
                {
                    //!!!!
                    layoutPanel.SuspendLayout();

                    provider.PerformUpdate(false);
                }
                finally
                {
                    layoutPanel.ResumeLayout();
                }
            }

            return(provider);
        }
Esempio n. 28
0
        private void InitializeComponent()
        {
            SuspendLayout();
            _overarchingPanel = new TableLayoutPanel();
            _overarchingPanel.SuspendLayout();

            _overarchingPanel.Anchor      = UIConst.AutoSize;
            _overarchingPanel.AutoSize    = true;
            _overarchingPanel.Dock        = DockStyle.Fill;
            _overarchingPanel.Location    = new System.Drawing.Point(0, 0);
            _overarchingPanel.Margin      = new Padding(0);
            _overarchingPanel.Padding     = new Padding(0);
            _overarchingPanel.Name        = "_overarchingPanel";
            _overarchingPanel.Size        = new System.Drawing.Size(100, 20);
            _overarchingPanel.ColumnCount = 1;
            _overarchingPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
            _overarchingPanel.RowCount = 2;
            _overarchingPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 32F));
            _overarchingPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));

            int rowIndex = 0;

            _overarchingPanel.Controls.Add(BuildButtonPanel(), 0, rowIndex++);
            _overarchingPanel.Controls.Add(BuildPropertyCtrl(), 0, rowIndex++);

            Controls.Add(_overarchingPanel);
            this.Size = new System.Drawing.Size(100, 40);

            _overarchingPanel.ResumeLayout(false);
            ResumeLayout(false);
        }
Esempio n. 29
0
        private void InitUi()
        {
            SuspendLayout();

            var layout = new TableLayoutPanel {
                Dock = DockStyle.Fill
            };

            layout.SuspendLayout();
            layout.Controls.Add(_lblCaption, 0, 0);
            layout.Controls.Add(_monitorMap, 0, 3);
            layout.Controls.Add(new FieldLabelPanel(_cmbPlacement, "Region")
            {
                Dock = DockStyle.Fill
            }, 0, 1);
            layout.Controls.Add(new FieldLabelPanel(_cmbMonitor, "Monitor")
            {
                Dock = DockStyle.Fill
            }, 0, 2);

            _cmbPlacement.SelectedIndexChanged += CmbPlacement_SelectionChanged;
            _cmbMonitor.SelectedIndexChanged   += CmbMonitorOnSelectedIndexChanged;

            layout.ResumeLayout();

            Controls.Add(layout);

            ResumeLayout();
        }
 private void InitializeComponent()
 {
     tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
     progressBar      = new System.Windows.Forms.ProgressBar();
     label            = new System.Windows.Forms.Label();
     cancelBtn        = new System.Windows.Forms.Button();
     tableLayoutPanel.SuspendLayout();
     SuspendLayout();
     tableLayoutPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Inset;
     tableLayoutPanel.ColumnCount     = 1;
     tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100f));
     tableLayoutPanel.Controls.Add(label, 0, 0);
     tableLayoutPanel.Controls.Add(progressBar, 0, 1);
     tableLayoutPanel.Controls.Add(cancelBtn, 0, 2);
     tableLayoutPanel.Dock     = System.Windows.Forms.DockStyle.Fill;
     tableLayoutPanel.Location = new System.Drawing.Point(0, 0);
     tableLayoutPanel.Name     = "tableLayoutPanel";
     tableLayoutPanel.RowCount = 3;
     tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30f));
     tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100f));
     tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30f));
     tableLayoutPanel.Size             = new System.Drawing.Size(394, 97);
     tableLayoutPanel.TabIndex         = 0;
     progressBar.Dock                  = System.Windows.Forms.DockStyle.Fill;
     progressBar.Location              = new System.Drawing.Point(5, 37);
     progressBar.MarqueeAnimationSpeed = 50;
     progressBar.Name                  = "progressBar";
     progressBar.Size                  = new System.Drawing.Size(384, 23);
     progressBar.Style                 = System.Windows.Forms.ProgressBarStyle.Marquee;
     progressBar.TabIndex              = 2;
     label.Dock         = System.Windows.Forms.DockStyle.Fill;
     label.Location     = new System.Drawing.Point(5, 2);
     label.Name         = "label";
     label.Size         = new System.Drawing.Size(384, 30);
     label.TabIndex     = 3;
     label.Text         = "Awaiting connection...";
     label.TextAlign    = System.Drawing.ContentAlignment.MiddleLeft;
     cancelBtn.Dock     = System.Windows.Forms.DockStyle.Right;
     cancelBtn.Location = new System.Drawing.Point(264, 68);
     cancelBtn.Name     = "cancelBtn";
     cancelBtn.Size     = new System.Drawing.Size(125, 24);
     cancelBtn.TabIndex = 4;
     cancelBtn.Text     = "Cancel Upload";
     cancelBtn.UseVisualStyleBackColor = true;
     base.AutoScaleDimensions          = new System.Drawing.SizeF(6f, 13f);
     base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     AutoSize           = true;
     base.ClientSize    = new System.Drawing.Size(394, 97);
     base.Controls.Add(tableLayoutPanel);
     base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     base.MaximizeBox     = false;
     MaximumSize          = new System.Drawing.Size(400, 125);
     MinimumSize          = new System.Drawing.Size(400, 125);
     base.Name            = "FileUploading";
     Text              = "Uploading (?) item (?.? MB)";
     base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FileUploading_FormClosing);
     base.Load        += new System.EventHandler(FileUploading_Load);
     tableLayoutPanel.ResumeLayout(false);
     ResumeLayout(false);
 }
Esempio n. 31
0
	public MainForm ()
	{
		tableLayoutPanel1 = new TableLayoutPanel ();
		tableLayoutPanel2 = new TableLayoutPanel ();
		label1 = new Label ();
		label2 = new Label ();
		textBox1 = new TextBox ();
		textBox2 = new TextBox ();
		label3 = new Label ();
		tableLayoutPanel1.SuspendLayout ();
		tableLayoutPanel2.SuspendLayout ();
		SuspendLayout ();
		// 
		// tableLayoutPanel1
		// 
		tableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
		tableLayoutPanel1.ColumnCount = 2;
		tableLayoutPanel1.ColumnStyles.Add (new ColumnStyle ());
		tableLayoutPanel1.ColumnStyles.Add (new ColumnStyle ());
		tableLayoutPanel1.Controls.Add (tableLayoutPanel2, 1, 0);
		tableLayoutPanel1.Controls.Add (label3, 0, 0);
		tableLayoutPanel1.Location = new Point (20, 30);
		tableLayoutPanel1.RowCount = 2;
		tableLayoutPanel1.RowStyles.Add (new RowStyle (SizeType.Percent, 50F));
		tableLayoutPanel1.RowStyles.Add (new RowStyle (SizeType.Percent, 50F));
		tableLayoutPanel1.Size = new Size (250, 145);
		tableLayoutPanel1.TabIndex = 0;
		// 
		// tableLayoutPanel2
		// 
		tableLayoutPanel2.AutoSize = true;
		tableLayoutPanel2.ColumnCount = 2;
		tableLayoutPanel2.ColumnStyles.Add (new ColumnStyle ());
		tableLayoutPanel2.ColumnStyles.Add (new ColumnStyle (SizeType.Percent, 50F));
		tableLayoutPanel2.Controls.Add (label1, 0, 0);
		tableLayoutPanel2.Controls.Add (label2, 0, 1);
		tableLayoutPanel2.Controls.Add (textBox1, 1, 0);
		tableLayoutPanel2.Controls.Add (textBox2, 1, 1);
		tableLayoutPanel2.Location = new Point (68, 3);
		tableLayoutPanel2.RowCount = 2;
		tableLayoutPanel2.RowStyles.Add (new RowStyle (SizeType.Percent, 50F));
		tableLayoutPanel2.RowStyles.Add (new RowStyle (SizeType.Percent, 50F));
		tableLayoutPanel2.Size = new Size (131, 39);
		tableLayoutPanel2.TabIndex = 0;
		// 
		// label1
		// 
		label1.AutoSize = true;
		label1.Location = new Point (3, 0);
		label1.Size = new Size (19, 13);
		label1.TabIndex = 0;
		label1.Text = "en";
		// 
		// label2
		// 
		label2.AutoSize = true;
		label2.Location = new Point (3, 19);
		label2.Size = new Size (18, 13);
		label2.TabIndex = 1;
		label2.Text = "es";
		// 
		// textBox1
		// 
		textBox1.Dock = DockStyle.Fill;
		textBox1.Location = new Point (28, 3);
		textBox1.Size = new Size (100, 20);
		textBox1.TabIndex = 2;
		// 
		// textBox2
		// 
		textBox2.Dock = DockStyle.Fill;
		textBox2.Location = new Point (28, 22);
		textBox2.Size = new Size (100, 20);
		textBox2.TabIndex = 3;
		// 
		// label3
		// 
		label3.AutoSize = true;
		label3.Location = new Point (3, 0);
		label3.Size = new Size (59, 13);
		label3.TabIndex = 1;
		label3.Text = "Head word";
		// 
		// MainForm
		// 
		AutoScaleDimensions = new SizeF (6F, 13F);
		AutoScaleMode = AutoScaleMode.Font;
		ClientSize = new Size (292, 200);
		Controls.Add (tableLayoutPanel1);
		tableLayoutPanel1.ResumeLayout (false);
		tableLayoutPanel1.PerformLayout ();
		tableLayoutPanel2.ResumeLayout (false);
		tableLayoutPanel2.PerformLayout ();
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #354672";
		ResumeLayout (false);
		Load += new EventHandler (MainForm_Load);
	}
Esempio n. 32
0
    private void CreateOutputPage()
    {
        m_OutputPage = new Page("Output");
        m_OutputPage.SuspendLayout();

        m_OutputControl = new OutputControl() {
            Id = "Output" };
        m_OutputPage.AddControl( m_OutputControl, true );

        m_PictureBox = new PictureBox();
        ((System.ComponentModel.ISupportInitialize)(m_PictureBox)).BeginInit();
        m_PictureBox.Location = new System.Drawing.Point(0, 0);
        m_PictureBox.Margin = new System.Windows.Forms.Padding(0, 6, 0, 0);
        m_PictureBox.Size = new System.Drawing.Size(32, 32);
        m_PictureBox.TabStop = false;
        //m_PictureBox.Image = NoConsoleLib.Properties.Resources.circle_green;
        ((System.ComponentModel.ISupportInitialize)(m_PictureBox)).EndInit();

        m_InfoTextBox = new InfoTextbox();
        m_InfoTextBox.SetHeightRows( 2 );

        m_KillButton = new Button();
        m_KillButton.Image = NoConsoleLib.Properties.Resources.Skull;
        m_KillButton.Location = new System.Drawing.Point(0, 0);
        m_KillButton.Size = new System.Drawing.Size(26, 26);
        Lib.ToolTip.SetToolTip(m_KillButton, "Kill");
        m_KillButton.UseVisualStyleBackColor = true;
        m_KillButton.Click += new System.EventHandler(this.OnKillClick);

        TableLayoutPanel tableLayoutPanel1 = new TableLayoutPanel();
        tableLayoutPanel1.SuspendLayout();
        tableLayoutPanel1.ColumnCount = 3;
        tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F + 12f));
        tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
        tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F));
        tableLayoutPanel1.RowCount = 1;
        tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
        tableLayoutPanel1.Controls.Add(m_PictureBox,  0, 0);
        tableLayoutPanel1.Controls.Add(m_InfoTextBox, 1, 0);
        tableLayoutPanel1.Controls.Add(m_KillButton, 2, 0);
        tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
        tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
        tableLayoutPanel1.Size = new System.Drawing.Size(300, 32 + 6);
        m_OutputPage.AddControl(tableLayoutPanel1);
        tableLayoutPanel1.ResumeLayout(false);

        m_OutputPage.ResumeLayout();
    }