public IndexRowControls CreateNewIndexRow() { Program.SuspendDrawing(this, shown); IndexRowControls irc = new IndexRowControls(); int y = _allRows.Count; pan_Main.RowCount = y + 2; pan_Main.RowStyles.Insert(y, new RowStyle(SizeType.Absolute, ROWHEIGHT)); // Create the controls irc.hidden = new CheckBox(); pan_Main.Controls.Add(irc.hidden, 0, y); irc.hidden.Dock = DockStyle.Fill; irc.hidden.CheckAlign = ContentAlignment.MiddleCenter; irc.index = new NumericUpDown(); pan_Main.Controls.Add(irc.index, 1, y); irc.posx = new NumericUpDown(); pan_Main.Controls.Add(irc.posx, 2, y); irc.posy = new NumericUpDown(); pan_Main.Controls.Add(irc.posy, 3, y); irc.index.Dock = irc.posx.Dock = irc.posy.Dock = DockStyle.Fill; irc.index.Minimum = irc.posx.Minimum = irc.posy.Minimum = 0; irc.index.Maximum = irc.posx.Maximum = irc.posy.Maximum = int.MaxValue; irc.delete = new Button(); pan_Main.Controls.Add(irc.delete, 8, y); irc.delete.Dock = DockStyle.Fill; irc.delete.UseVisualStyleBackColor = true; irc.delete.ForeColor = SystemColors.ControlText; irc.delete.Text = "DELETE"; irc.delete.Click += DeleteIndexRowEvent; pan_Main.Controls.Add(irc.fll = new FlowLayoutPanel(), 4, y); irc.fll = CreateFlowLayoutPanelWithComponents(irc.fll, out irc.cll, out irc.ll); pan_Main.Controls.Add(irc.fl = new FlowLayoutPanel(), 5, y); irc.fl = CreateFlowLayoutPanelWithComponents(irc.fl, out irc.cl, out irc.l); pan_Main.Controls.Add(irc.fh = new FlowLayoutPanel(), 6, y); irc.fh = CreateFlowLayoutPanelWithComponents(irc.fh, out irc.ch, out irc.h); pan_Main.Controls.Add(irc.fhh = new FlowLayoutPanel(), 7, y); irc.fhh = CreateFlowLayoutPanelWithComponents(irc.fhh, out irc.chh, out irc.hh); _allRows.Add(irc); Program.ResumeDrawing(this, shown); return(irc); }
public void AcceptFormValues() { Program.SuspendDrawing(Program.windowStatus, true); foreach (graphicPrototype.prototypeIndex pi in prototype.indexes) { pi.Dispose(); } prototype.indexes = new graphicPrototype.prototypeIndex[indexDialogForm.allRows.Count]; for (int i = 0, j = prototype.indexes.Length; i < j; i++) { IndexRowControls irc = indexDialogForm.allRows[i]; prototype.indexes[i] = new graphicPrototype.prototypeIndex(irc.hidden.Checked, (int)irc.posx.Value, (int)irc.posy.Value, (irc.cll.Checked ? (float?)irc.ll.Value : null), (irc.cl.Checked ? (float?)irc.l.Value : null), (irc.ch.Checked ? (float?)irc.h.Value : null), (irc.chh.Checked ? (float?)irc.hh.Value : null), (int)irc.index.Value); prototype.indexes[i].CreateControls(parent); } prototype.UpdateIdxSettingReference(); Program.ResumeDrawing(Program.windowStatus, true); }