public void Init(Parameters parameters1, float paramNameWidth, int totalWidth) { Parameters = parameters1; int nrows = Parameters.GroupCount; parameterGroupPanels = new ParameterGroupPanel[nrows]; tableLayoutPanel = new TableLayoutPanel(); SuspendLayout(); tableLayoutPanel.ColumnCount = 1; tableLayoutPanel.ColumnStyles.Clear(); tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); tableLayoutPanel.Dock = DockStyle.None; tableLayoutPanel.Location = new Point(0, 0); tableLayoutPanel.Name = "tableLayoutPanel"; tableLayoutPanel.RowCount = nrows + 1; tableLayoutPanel.RowStyles.Clear(); float totalHeight = 0; for (int i = 0; i < nrows; i++){ float h = parameters1.GetGroup(i).Height + 26; tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize, h)); totalHeight += h + 6; } tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); tableLayoutPanel.Size = new Size(totalWidth, (int) totalHeight); tableLayoutPanel.TabIndex = 0; for (int i = 0; i < nrows; i++){ AddParameterGroup(parameters1.GetGroup(i), i, paramNameWidth, totalWidth); } AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; Controls.Clear(); Controls.Add(tableLayoutPanel); Name = "ParameterPanel"; Size = new Size(totalWidth, (int) totalHeight); ResumeLayout(true); }
public void SetParameters() { Parameters p1 = Parameters; for (int i = 0; i < p1.GroupCount; i++) { p1.GetGroup(i).SetParametersFromConrtol(); } }
public void Init(Parameters parameters1, float paramNameWidth, int totalWidth) { Parameters = parameters1; int nrows = Parameters.GroupCount; parameterGroupPanels = new ParameterGroupPanel[nrows]; tableLayoutPanel = new TableLayoutPanel(); SuspendLayout(); tableLayoutPanel.ColumnCount = 1; tableLayoutPanel.ColumnStyles.Clear(); tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); tableLayoutPanel.Dock = DockStyle.None; tableLayoutPanel.Location = new Point(0, 0); tableLayoutPanel.Name = "tableLayoutPanel"; tableLayoutPanel.RowCount = nrows + 1; tableLayoutPanel.RowStyles.Clear(); float totalHeight = 0; for (int i = 0; i < nrows; i++) { float h = parameters1.GetGroup(i).Height + 26; tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize, h)); totalHeight += h + 6; } tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); tableLayoutPanel.Size = new Size(totalWidth, (int)totalHeight); tableLayoutPanel.TabIndex = 0; for (int i = 0; i < nrows; i++) { AddParameterGroup(parameters1.GetGroup(i), i, paramNameWidth, totalWidth); } AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; Controls.Clear(); Controls.Add(tableLayoutPanel); Name = "ParameterPanel"; Size = new Size(totalWidth, (int)totalHeight); ResumeLayout(true); }