From 3edf65524f332bfbfb2d0a6d478b46cb1e5da66d Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Wed, 2 Dec 2026 09:17:05 -0500 Subject: [PATCH] feat(nest-info): redesign Edit Nest and share plate settings with Edit Plate The Info tab showed the thickness name twice: the thickness box's list label ("1/4" - 0.25") and the separate Thickness name box. The box now shows the bare decimal with a Name box beside it; the list still names each entry, and a picked entry keeps its name when the box switches to the number. Fields are grouped into Nest and Material sections and the dates are one gray line. The Defaults tab and Edit Plate edited the same size, spacing and quadrant with duplicated controls, and the Defaults tab always stepped spacing by 0.25 even in millimeters. Both now host one PlateSettingsEditor; the forms stay separate because each has its own extras (quantity and outline, or use for new nests). Co-Authored-By: Claude Opus 5.5 --- OpenNest.Data/StandardThicknesses.cs | 3 +- .../Forms/EditNestInfoFormTests.cs | 6 +- .../Forms/EditPlateFormOutlineTests.cs | 4 +- .../Controls/PlateSettingsEditor.Designer.cs | 331 +++++ OpenNest/Controls/PlateSettingsEditor.cs | 121 ++ OpenNest/Controls/ThicknessComboBox.cs | 21 +- OpenNest/Forms/EditNestInfoForm.Designer.cs | 1106 ++++++----------- OpenNest/Forms/EditNestInfoForm.cs | 71 +- OpenNest/Forms/EditPlateForm.Designer.cs | 466 ++----- OpenNest/Forms/EditPlateForm.cs | 58 +- docs/nest-storage.md | 9 +- 11 files changed, 1032 insertions(+), 1164 deletions(-) create mode 100644 OpenNest/Controls/PlateSettingsEditor.Designer.cs create mode 100644 OpenNest/Controls/PlateSettingsEditor.cs diff --git a/OpenNest.Data/StandardThicknesses.cs b/OpenNest.Data/StandardThicknesses.cs index 3b58d59b..e2aa171d 100644 --- a/OpenNest.Data/StandardThicknesses.cs +++ b/OpenNest.Data/StandardThicknesses.cs @@ -117,7 +117,8 @@ public static partial class StandardThicknesses && double.IsFinite(value) && value >= 0; } - private static string FormatNumber(double value, Units units) => + /// The bare number for , without a listed name. + public static string FormatNumber(double value, Units units) => value.ToString(units == Units.Millimeters ? "0.###" : "0.####", CultureInfo.CurrentCulture); /// Reads "3/16", "1-1/4" or "1 1/4\"" as inches; null when not a fraction. diff --git a/OpenNest.WinForms.Tests/Forms/EditNestInfoFormTests.cs b/OpenNest.WinForms.Tests/Forms/EditNestInfoFormTests.cs index 32b3ab50..1435a173 100644 --- a/OpenNest.WinForms.Tests/Forms/EditNestInfoFormTests.cs +++ b/OpenNest.WinForms.Tests/Forms/EditNestInfoFormTests.cs @@ -60,7 +60,7 @@ public class EditNestInfoFormTests var thickness = (OpenNest.Controls.ThicknessComboBox)form.Controls.Find("thicknessBox", true).Single(); var apply = form.Controls.Find("applyButton", true).Single(); - Assert.Equal("1/4\" - 0.25", thickness.Text); + Assert.Equal("0.25", thickness.Text); thickness.SelectedItem = "16 ga - 0.0598"; Assert.Equal(0.0598, form.Thickness); Assert.True(apply.Enabled); @@ -108,6 +108,10 @@ public class EditNestInfoFormTests thickness.SelectedItem = "16 ga - 0.0598"; Assert.Equal("16 ga", form.ThicknessName); + // The box then shows the pick as its bare number, beside the name, which stays. + thickness.Text = "0.0598"; + Assert.Equal("16 ga", form.ThicknessName); + // A typed name stays through a material change, not through a new thickness. thickness.Text = "0.135"; form.ThicknessName = "Ten"; diff --git a/OpenNest.WinForms.Tests/Forms/EditPlateFormOutlineTests.cs b/OpenNest.WinForms.Tests/Forms/EditPlateFormOutlineTests.cs index 558c3b64..d3ee7f28 100644 --- a/OpenNest.WinForms.Tests/Forms/EditPlateFormOutlineTests.cs +++ b/OpenNest.WinForms.Tests/Forms/EditPlateFormOutlineTests.cs @@ -18,7 +18,7 @@ public class EditPlateFormOutlineTests { var plate = new Plate(60, 120); using var form = new EditPlateForm(plate); - var size = (TextBox)form.Controls.Find("textBoxSize", true)[0]; + var size = (TextBox)form.Controls.Find("sizeBox", true)[0]; var clear = (Button)form.Controls.Find("buttonClearOutline", true)[0]; Assert.False(size.ReadOnly); Assert.False(clear.Enabled); @@ -42,7 +42,7 @@ public class EditPlateFormOutlineTests { var plate = new Plate { Outline = Ell(), Quadrant = 2 }; using var form = new EditPlateForm(plate); - var size = (TextBox)form.Controls.Find("textBoxSize", true)[0]; + var size = (TextBox)form.Controls.Find("sizeBox", true)[0]; Assert.True(size.ReadOnly); form.Outline = null; // what Clear does diff --git a/OpenNest/Controls/PlateSettingsEditor.Designer.cs b/OpenNest/Controls/PlateSettingsEditor.Designer.cs new file mode 100644 index 00000000..0853f425 --- /dev/null +++ b/OpenNest/Controls/PlateSettingsEditor.Designer.cs @@ -0,0 +1,331 @@ +namespace OpenNest.Controls +{ + partial class PlateSettingsEditor + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.sizeTable = new System.Windows.Forms.TableLayoutPanel(); + this.labelSize = new System.Windows.Forms.Label(); + this.sizeBox = new System.Windows.Forms.TextBox(); + this.labelPartSpacing = new System.Windows.Forms.Label(); + this.partSpacingBox = new OpenNest.Controls.NumericUpDown(); + this.edgeSpacingGroup = new System.Windows.Forms.GroupBox(); + this.edgeSpacingTable = new System.Windows.Forms.TableLayoutPanel(); + this.labelEdgeSpacingLeft = new System.Windows.Forms.Label(); + this.labelEdgeSpacingTop = new System.Windows.Forms.Label(); + this.labelEdgeSpacingRight = new System.Windows.Forms.Label(); + this.labelEdgeSpacingBottom = new System.Windows.Forms.Label(); + this.leftSpacingBox = new OpenNest.Controls.NumericUpDown(); + this.topSpacingBox = new OpenNest.Controls.NumericUpDown(); + this.rightSpacingBox = new OpenNest.Controls.NumericUpDown(); + this.bottomSpacingBox = new OpenNest.Controls.NumericUpDown(); + this.quadrantGroup = new System.Windows.Forms.GroupBox(); + this.quadrantSelect = new OpenNest.Controls.QuadrantSelect(); + this.sizeTable.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.partSpacingBox)).BeginInit(); + this.edgeSpacingGroup.SuspendLayout(); + this.edgeSpacingTable.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.leftSpacingBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.topSpacingBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.rightSpacingBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bottomSpacingBox)).BeginInit(); + this.quadrantGroup.SuspendLayout(); + this.SuspendLayout(); + // + // sizeTable + // + this.sizeTable.ColumnCount = 2; + this.sizeTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 104F)); + this.sizeTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.sizeTable.Controls.Add(this.labelSize, 0, 0); + this.sizeTable.Controls.Add(this.sizeBox, 1, 0); + this.sizeTable.Controls.Add(this.labelPartSpacing, 0, 1); + this.sizeTable.Controls.Add(this.partSpacingBox, 1, 1); + this.sizeTable.Location = new System.Drawing.Point(0, 0); + this.sizeTable.Name = "sizeTable"; + this.sizeTable.RowCount = 2; + this.sizeTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.sizeTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.sizeTable.Size = new System.Drawing.Size(264, 64); + this.sizeTable.TabIndex = 0; + // + // labelSize + // + this.labelSize.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelSize.AutoSize = true; + this.labelSize.Name = "labelSize"; + this.labelSize.TabIndex = 0; + this.labelSize.Text = "Size :"; + // + // sizeBox + // + this.sizeBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.sizeBox.Name = "sizeBox"; + this.sizeBox.Size = new System.Drawing.Size(160, 22); + this.sizeBox.TabIndex = 1; + this.sizeBox.TextChanged += new System.EventHandler(this.sizeBox_TextChanged); + // + // labelPartSpacing + // + this.labelPartSpacing.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelPartSpacing.AutoSize = true; + this.labelPartSpacing.Name = "labelPartSpacing"; + this.labelPartSpacing.TabIndex = 2; + this.labelPartSpacing.Text = "Part Spacing :"; + // + // partSpacingBox + // + this.partSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.partSpacingBox.DecimalPlaces = 4; + this.partSpacingBox.Increment = new decimal(new int[] { + 25, + 0, + 0, + 131072}); + this.partSpacingBox.Maximum = new decimal(new int[] { + 999999, + 0, + 0, + 0}); + this.partSpacingBox.Name = "partSpacingBox"; + this.partSpacingBox.Size = new System.Drawing.Size(160, 22); + this.partSpacingBox.Suffix = ""; + this.partSpacingBox.TabIndex = 3; + this.partSpacingBox.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); + // + // edgeSpacingGroup + // + this.edgeSpacingGroup.Controls.Add(this.edgeSpacingTable); + this.edgeSpacingGroup.Location = new System.Drawing.Point(0, 70); + this.edgeSpacingGroup.Name = "edgeSpacingGroup"; + this.edgeSpacingGroup.Padding = new System.Windows.Forms.Padding(6, 4, 6, 6); + this.edgeSpacingGroup.Size = new System.Drawing.Size(270, 166); + this.edgeSpacingGroup.TabIndex = 1; + this.edgeSpacingGroup.TabStop = false; + this.edgeSpacingGroup.Text = "Edge Spacing"; + // + // edgeSpacingTable + // + this.edgeSpacingTable.ColumnCount = 2; + this.edgeSpacingTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.edgeSpacingTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.edgeSpacingTable.Controls.Add(this.labelEdgeSpacingLeft, 0, 0); + this.edgeSpacingTable.Controls.Add(this.leftSpacingBox, 1, 0); + this.edgeSpacingTable.Controls.Add(this.labelEdgeSpacingTop, 0, 1); + this.edgeSpacingTable.Controls.Add(this.topSpacingBox, 1, 1); + this.edgeSpacingTable.Controls.Add(this.labelEdgeSpacingRight, 0, 2); + this.edgeSpacingTable.Controls.Add(this.rightSpacingBox, 1, 2); + this.edgeSpacingTable.Controls.Add(this.labelEdgeSpacingBottom, 0, 3); + this.edgeSpacingTable.Controls.Add(this.bottomSpacingBox, 1, 3); + this.edgeSpacingTable.Dock = System.Windows.Forms.DockStyle.Fill; + this.edgeSpacingTable.Name = "edgeSpacingTable"; + this.edgeSpacingTable.RowCount = 4; + this.edgeSpacingTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.edgeSpacingTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.edgeSpacingTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.edgeSpacingTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.edgeSpacingTable.TabIndex = 0; + // + // labelEdgeSpacingLeft + // + this.labelEdgeSpacingLeft.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelEdgeSpacingLeft.AutoSize = true; + this.labelEdgeSpacingLeft.Name = "labelEdgeSpacingLeft"; + this.labelEdgeSpacingLeft.TabIndex = 0; + this.labelEdgeSpacingLeft.Text = "Left :"; + // + // labelEdgeSpacingTop + // + this.labelEdgeSpacingTop.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelEdgeSpacingTop.AutoSize = true; + this.labelEdgeSpacingTop.Name = "labelEdgeSpacingTop"; + this.labelEdgeSpacingTop.TabIndex = 2; + this.labelEdgeSpacingTop.Text = "Top :"; + // + // labelEdgeSpacingRight + // + this.labelEdgeSpacingRight.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelEdgeSpacingRight.AutoSize = true; + this.labelEdgeSpacingRight.Name = "labelEdgeSpacingRight"; + this.labelEdgeSpacingRight.TabIndex = 4; + this.labelEdgeSpacingRight.Text = "Right :"; + // + // labelEdgeSpacingBottom + // + this.labelEdgeSpacingBottom.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelEdgeSpacingBottom.AutoSize = true; + this.labelEdgeSpacingBottom.Name = "labelEdgeSpacingBottom"; + this.labelEdgeSpacingBottom.TabIndex = 6; + this.labelEdgeSpacingBottom.Text = "Bottom :"; + // + // leftSpacingBox + // + this.leftSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.leftSpacingBox.DecimalPlaces = 4; + this.leftSpacingBox.Increment = new decimal(new int[] { + 25, + 0, + 0, + 131072}); + this.leftSpacingBox.Maximum = new decimal(new int[] { + 999999, + 0, + 0, + 0}); + this.leftSpacingBox.Name = "leftSpacingBox"; + this.leftSpacingBox.Size = new System.Drawing.Size(160, 22); + this.leftSpacingBox.Suffix = ""; + this.leftSpacingBox.TabIndex = 1; + this.leftSpacingBox.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); + // + // topSpacingBox + // + this.topSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.topSpacingBox.DecimalPlaces = 4; + this.topSpacingBox.Increment = new decimal(new int[] { + 25, + 0, + 0, + 131072}); + this.topSpacingBox.Maximum = new decimal(new int[] { + 999999, + 0, + 0, + 0}); + this.topSpacingBox.Name = "topSpacingBox"; + this.topSpacingBox.Size = new System.Drawing.Size(160, 22); + this.topSpacingBox.Suffix = ""; + this.topSpacingBox.TabIndex = 3; + this.topSpacingBox.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); + // + // rightSpacingBox + // + this.rightSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.rightSpacingBox.DecimalPlaces = 4; + this.rightSpacingBox.Increment = new decimal(new int[] { + 25, + 0, + 0, + 131072}); + this.rightSpacingBox.Maximum = new decimal(new int[] { + 999999, + 0, + 0, + 0}); + this.rightSpacingBox.Name = "rightSpacingBox"; + this.rightSpacingBox.Size = new System.Drawing.Size(160, 22); + this.rightSpacingBox.Suffix = ""; + this.rightSpacingBox.TabIndex = 5; + this.rightSpacingBox.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); + // + // bottomSpacingBox + // + this.bottomSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.bottomSpacingBox.DecimalPlaces = 4; + this.bottomSpacingBox.Increment = new decimal(new int[] { + 25, + 0, + 0, + 131072}); + this.bottomSpacingBox.Maximum = new decimal(new int[] { + 999999, + 0, + 0, + 0}); + this.bottomSpacingBox.Name = "bottomSpacingBox"; + this.bottomSpacingBox.Size = new System.Drawing.Size(160, 22); + this.bottomSpacingBox.Suffix = ""; + this.bottomSpacingBox.TabIndex = 7; + this.bottomSpacingBox.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); + // + // quadrantGroup + // + this.quadrantGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.quadrantGroup.Controls.Add(this.quadrantSelect); + this.quadrantGroup.Location = new System.Drawing.Point(282, 0); + this.quadrantGroup.Name = "quadrantGroup"; + this.quadrantGroup.Padding = new System.Windows.Forms.Padding(8, 6, 8, 8); + this.quadrantGroup.Size = new System.Drawing.Size(268, 236); + this.quadrantGroup.TabIndex = 2; + this.quadrantGroup.TabStop = false; + this.quadrantGroup.Text = "Quadrant"; + // + // quadrantSelect + // + this.quadrantSelect.BackColor = System.Drawing.Color.White; + this.quadrantSelect.Dock = System.Windows.Forms.DockStyle.Fill; + this.quadrantSelect.Name = "quadrantSelect"; + this.quadrantSelect.Quadrant = 1; + this.quadrantSelect.TabIndex = 0; + this.quadrantSelect.Text = "quadrantSelect"; + // + // PlateSettingsEditor + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.Controls.Add(this.quadrantGroup); + this.Controls.Add(this.edgeSpacingGroup); + this.Controls.Add(this.sizeTable); + this.Name = "PlateSettingsEditor"; + this.Size = new System.Drawing.Size(550, 236); + this.sizeTable.ResumeLayout(false); + this.sizeTable.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.partSpacingBox)).EndInit(); + this.edgeSpacingGroup.ResumeLayout(false); + this.edgeSpacingTable.ResumeLayout(false); + this.edgeSpacingTable.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.leftSpacingBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.topSpacingBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.rightSpacingBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bottomSpacingBox)).EndInit(); + this.quadrantGroup.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel sizeTable; + private System.Windows.Forms.Label labelSize; + private System.Windows.Forms.TextBox sizeBox; + private System.Windows.Forms.Label labelPartSpacing; + private OpenNest.Controls.NumericUpDown partSpacingBox; + private System.Windows.Forms.GroupBox edgeSpacingGroup; + private System.Windows.Forms.TableLayoutPanel edgeSpacingTable; + private System.Windows.Forms.Label labelEdgeSpacingLeft; + private System.Windows.Forms.Label labelEdgeSpacingTop; + private System.Windows.Forms.Label labelEdgeSpacingRight; + private System.Windows.Forms.Label labelEdgeSpacingBottom; + private OpenNest.Controls.NumericUpDown leftSpacingBox; + private OpenNest.Controls.NumericUpDown topSpacingBox; + private OpenNest.Controls.NumericUpDown rightSpacingBox; + private OpenNest.Controls.NumericUpDown bottomSpacingBox; + private System.Windows.Forms.GroupBox quadrantGroup; + private OpenNest.Controls.QuadrantSelect quadrantSelect; + } +} diff --git a/OpenNest/Controls/PlateSettingsEditor.cs b/OpenNest/Controls/PlateSettingsEditor.cs new file mode 100644 index 00000000..63a7d767 --- /dev/null +++ b/OpenNest/Controls/PlateSettingsEditor.cs @@ -0,0 +1,121 @@ +using System; +using System.ComponentModel; +using System.Windows.Forms; +using OpenNest.Desktop; + +namespace OpenNest.Controls +{ + /// + /// The settings a plate is laid out by: its size, part spacing, edge spacing and quadrant. + /// Edit Plate edits one plate's; Edit Nest's Defaults tab edits the ones new plates start from. + /// + public partial class PlateSettingsEditor : UserControl + { + private Units units = Units.Inches; + + public PlateSettingsEditor() + { + InitializeComponent(); + UpdateUnits(); + } + + /// The size box's text changed. + public event EventHandler SizeTextChanged; + + /// A spacing value changed. + public event EventHandler SpacingChanged; + + /// The units the spacing boxes show and step in. + [DefaultValue(Units.Inches)] + public Units Units + { + get { return units; } + set + { + units = value; + UpdateUnits(); + } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string SizeText + { + get { return sizeBox.Text; } + set { sizeBox.Text = value; } + } + + /// True while something else, such as a sheet outline, sets the size. + [DefaultValue(false)] + public bool SizeReadOnly + { + get { return sizeBox.ReadOnly; } + set { sizeBox.ReadOnly = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public double PartSpacing + { + get { return (double)partSpacingBox.Value; } + set { partSpacingBox.Value = (decimal)value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public double LeftSpacing + { + get { return (double)leftSpacingBox.Value; } + set { leftSpacingBox.Value = (decimal)value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public double TopSpacing + { + get { return (double)topSpacingBox.Value; } + set { topSpacingBox.Value = (decimal)value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public double RightSpacing + { + get { return (double)rightSpacingBox.Value; } + set { rightSpacingBox.Value = (decimal)value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public double BottomSpacing + { + get { return (double)bottomSpacingBox.Value; } + set { bottomSpacingBox.Value = (decimal)value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int Quadrant + { + get { return quadrantSelect.Quadrant; } + set { quadrantSelect.Quadrant = value; } + } + + private void UpdateUnits() + { + var suffix = " " + UnitsHelper.GetShortString(units); + var increment = (decimal)PlateEditValues.SpacingIncrement(units); + + foreach (var box in new[] { partSpacingBox, leftSpacingBox, topSpacingBox, rightSpacingBox, bottomSpacingBox }) + { + box.Suffix = suffix; + box.Increment = increment; + box.Invalidate(true); + } + } + + private void sizeBox_TextChanged(object sender, EventArgs e) => SizeTextChanged?.Invoke(this, EventArgs.Empty); + + private void spacing_ValueChanged(object sender, EventArgs e) => SpacingChanged?.Invoke(this, EventArgs.Empty); + } +} diff --git a/OpenNest/Controls/ThicknessComboBox.cs b/OpenNest/Controls/ThicknessComboBox.cs index c996ca83..3cac98a8 100644 --- a/OpenNest/Controls/ThicknessComboBox.cs +++ b/OpenNest/Controls/ThicknessComboBox.cs @@ -48,12 +48,19 @@ namespace OpenNest.Controls public bool IsValid => TryGetValue(out _); /// The thickness in ; 0 when blank or unreadable. + /// + /// False shows a thickness as its bare number ("0.25") once picked or left, for a box + /// with its own name field beside it; the list still names each entry. + /// + [DefaultValue(true)] + public bool ShowNames { get; set; } = true; + [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public double Value { get { return TryGetValue(out var value) ? value : 0; } - set { Text = StandardThicknesses.Format(value, units); } + set { Text = ShowNames ? StandardThicknesses.Format(value, units) : StandardThicknesses.FormatNumber(value, units); } } public bool TryGetValue(out double value) => StandardThicknesses.TryParse(Text, units, out value); @@ -85,6 +92,18 @@ namespace OpenNest.Controls base.OnLeave(e); } + protected override void OnDropDownClosed(EventArgs e) + { + base.OnDropDownClosed(e); + // The edit text takes the picked label after this event, so show the number after it. + if (!ShowNames && IsHandleCreated) + BeginInvoke(() => + { + if (!IsDisposed && TryGetValue(out var value) && Text.Trim().Length > 0) + Value = value; + }); + } + private void FillItems() { var text = Text; diff --git a/OpenNest/Forms/EditNestInfoForm.Designer.cs b/OpenNest/Forms/EditNestInfoForm.Designer.cs index 23dd11bf..c54525c9 100644 --- a/OpenNest/Forms/EditNestInfoForm.Designer.cs +++ b/OpenNest/Forms/EditNestInfoForm.Designer.cs @@ -28,532 +28,282 @@ /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.nameBox = new System.Windows.Forms.TextBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.labelEdgeSpacingLeft = new System.Windows.Forms.Label(); - this.labelEdgeSpacingTop = new System.Windows.Forms.Label(); - this.labelEdgeSpacingRight = new System.Windows.Forms.Label(); - this.labelEdgeSpacingBottom = new System.Windows.Forms.Label(); - this.leftSpacingBox = new OpenNest.Controls.NumericUpDown(); - this.topSpacingBox = new OpenNest.Controls.NumericUpDown(); - this.rightSpacingBox = new OpenNest.Controls.NumericUpDown(); - this.bottomSpacingBox = new OpenNest.Controls.NumericUpDown(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.labelSize = new System.Windows.Forms.Label(); - this.sizeBox = new System.Windows.Forms.TextBox(); - this.labelPartSpacing = new System.Windows.Forms.Label(); - this.partSpacingBox = new OpenNest.Controls.NumericUpDown(); - this.labelThk = new System.Windows.Forms.Label(); - this.labelThicknessName = new System.Windows.Forms.Label(); - this.thicknessNameBox = new System.Windows.Forms.TextBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.useForNewNestsBox = new System.Windows.Forms.CheckBox(); - this.quadrantSelect1 = new OpenNest.Controls.QuadrantSelect(); + this.components = new System.ComponentModel.Container(); this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.radioButton1 = new System.Windows.Forms.RadioButton(); - this.radioButton2 = new System.Windows.Forms.RadioButton(); - this.label2 = new System.Windows.Forms.Label(); - this.thicknessBox = new OpenNest.Controls.ThicknessComboBox(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); + this.infoPage = new System.Windows.Forms.TabPage(); + this.nestGroup = new System.Windows.Forms.GroupBox(); + this.nestTable = new System.Windows.Forms.TableLayoutPanel(); + this.labelName = new System.Windows.Forms.Label(); + this.nameBox = new System.Windows.Forms.TextBox(); + this.labelCustomer = new System.Windows.Forms.Label(); this.customerBox = new System.Windows.Forms.TextBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.label5 = new System.Windows.Forms.Label(); - this.labelMaterial = new System.Windows.Forms.Label(); - this.materialBox = new System.Windows.Forms.ComboBox(); - this.labelGrade = new System.Windows.Forms.Label(); - this.gradeBox = new System.Windows.Forms.ComboBox(); this.labelStatus = new System.Windows.Forms.Label(); this.statusBox = new System.Windows.Forms.ComboBox(); this.labelMadeBy = new System.Windows.Forms.Label(); this.madeByBox = new System.Windows.Forms.TextBox(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.tabPage3 = new System.Windows.Forms.TabPage(); + this.labelUnits = new System.Windows.Forms.Label(); + this.unitsPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.inchesButton = new System.Windows.Forms.RadioButton(); + this.millimetersButton = new System.Windows.Forms.RadioButton(); + this.materialGroup = new System.Windows.Forms.GroupBox(); + this.materialTable = new System.Windows.Forms.TableLayoutPanel(); + this.labelMaterial = new System.Windows.Forms.Label(); + this.materialBox = new System.Windows.Forms.ComboBox(); + this.labelGrade = new System.Windows.Forms.Label(); + this.gradeBox = new System.Windows.Forms.ComboBox(); + this.labelThickness = new System.Windows.Forms.Label(); + this.thicknessBox = new OpenNest.Controls.ThicknessComboBox(); + this.labelThicknessName = new System.Windows.Forms.Label(); + this.thicknessNameBox = new System.Windows.Forms.TextBox(); + this.datesLabel = new System.Windows.Forms.Label(); + this.defaultsPage = new System.Windows.Forms.TabPage(); + this.defaultsLabel = new System.Windows.Forms.Label(); + this.plateSettings = new OpenNest.Controls.PlateSettingsEditor(); + this.useForNewNestsBox = new System.Windows.Forms.CheckBox(); + this.notesPage = new System.Windows.Forms.TabPage(); this.notesBox = new System.Windows.Forms.TextBox(); - this.cancelButton = new System.Windows.Forms.Button(); this.bottomPanel1 = new OpenNest.Controls.BottomPanel(); - this.applyButton = new System.Windows.Forms.Button(); this.releaseLabel = new System.Windows.Forms.Label(); - this.groupBox1.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.leftSpacingBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.topSpacingBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.rightSpacingBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bottomSpacingBox)).BeginInit(); - this.tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.partSpacingBox)).BeginInit(); - this.groupBox3.SuspendLayout(); + this.applyButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.tableLayoutPanel3.SuspendLayout(); - this.tableLayoutPanel4.SuspendLayout(); - this.tabPage2.SuspendLayout(); - this.tabPage3.SuspendLayout(); + this.infoPage.SuspendLayout(); + this.nestGroup.SuspendLayout(); + this.nestTable.SuspendLayout(); + this.unitsPanel.SuspendLayout(); + this.materialGroup.SuspendLayout(); + this.materialTable.SuspendLayout(); + this.defaultsPage.SuspendLayout(); + this.notesPage.SuspendLayout(); this.bottomPanel1.SuspendLayout(); this.SuspendLayout(); - // - // label1 - // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(3, 11); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(126, 16); - this.label1.TabIndex = 0; - this.label1.Text = "Name :"; - // - // nameBox - // - this.nameBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.nameBox.Location = new System.Drawing.Point(135, 8); - this.nameBox.Name = "nameBox"; - this.nameBox.ReadOnly = true; - this.nameBox.Size = new System.Drawing.Size(224, 22); - this.nameBox.TabIndex = 1; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.tableLayoutPanel2); - this.groupBox1.Location = new System.Drawing.Point(6, 100); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(279, 176); - this.groupBox1.TabIndex = 3; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Edge Spacing"; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingLeft, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingTop, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingRight, 0, 2); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingBottom, 0, 3); - this.tableLayoutPanel2.Controls.Add(this.leftSpacingBox, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.topSpacingBox, 1, 1); - this.tableLayoutPanel2.Controls.Add(this.rightSpacingBox, 1, 2); - this.tableLayoutPanel2.Controls.Add(this.bottomSpacingBox, 1, 3); - this.tableLayoutPanel2.Location = new System.Drawing.Point(6, 19); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 4; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(267, 151); - this.tableLayoutPanel2.TabIndex = 0; - // - // labelEdgeSpacingLeft - // - this.labelEdgeSpacingLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingLeft.AutoSize = true; - this.labelEdgeSpacingLeft.Location = new System.Drawing.Point(3, 10); - this.labelEdgeSpacingLeft.Name = "labelEdgeSpacingLeft"; - this.labelEdgeSpacingLeft.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingLeft.TabIndex = 0; - this.labelEdgeSpacingLeft.Text = "Left :"; - this.labelEdgeSpacingLeft.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelEdgeSpacingTop - // - this.labelEdgeSpacingTop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingTop.AutoSize = true; - this.labelEdgeSpacingTop.Location = new System.Drawing.Point(3, 47); - this.labelEdgeSpacingTop.Name = "labelEdgeSpacingTop"; - this.labelEdgeSpacingTop.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingTop.TabIndex = 2; - this.labelEdgeSpacingTop.Text = "Top :"; - this.labelEdgeSpacingTop.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelEdgeSpacingRight - // - this.labelEdgeSpacingRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingRight.AutoSize = true; - this.labelEdgeSpacingRight.Location = new System.Drawing.Point(3, 84); - this.labelEdgeSpacingRight.Name = "labelEdgeSpacingRight"; - this.labelEdgeSpacingRight.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingRight.TabIndex = 4; - this.labelEdgeSpacingRight.Text = "Right :"; - this.labelEdgeSpacingRight.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelEdgeSpacingBottom - // - this.labelEdgeSpacingBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingBottom.AutoSize = true; - this.labelEdgeSpacingBottom.Location = new System.Drawing.Point(3, 123); - this.labelEdgeSpacingBottom.Name = "labelEdgeSpacingBottom"; - this.labelEdgeSpacingBottom.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingBottom.TabIndex = 6; - this.labelEdgeSpacingBottom.Text = "Bottom :"; - this.labelEdgeSpacingBottom.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // leftSpacingBox - // - this.leftSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.leftSpacingBox.DecimalPlaces = 4; - this.leftSpacingBox.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.leftSpacingBox.Location = new System.Drawing.Point(65, 7); - this.leftSpacingBox.Maximum = new decimal(new int[] { - 999999, - 0, - 0, - 0}); - this.leftSpacingBox.Name = "leftSpacingBox"; - this.leftSpacingBox.Size = new System.Drawing.Size(199, 22); - this.leftSpacingBox.Suffix = ""; - this.leftSpacingBox.TabIndex = 1; - // - // topSpacingBox - // - this.topSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.topSpacingBox.DecimalPlaces = 4; - this.topSpacingBox.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.topSpacingBox.Location = new System.Drawing.Point(65, 44); - this.topSpacingBox.Maximum = new decimal(new int[] { - 999999, - 0, - 0, - 0}); - this.topSpacingBox.Name = "topSpacingBox"; - this.topSpacingBox.Size = new System.Drawing.Size(199, 22); - this.topSpacingBox.Suffix = ""; - this.topSpacingBox.TabIndex = 3; - // - // rightSpacingBox - // - this.rightSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.rightSpacingBox.DecimalPlaces = 4; - this.rightSpacingBox.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.rightSpacingBox.Location = new System.Drawing.Point(65, 81); - this.rightSpacingBox.Maximum = new decimal(new int[] { - 999999, - 0, - 0, - 0}); - this.rightSpacingBox.Name = "rightSpacingBox"; - this.rightSpacingBox.Size = new System.Drawing.Size(199, 22); - this.rightSpacingBox.Suffix = ""; - this.rightSpacingBox.TabIndex = 5; - // - // bottomSpacingBox - // - this.bottomSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.bottomSpacingBox.DecimalPlaces = 4; - this.bottomSpacingBox.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.bottomSpacingBox.Location = new System.Drawing.Point(65, 120); - this.bottomSpacingBox.Maximum = new decimal(new int[] { - 999999, - 0, - 0, - 0}); - this.bottomSpacingBox.Name = "bottomSpacingBox"; - this.bottomSpacingBox.Size = new System.Drawing.Size(199, 22); - this.bottomSpacingBox.Suffix = ""; - this.bottomSpacingBox.TabIndex = 7; - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 2; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Controls.Add(this.labelSize, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.sizeBox, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.labelPartSpacing, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.partSpacingBox, 1, 1); - this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 6); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(267, 78); - this.tableLayoutPanel1.TabIndex = 2; - // - // labelSize - // - this.labelSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelSize.AutoSize = true; - this.labelSize.Location = new System.Drawing.Point(3, 11); - this.labelSize.Name = "labelSize"; - this.labelSize.Size = new System.Drawing.Size(91, 16); - this.labelSize.TabIndex = 0; - this.labelSize.Text = "Size :"; - this.labelSize.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // sizeBox - // - this.sizeBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.sizeBox.Location = new System.Drawing.Point(100, 8); - this.sizeBox.Name = "sizeBox"; - this.sizeBox.Size = new System.Drawing.Size(164, 22); - this.sizeBox.TabIndex = 1; - this.sizeBox.TextChanged += new System.EventHandler(this.sizeBox_TextChanged); - // - // labelPartSpacing - // - this.labelPartSpacing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelPartSpacing.AutoSize = true; - this.labelPartSpacing.Location = new System.Drawing.Point(3, 50); - this.labelPartSpacing.Name = "labelPartSpacing"; - this.labelPartSpacing.Size = new System.Drawing.Size(91, 16); - this.labelPartSpacing.TabIndex = 2; - this.labelPartSpacing.Text = "Part Spacing :"; - this.labelPartSpacing.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // partSpacingBox - // - this.partSpacingBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.partSpacingBox.DecimalPlaces = 4; - this.partSpacingBox.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.partSpacingBox.Location = new System.Drawing.Point(100, 47); - this.partSpacingBox.Maximum = new decimal(new int[] { - 999999, - 0, - 0, - 0}); - this.partSpacingBox.Name = "partSpacingBox"; - this.partSpacingBox.Size = new System.Drawing.Size(164, 22); - this.partSpacingBox.Suffix = ""; - this.partSpacingBox.TabIndex = 1; - // - // labelThk - // - this.labelThk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelThk.AutoSize = true; - this.labelThk.Location = new System.Drawing.Point(3, 128); - this.labelThk.Name = "labelThk"; - this.labelThk.Size = new System.Drawing.Size(126, 16); - this.labelThk.TabIndex = 6; - this.labelThk.Text = "Thickness :"; // - // labelThicknessName - // - this.labelThicknessName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelThicknessName.AutoSize = true; - this.labelThicknessName.Name = "labelThicknessName"; - this.labelThicknessName.Size = new System.Drawing.Size(126, 16); - this.labelThicknessName.TabIndex = 8; - this.labelThicknessName.Text = "Thickness name :"; - // - // thicknessNameBox - // - this.thicknessNameBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.thicknessNameBox.Name = "thicknessNameBox"; - this.thicknessNameBox.Size = new System.Drawing.Size(224, 22); - this.thicknessNameBox.TabIndex = 9; - // - // groupBox3 - // - this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox3.Controls.Add(this.quadrantSelect1); - this.groupBox3.Location = new System.Drawing.Point(306, 6); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(315, 270); - this.groupBox3.TabIndex = 7; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Quadrant"; - // - // quadrantSelect1 - // - this.quadrantSelect1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.quadrantSelect1.BackColor = System.Drawing.Color.White; - this.quadrantSelect1.Location = new System.Drawing.Point(6, 19); - this.quadrantSelect1.Name = "quadrantSelect1"; - this.quadrantSelect1.Quadrant = 1; - this.quadrantSelect1.Size = new System.Drawing.Size(303, 245); - this.quadrantSelect1.TabIndex = 5; - this.quadrantSelect1.Text = "quadrantSelect1"; - // // tabControl1 - // - this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + // + this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Controls.Add(this.tabPage3); + this.tabControl1.Controls.Add(this.infoPage); + this.tabControl1.Controls.Add(this.defaultsPage); + this.tabControl1.Controls.Add(this.notesPage); this.tabControl1.ItemSize = new System.Drawing.Size(100, 22); this.tabControl1.Location = new System.Drawing.Point(12, 12); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(635, 453); + this.tabControl1.Size = new System.Drawing.Size(576, 350); this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.tabControl1.TabIndex = 0; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.tableLayoutPanel3); - this.tabPage1.Location = new System.Drawing.Point(4, 26); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(627, 423); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Info"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // tableLayoutPanel3 - // - this.tableLayoutPanel3.ColumnCount = 2; - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 8); - this.tableLayoutPanel3.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel3.Controls.Add(this.nameBox, 1, 0); - this.tableLayoutPanel3.Controls.Add(this.label2, 0, 7); - this.tableLayoutPanel3.Controls.Add(this.labelThk, 0, 3); - this.tableLayoutPanel3.Controls.Add(this.thicknessBox, 1, 3); - this.tableLayoutPanel3.Controls.Add(this.labelThicknessName, 0, 4); - this.tableLayoutPanel3.Controls.Add(this.thicknessNameBox, 1, 4); - this.tableLayoutPanel3.Controls.Add(this.labelMaterial, 0, 5); - this.tableLayoutPanel3.Controls.Add(this.materialBox, 1, 5); - this.tableLayoutPanel3.Controls.Add(this.labelGrade, 0, 6); - this.tableLayoutPanel3.Controls.Add(this.gradeBox, 1, 6); - this.tableLayoutPanel3.Controls.Add(this.label3, 0, 1); - this.tableLayoutPanel3.Controls.Add(this.label4, 0, 2); - this.tableLayoutPanel3.Controls.Add(this.customerBox, 1, 7); - this.tableLayoutPanel3.Controls.Add(this.textBox1, 1, 1); - this.tableLayoutPanel3.Controls.Add(this.textBox2, 1, 2); - this.tableLayoutPanel3.Controls.Add(this.label5, 0, 8); - this.tableLayoutPanel3.Controls.Add(this.labelStatus, 0, 9); - this.tableLayoutPanel3.Controls.Add(this.statusBox, 1, 9); - this.tableLayoutPanel3.Controls.Add(this.labelMadeBy, 0, 10); - this.tableLayoutPanel3.Controls.Add(this.madeByBox, 1, 10); - this.tableLayoutPanel3.Location = new System.Drawing.Point(6, 6); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 11; - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(362, 342); - this.tableLayoutPanel3.TabIndex = 0; - // - // tableLayoutPanel4 - // - this.tableLayoutPanel4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tableLayoutPanel4.ColumnCount = 2; - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel4.Controls.Add(this.radioButton1, 0, 0); - this.tableLayoutPanel4.Controls.Add(this.radioButton2, 1, 0); - this.tableLayoutPanel4.Location = new System.Drawing.Point(135, 198); - this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - this.tableLayoutPanel4.RowCount = 1; - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel4.Size = new System.Drawing.Size(224, 39); - this.tableLayoutPanel4.TabIndex = 1; - // - // radioButton1 - // - this.radioButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.radioButton1.AutoSize = true; - this.radioButton1.Location = new System.Drawing.Point(3, 9); - this.radioButton1.Name = "radioButton1"; - this.radioButton1.Size = new System.Drawing.Size(106, 20); - this.radioButton1.TabIndex = 0; - this.radioButton1.TabStop = true; - this.radioButton1.Text = "Inches"; - this.radioButton1.UseVisualStyleBackColor = true; - this.radioButton1.CheckedChanged += new System.EventHandler(this.Units_Changed); - // - // radioButton2 - // - this.radioButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.radioButton2.AutoSize = true; - this.radioButton2.Location = new System.Drawing.Point(115, 9); - this.radioButton2.Name = "radioButton2"; - this.radioButton2.Size = new System.Drawing.Size(106, 20); - this.radioButton2.TabIndex = 0; - this.radioButton2.TabStop = true; - this.radioButton2.Text = "Millimeters"; - this.radioButton2.UseVisualStyleBackColor = true; - this.radioButton2.CheckedChanged += new System.EventHandler(this.Units_Changed); - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(3, 167); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(126, 16); - this.label2.TabIndex = 8; - this.label2.Text = "Customer :"; - // - // thicknessBox - // - this.thicknessBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.thicknessBox.Location = new System.Drawing.Point(135, 125); - this.thicknessBox.Name = "thicknessBox"; - this.thicknessBox.Size = new System.Drawing.Size(224, 22); - this.thicknessBox.FormattingEnabled = true; - this.thicknessBox.TabIndex = 7; + // + // infoPage + // + this.infoPage.Controls.Add(this.datesLabel); + this.infoPage.Controls.Add(this.materialGroup); + this.infoPage.Controls.Add(this.nestGroup); + this.infoPage.Name = "infoPage"; + this.infoPage.Padding = new System.Windows.Forms.Padding(3); + this.infoPage.TabIndex = 0; + this.infoPage.Text = "Info"; + this.infoPage.UseVisualStyleBackColor = true; + // + // nestGroup + // + this.nestGroup.Controls.Add(this.nestTable); + this.nestGroup.Location = new System.Drawing.Point(9, 9); + this.nestGroup.Name = "nestGroup"; + this.nestGroup.Padding = new System.Windows.Forms.Padding(8, 4, 8, 6); + this.nestGroup.Size = new System.Drawing.Size(550, 128); + this.nestGroup.TabIndex = 0; + this.nestGroup.TabStop = false; + this.nestGroup.Text = "Nest"; + // + // nestTable + // + this.nestTable.ColumnCount = 4; + this.nestTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 84F)); + this.nestTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.nestTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 84F)); + this.nestTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.nestTable.Controls.Add(this.labelName, 0, 0); + this.nestTable.Controls.Add(this.nameBox, 1, 0); + this.nestTable.Controls.Add(this.labelCustomer, 0, 1); + this.nestTable.Controls.Add(this.customerBox, 1, 1); + this.nestTable.Controls.Add(this.labelStatus, 2, 1); + this.nestTable.Controls.Add(this.statusBox, 3, 1); + this.nestTable.Controls.Add(this.labelMadeBy, 0, 2); + this.nestTable.Controls.Add(this.madeByBox, 1, 2); + this.nestTable.Controls.Add(this.labelUnits, 2, 2); + this.nestTable.Controls.Add(this.unitsPanel, 3, 2); + this.nestTable.Dock = System.Windows.Forms.DockStyle.Fill; + this.nestTable.Name = "nestTable"; + this.nestTable.RowCount = 3; + this.nestTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.nestTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.nestTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.nestTable.SetColumnSpan(this.nameBox, 3); + this.nestTable.TabIndex = 0; + // + // labelName + // + this.labelName.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelName.AutoSize = true; + this.labelName.Name = "labelName"; + this.labelName.TabIndex = 0; + this.labelName.Text = "Name :"; + // + // nameBox + // + this.nameBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nameBox.Name = "nameBox"; + this.nameBox.ReadOnly = true; + this.nameBox.Size = new System.Drawing.Size(440, 22); + this.nameBox.TabIndex = 1; + // + // labelCustomer + // + this.labelCustomer.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelCustomer.AutoSize = true; + this.labelCustomer.Name = "labelCustomer"; + this.labelCustomer.TabIndex = 2; + this.labelCustomer.Text = "Customer :"; + // + // customerBox + // + this.customerBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.customerBox.Name = "customerBox"; + this.customerBox.Size = new System.Drawing.Size(170, 22); + this.customerBox.TabIndex = 3; + // + // labelStatus + // + this.labelStatus.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelStatus.AutoSize = true; + this.labelStatus.Margin = new System.Windows.Forms.Padding(12, 0, 3, 0); + this.labelStatus.Name = "labelStatus"; + this.labelStatus.TabIndex = 4; + this.labelStatus.Text = "Status :"; + // + // statusBox + // + this.statusBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.statusBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.statusBox.FormattingEnabled = true; + this.statusBox.Name = "statusBox"; + this.statusBox.Size = new System.Drawing.Size(170, 24); + this.statusBox.TabIndex = 5; + // + // labelMadeBy + // + this.labelMadeBy.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelMadeBy.AutoSize = true; + this.labelMadeBy.Name = "labelMadeBy"; + this.labelMadeBy.TabIndex = 6; + this.labelMadeBy.Text = "Made By :"; + // + // madeByBox + // + this.madeByBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.madeByBox.Name = "madeByBox"; + this.madeByBox.Size = new System.Drawing.Size(170, 22); + this.madeByBox.TabIndex = 7; + // + // labelUnits + // + this.labelUnits.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelUnits.AutoSize = true; + this.labelUnits.Margin = new System.Windows.Forms.Padding(12, 0, 3, 0); + this.labelUnits.Name = "labelUnits"; + this.labelUnits.TabIndex = 8; + this.labelUnits.Text = "Units :"; + // + // unitsPanel + // + this.unitsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.unitsPanel.Controls.Add(this.inchesButton); + this.unitsPanel.Controls.Add(this.millimetersButton); + this.unitsPanel.Name = "unitsPanel"; + this.unitsPanel.Size = new System.Drawing.Size(170, 26); + this.unitsPanel.TabIndex = 9; + this.unitsPanel.WrapContents = false; + // + // inchesButton + // + this.inchesButton.AutoSize = true; + this.inchesButton.Margin = new System.Windows.Forms.Padding(0, 3, 12, 3); + this.inchesButton.Name = "inchesButton"; + this.inchesButton.TabIndex = 0; + this.inchesButton.TabStop = true; + this.inchesButton.Text = "Inches"; + this.inchesButton.UseVisualStyleBackColor = true; + this.inchesButton.CheckedChanged += new System.EventHandler(this.Units_Changed); + // + // millimetersButton + // + this.millimetersButton.AutoSize = true; + this.millimetersButton.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); + this.millimetersButton.Name = "millimetersButton"; + this.millimetersButton.TabIndex = 1; + this.millimetersButton.TabStop = true; + this.millimetersButton.Text = "Millimeters"; + this.millimetersButton.UseVisualStyleBackColor = true; + this.millimetersButton.CheckedChanged += new System.EventHandler(this.Units_Changed); + // + // materialGroup + // + this.materialGroup.Controls.Add(this.materialTable); + this.materialGroup.Location = new System.Drawing.Point(9, 147); + this.materialGroup.Name = "materialGroup"; + this.materialGroup.Padding = new System.Windows.Forms.Padding(8, 4, 8, 6); + this.materialGroup.Size = new System.Drawing.Size(550, 96); + this.materialGroup.TabIndex = 1; + this.materialGroup.TabStop = false; + this.materialGroup.Text = "Material"; + // + // materialTable + // + this.materialTable.ColumnCount = 4; + this.materialTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 84F)); + this.materialTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.materialTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 84F)); + this.materialTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.materialTable.Controls.Add(this.labelMaterial, 0, 0); + this.materialTable.Controls.Add(this.materialBox, 1, 0); + this.materialTable.Controls.Add(this.labelGrade, 2, 0); + this.materialTable.Controls.Add(this.gradeBox, 3, 0); + this.materialTable.Controls.Add(this.labelThickness, 0, 1); + this.materialTable.Controls.Add(this.thicknessBox, 1, 1); + this.materialTable.Controls.Add(this.labelThicknessName, 2, 1); + this.materialTable.Controls.Add(this.thicknessNameBox, 3, 1); + this.materialTable.Dock = System.Windows.Forms.DockStyle.Fill; + this.materialTable.Name = "materialTable"; + this.materialTable.RowCount = 2; + this.materialTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.materialTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.materialTable.TabIndex = 0; // // labelMaterial // - this.labelMaterial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.labelMaterial.Anchor = System.Windows.Forms.AnchorStyles.Left; this.labelMaterial.AutoSize = true; - this.labelMaterial.Location = new System.Drawing.Point(3, 162); this.labelMaterial.Name = "labelMaterial"; - this.labelMaterial.Size = new System.Drawing.Size(126, 16); - this.labelMaterial.TabIndex = 10; + this.labelMaterial.TabIndex = 0; this.labelMaterial.Text = "Material :"; // // materialBox // this.materialBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.materialBox.FormattingEnabled = true; - this.materialBox.Location = new System.Drawing.Point(135, 159); this.materialBox.Name = "materialBox"; - this.materialBox.Size = new System.Drawing.Size(224, 24); - this.materialBox.TabIndex = 11; + this.materialBox.Size = new System.Drawing.Size(170, 24); + this.materialBox.TabIndex = 1; // // labelGrade // - this.labelGrade.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.labelGrade.Anchor = System.Windows.Forms.AnchorStyles.Left; this.labelGrade.AutoSize = true; + this.labelGrade.Margin = new System.Windows.Forms.Padding(12, 0, 3, 0); this.labelGrade.Name = "labelGrade"; - this.labelGrade.TabIndex = 10; + this.labelGrade.TabIndex = 2; this.labelGrade.Text = "Grade :"; // // gradeBox @@ -561,195 +311,162 @@ this.gradeBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.gradeBox.FormattingEnabled = true; this.gradeBox.Name = "gradeBox"; - this.gradeBox.Size = new System.Drawing.Size(224, 24); - this.gradeBox.TabIndex = 11; - // - // labelStatus - // - this.labelStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelStatus.AutoSize = true; - this.labelStatus.Name = "labelStatus"; - this.labelStatus.TabIndex = 12; - this.labelStatus.Text = "Status :"; - // - // statusBox - // - this.statusBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.statusBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.statusBox.FormattingEnabled = true; - this.statusBox.Name = "statusBox"; - this.statusBox.TabIndex = 13; - // - // labelMadeBy - // - this.labelMadeBy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelMadeBy.AutoSize = true; - this.labelMadeBy.Name = "labelMadeBy"; - this.labelMadeBy.TabIndex = 14; - this.labelMadeBy.Text = "Made By :"; - // - // madeByBox - // - this.madeByBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.madeByBox.Name = "madeByBox"; - this.madeByBox.Size = new System.Drawing.Size(224, 22); - this.madeByBox.TabIndex = 15; + this.gradeBox.Size = new System.Drawing.Size(170, 24); + this.gradeBox.TabIndex = 3; // - // label3 + // labelThickness + // + this.labelThickness.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelThickness.AutoSize = true; + this.labelThickness.Name = "labelThickness"; + this.labelThickness.TabIndex = 4; + this.labelThickness.Text = "Thickness :"; + // + // thicknessBox + // + this.thicknessBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.thicknessBox.FormattingEnabled = true; + this.thicknessBox.Name = "thicknessBox"; + this.thicknessBox.ShowNames = false; + this.thicknessBox.Size = new System.Drawing.Size(170, 24); + this.thicknessBox.TabIndex = 5; + // + // labelThicknessName + // + this.labelThicknessName.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.labelThicknessName.AutoSize = true; + this.labelThicknessName.Margin = new System.Windows.Forms.Padding(12, 0, 3, 0); + this.labelThicknessName.Name = "labelThicknessName"; + this.labelThicknessName.TabIndex = 6; + this.labelThicknessName.Text = "Name :"; + this.toolTip.SetToolTip(this.labelThicknessName, "The shop's name for this thickness, such as 10 ga or 1/4\". It follows the thickness unless you type your own."); + // + // thicknessNameBox + // + this.thicknessNameBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.thicknessNameBox.Name = "thicknessNameBox"; + this.thicknessNameBox.Size = new System.Drawing.Size(170, 22); + this.thicknessNameBox.TabIndex = 7; + this.toolTip.SetToolTip(this.thicknessNameBox, "The shop's name for this thickness, such as 10 ga or 1/4\". It follows the thickness unless you type your own."); + // + // datesLabel + // + this.datesLabel.AutoSize = true; + this.datesLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.datesLabel.Location = new System.Drawing.Point(12, 254); + this.datesLabel.Name = "datesLabel"; + this.datesLabel.TabIndex = 2; + // + // defaultsPage + // + this.defaultsPage.Controls.Add(this.useForNewNestsBox); + this.defaultsPage.Controls.Add(this.plateSettings); + this.defaultsPage.Controls.Add(this.defaultsLabel); + this.defaultsPage.Name = "defaultsPage"; + this.defaultsPage.Padding = new System.Windows.Forms.Padding(3); + this.defaultsPage.TabIndex = 1; + this.defaultsPage.Text = "Defaults"; + this.defaultsPage.UseVisualStyleBackColor = true; + // + // defaultsLabel + // + this.defaultsLabel.AutoSize = true; + this.defaultsLabel.ForeColor = System.Drawing.SystemColors.GrayText; + this.defaultsLabel.Location = new System.Drawing.Point(9, 10); + this.defaultsLabel.Name = "defaultsLabel"; + this.defaultsLabel.TabIndex = 0; + this.defaultsLabel.Text = "Plates added to this nest start with these settings."; + // + // plateSettings + // + this.plateSettings.Location = new System.Drawing.Point(9, 36); + this.plateSettings.Name = "plateSettings"; + this.plateSettings.Size = new System.Drawing.Size(550, 236); + this.plateSettings.TabIndex = 1; + this.plateSettings.SizeTextChanged += new System.EventHandler(this.sizeBox_TextChanged); // - this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(3, 50); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(126, 16); - this.label3.TabIndex = 2; - this.label3.Text = "Date Created :"; - // - // label4 - // - this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(3, 89); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(126, 16); - this.label4.TabIndex = 4; - this.label4.Text = "Date Last Modified :"; - // - // customerBox - // - this.customerBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.customerBox.Location = new System.Drawing.Point(135, 164); - this.customerBox.Name = "customerBox"; - this.customerBox.Size = new System.Drawing.Size(224, 22); - this.customerBox.TabIndex = 9; - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.Location = new System.Drawing.Point(135, 47); - this.textBox1.Name = "textBox1"; - this.textBox1.ReadOnly = true; - this.textBox1.Size = new System.Drawing.Size(224, 22); - this.textBox1.TabIndex = 3; - // - // textBox2 - // - this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.textBox2.Location = new System.Drawing.Point(135, 86); - this.textBox2.Name = "textBox2"; - this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(224, 22); - this.textBox2.TabIndex = 5; - // - // label5 - // - this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(3, 209); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(126, 16); - this.label5.TabIndex = 8; - this.label5.Text = "Units :"; - // - // tabPage2 - // - this.tabPage2.Controls.Add(this.useForNewNestsBox); - this.tabPage2.Controls.Add(this.groupBox3); - this.tabPage2.Controls.Add(this.groupBox1); - this.tabPage2.Controls.Add(this.tableLayoutPanel1); - this.tabPage2.Location = new System.Drawing.Point(4, 26); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(627, 423); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Defaults"; - this.tabPage2.UseVisualStyleBackColor = true; - // // useForNewNestsBox - // + // this.useForNewNestsBox.AutoSize = true; - this.useForNewNestsBox.Location = new System.Drawing.Point(12, 288); + this.useForNewNestsBox.Location = new System.Drawing.Point(12, 282); this.useForNewNestsBox.Name = "useForNewNestsBox"; - this.useForNewNestsBox.TabIndex = 8; - this.useForNewNestsBox.Text = "Use these defaults for new nests"; + this.useForNewNestsBox.TabIndex = 2; + this.useForNewNestsBox.Text = "Also use these defaults for new nests"; this.useForNewNestsBox.UseVisualStyleBackColor = true; this.useForNewNestsBox.Visible = false; - // - // tabPage3 - // - this.tabPage3.Controls.Add(this.notesBox); - this.tabPage3.Location = new System.Drawing.Point(4, 26); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(627, 423); - this.tabPage3.TabIndex = 2; - this.tabPage3.Text = "Notes"; - this.tabPage3.UseVisualStyleBackColor = true; - // + // + // notesPage + // + this.notesPage.Controls.Add(this.notesBox); + this.notesPage.Name = "notesPage"; + this.notesPage.Padding = new System.Windows.Forms.Padding(9); + this.notesPage.TabIndex = 2; + this.notesPage.Text = "Notes"; + this.notesPage.UseVisualStyleBackColor = true; + // // notesBox - // - this.notesBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.notesBox.Location = new System.Drawing.Point(6, 6); + // + this.notesBox.AcceptsReturn = true; + this.notesBox.Dock = System.Windows.Forms.DockStyle.Fill; this.notesBox.Multiline = true; this.notesBox.Name = "notesBox"; - this.notesBox.Size = new System.Drawing.Size(615, 408); - this.notesBox.TabIndex = 2; - // - // cancelButton - // - this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(557, 10); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(90, 28); - this.cancelButton.TabIndex = 1; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // + this.notesBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.notesBox.TabIndex = 0; + // // bottomPanel1 - // + // this.bottomPanel1.Controls.Add(this.releaseLabel); this.bottomPanel1.Controls.Add(this.applyButton); this.bottomPanel1.Controls.Add(this.cancelButton); this.bottomPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.bottomPanel1.Location = new System.Drawing.Point(0, 471); + this.bottomPanel1.Location = new System.Drawing.Point(0, 370); this.bottomPanel1.Name = "bottomPanel1"; - this.bottomPanel1.Size = new System.Drawing.Size(659, 50); + this.bottomPanel1.Size = new System.Drawing.Size(600, 50); this.bottomPanel1.TabIndex = 1; - // + // // releaseLabel - // - this.releaseLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + // + this.releaseLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.releaseLabel.AutoEllipsis = true; this.releaseLabel.ForeColor = System.Drawing.SystemColors.GrayText; this.releaseLabel.Location = new System.Drawing.Point(12, 16); this.releaseLabel.Name = "releaseLabel"; - this.releaseLabel.Size = new System.Drawing.Size(440, 18); + this.releaseLabel.Size = new System.Drawing.Size(380, 18); this.releaseLabel.TabIndex = 2; - // + // // applyButton - // + // this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.applyButton.DialogResult = System.Windows.Forms.DialogResult.OK; this.applyButton.Enabled = false; - this.applyButton.Location = new System.Drawing.Point(461, 10); + this.applyButton.Location = new System.Drawing.Point(402, 11); this.applyButton.Name = "applyButton"; this.applyButton.Size = new System.Drawing.Size(90, 28); this.applyButton.TabIndex = 0; this.applyButton.Text = "Done"; this.applyButton.UseVisualStyleBackColor = true; - // + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(498, 11); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(90, 28); + this.cancelButton.TabIndex = 1; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // // EditNestInfoForm - // + // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(659, 521); + this.ClientSize = new System.Drawing.Size(600, 420); this.Controls.Add(this.tabControl1); this.Controls.Add(this.bottomPanel1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "EditNestInfoForm"; @@ -757,26 +474,21 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Edit Nest"; - this.groupBox1.ResumeLayout(false); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.leftSpacingBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.topSpacingBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.rightSpacingBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bottomSpacingBox)).EndInit(); - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.partSpacingBox)).EndInit(); - this.groupBox3.ResumeLayout(false); this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tableLayoutPanel3.ResumeLayout(false); - this.tableLayoutPanel3.PerformLayout(); - this.tableLayoutPanel4.ResumeLayout(false); - this.tableLayoutPanel4.PerformLayout(); - this.tabPage2.ResumeLayout(false); - this.tabPage3.ResumeLayout(false); - this.tabPage3.PerformLayout(); + this.infoPage.ResumeLayout(false); + this.infoPage.PerformLayout(); + this.nestGroup.ResumeLayout(false); + this.nestTable.ResumeLayout(false); + this.nestTable.PerformLayout(); + this.unitsPanel.ResumeLayout(false); + this.unitsPanel.PerformLayout(); + this.materialGroup.ResumeLayout(false); + this.materialTable.ResumeLayout(false); + this.materialTable.PerformLayout(); + this.defaultsPage.ResumeLayout(false); + this.defaultsPage.PerformLayout(); + this.notesPage.ResumeLayout(false); + this.notesPage.PerformLayout(); this.bottomPanel1.ResumeLayout(false); this.ResumeLayout(false); @@ -784,57 +496,43 @@ #endregion - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox nameBox; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.Label labelEdgeSpacingLeft; - private System.Windows.Forms.Label labelEdgeSpacingTop; - private System.Windows.Forms.Label labelEdgeSpacingRight; - private System.Windows.Forms.Label labelEdgeSpacingBottom; - private Controls.NumericUpDown leftSpacingBox; - private Controls.NumericUpDown topSpacingBox; - private Controls.NumericUpDown rightSpacingBox; - private Controls.NumericUpDown bottomSpacingBox; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Label labelSize; - private System.Windows.Forms.TextBox sizeBox; - private Controls.ThicknessComboBox thicknessBox; - private System.Windows.Forms.Label labelThk; - private System.Windows.Forms.Label labelThicknessName; - private System.Windows.Forms.TextBox thicknessNameBox; - private System.Windows.Forms.Label labelPartSpacing; - private Controls.NumericUpDown partSpacingBox; - private Controls.BottomPanel bottomPanel1; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.CheckBox useForNewNestsBox; - private Controls.QuadrantSelect quadrantSelect1; - private System.Windows.Forms.Button applyButton; - private System.Windows.Forms.Label releaseLabel; - private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.TabPage tabPage3; - private System.Windows.Forms.TextBox notesBox; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; + private System.Windows.Forms.TabPage infoPage; + private System.Windows.Forms.GroupBox nestGroup; + private System.Windows.Forms.TableLayoutPanel nestTable; + private System.Windows.Forms.Label labelName; + private System.Windows.Forms.TextBox nameBox; + private System.Windows.Forms.Label labelCustomer; private System.Windows.Forms.TextBox customerBox; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.RadioButton radioButton1; - private System.Windows.Forms.RadioButton radioButton2; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label labelMaterial; - private System.Windows.Forms.ComboBox materialBox; - private System.Windows.Forms.Label labelGrade; - private System.Windows.Forms.ComboBox gradeBox; private System.Windows.Forms.Label labelStatus; private System.Windows.Forms.ComboBox statusBox; private System.Windows.Forms.Label labelMadeBy; private System.Windows.Forms.TextBox madeByBox; + private System.Windows.Forms.Label labelUnits; + private System.Windows.Forms.FlowLayoutPanel unitsPanel; + private System.Windows.Forms.RadioButton inchesButton; + private System.Windows.Forms.RadioButton millimetersButton; + private System.Windows.Forms.GroupBox materialGroup; + private System.Windows.Forms.TableLayoutPanel materialTable; + private System.Windows.Forms.Label labelMaterial; + private System.Windows.Forms.ComboBox materialBox; + private System.Windows.Forms.Label labelGrade; + private System.Windows.Forms.ComboBox gradeBox; + private System.Windows.Forms.Label labelThickness; + private OpenNest.Controls.ThicknessComboBox thicknessBox; + private System.Windows.Forms.Label labelThicknessName; + private System.Windows.Forms.TextBox thicknessNameBox; + private System.Windows.Forms.Label datesLabel; + private System.Windows.Forms.TabPage defaultsPage; + private System.Windows.Forms.Label defaultsLabel; + private OpenNest.Controls.PlateSettingsEditor plateSettings; + private System.Windows.Forms.CheckBox useForNewNestsBox; + private System.Windows.Forms.TabPage notesPage; + private System.Windows.Forms.TextBox notesBox; + private OpenNest.Controls.BottomPanel bottomPanel1; + private System.Windows.Forms.Label releaseLabel; + private System.Windows.Forms.Button applyButton; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.ToolTip toolTip; } -} \ No newline at end of file +} diff --git a/OpenNest/Forms/EditNestInfoForm.cs b/OpenNest/Forms/EditNestInfoForm.cs index b5b93e60..627f5248 100644 --- a/OpenNest/Forms/EditNestInfoForm.cs +++ b/OpenNest/Forms/EditNestInfoForm.cs @@ -46,14 +46,14 @@ namespace OpenNest.Forms thicknessBox.TextChanged += (sender, e) => { EnableCheck(); - RefreshThicknessName(); + RefreshThicknessName(thicknessEdited: true); }; materialBox.TextChanged += (sender, e) => { RefreshGrades(); - RefreshThicknessName(); + RefreshThicknessName(thicknessEdited: false); }; - gradeBox.TextChanged += (sender, e) => RefreshThicknessName(); + gradeBox.TextChanged += (sender, e) => RefreshThicknessName(thicknessEdited: false); EnableCheck(); } @@ -114,8 +114,8 @@ namespace OpenNest.Forms public string SizeString { - get { return sizeBox.Text; } - set { sizeBox.Text = value; } + get { return plateSettings.SizeText; } + set { plateSettings.SizeText = value; } } public DateTime DateCreated @@ -124,7 +124,7 @@ namespace OpenNest.Forms set { dateCreated = value; - textBox1.Text = dateCreated.ToShortDateString(); + UpdateDates(); } } @@ -134,38 +134,41 @@ namespace OpenNest.Forms set { dateLastModified = value; - textBox2.Text = dateLastModified.ToShortDateString(); + UpdateDates(); } } + private void UpdateDates() => + datesLabel.Text = $"Created {dateCreated.ToShortDateString()} Last modified {dateLastModified.ToShortDateString()}"; + public double LeftSpacing { - get { return (double)leftSpacingBox.Value; } - set { leftSpacingBox.Value = (decimal)value; } + get { return plateSettings.LeftSpacing; } + set { plateSettings.LeftSpacing = value; } } public double TopSpacing { - get { return (double)topSpacingBox.Value; } - set { topSpacingBox.Value = (decimal)value; } + get { return plateSettings.TopSpacing; } + set { plateSettings.TopSpacing = value; } } public double RightSpacing { - get { return (double)rightSpacingBox.Value; } - set { rightSpacingBox.Value = (decimal)value; } + get { return plateSettings.RightSpacing; } + set { plateSettings.RightSpacing = value; } } public double BottomSpacing { - get { return (double)bottomSpacingBox.Value; } - set { bottomSpacingBox.Value = (decimal)value; } + get { return plateSettings.BottomSpacing; } + set { plateSettings.BottomSpacing = value; } } public double PartSpacing { - get { return (double)partSpacingBox.Value; } - set { partSpacingBox.Value = (decimal)value; } + get { return plateSettings.PartSpacing; } + set { plateSettings.PartSpacing = value; } } public double Thickness @@ -192,10 +195,10 @@ namespace OpenNest.Forms public void SetThicknessMachines(IEnumerable machines) { thicknessMachines = (machines ?? Enumerable.Empty()).Where(m => m != null).ToList(); - RefreshThicknessName(); + RefreshThicknessName(thicknessEdited: false); } - private void RefreshThicknessName() + private void RefreshThicknessName(bool thicknessEdited) { if (!thicknessBox.TryGetValue(out var value)) return; @@ -204,6 +207,9 @@ namespace OpenNest.Forms var text = thicknessBox.Text.Trim(); var picked = StandardThicknesses.Entries.FirstOrDefault(entry => string.Equals(StandardThicknesses.Label(entry, GetUnits()), text, StringComparison.OrdinalIgnoreCase)); + // The box then shows a picked entry as its bare number: the same thickness keeps its name. + if (thicknessEdited && picked == null && namedThickness == value) + return; var suggested = picked?.Name ?? ThicknessNames.For(thicknessMachines, MaterialName, MaterialGrade, value, GetUnits()); var current = ThicknessName; @@ -287,11 +293,11 @@ namespace OpenNest.Forms switch (units) { case OpenNest.Units.Inches: - radioButton1.Checked = true; + inchesButton.Checked = true; break; case OpenNest.Units.Millimeters: - radioButton2.Checked = true; + millimetersButton.Checked = true; break; } @@ -300,10 +306,10 @@ namespace OpenNest.Forms public Units GetUnits() { - if (radioButton1.Checked) + if (inchesButton.Checked) return Units.Inches; - if (radioButton2.Checked) + if (millimetersButton.Checked) return Units.Millimeters; return OpenNest.Units.Inches; @@ -311,27 +317,14 @@ namespace OpenNest.Forms private void UpdateUnitSuffix() { - var unitBoxes = new Controls.NumericUpDown[] - { - partSpacingBox, - leftSpacingBox, - topSpacingBox, - rightSpacingBox, - bottomSpacingBox, - }; - - var unitString = " " + UnitsHelper.GetShortString(GetUnits()); - - foreach (var box in unitBoxes) - box.Suffix = unitString; - + plateSettings.Units = GetUnits(); thicknessBox.Units = GetUnits(); } public int Quadrant { - get { return quadrantSelect1.Quadrant; } - set { quadrantSelect1.Quadrant = value; } + get { return plateSettings.Quadrant; } + set { plateSettings.Quadrant = value; } } public void EnableCheck() => applyButton.Enabled = GetValues().CanApply(thicknessBox.IsValid); diff --git a/OpenNest/Forms/EditPlateForm.Designer.cs b/OpenNest/Forms/EditPlateForm.Designer.cs index f315c5c5..9c8ae8a5 100644 --- a/OpenNest/Forms/EditPlateForm.Designer.cs +++ b/OpenNest/Forms/EditPlateForm.Designer.cs @@ -28,375 +28,121 @@ /// private void InitializeComponent() { - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.labelQty = new System.Windows.Forms.Label(); - this.labelSize = new System.Windows.Forms.Label(); - this.textBoxSize = new System.Windows.Forms.TextBox(); - this.labelPartSpacing = new System.Windows.Forms.Label(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.labelEdgeSpacingLeft = new System.Windows.Forms.Label(); - this.labelEdgeSpacingTop = new System.Windows.Forms.Label(); - this.labelEdgeSpacingRight = new System.Windows.Forms.Label(); - this.labelEdgeSpacingBottom = new System.Windows.Forms.Label(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.applyButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.bottomPanel1 = new OpenNest.Controls.BottomPanel(); - this.quadrantSelect1 = new OpenNest.Controls.QuadrantSelect(); + this.numericUpDownQty = new OpenNest.Controls.NumericUpDown(); this.labelOutline = new System.Windows.Forms.Label(); this.buttonImportOutline = new System.Windows.Forms.Button(); this.buttonClearOutline = new System.Windows.Forms.Button(); - this.numericUpDownEdgeSpacingLeft = new OpenNest.Controls.NumericUpDown(); - this.numericUpDownEdgeSpacingTop = new OpenNest.Controls.NumericUpDown(); - this.numericUpDownEdgeSpacingRight = new OpenNest.Controls.NumericUpDown(); - this.numericUpDownEdgeSpacingBottom = new OpenNest.Controls.NumericUpDown(); - this.numericUpDownQty = new OpenNest.Controls.NumericUpDown(); - this.numericUpDownPartSpacing = new OpenNest.Controls.NumericUpDown(); - this.tableLayoutPanel1.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.bottomPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingLeft)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingTop)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingRight)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingBottom)).BeginInit(); + this.plateSettings = new OpenNest.Controls.PlateSettingsEditor(); + this.bottomPanel1 = new OpenNest.Controls.BottomPanel(); + this.applyButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownQty)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPartSpacing)).BeginInit(); + this.bottomPanel1.SuspendLayout(); this.SuspendLayout(); - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 2; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Controls.Add(this.labelQty, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.labelSize, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.textBoxSize, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.numericUpDownQty, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.labelPartSpacing, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.numericUpDownPartSpacing, 1, 2); - this.tableLayoutPanel1.Location = new System.Drawing.Point(18, 12); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(236, 108); - this.tableLayoutPanel1.TabIndex = 0; - // - // labelQty - // - this.labelQty.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelQty.AutoSize = true; - this.labelQty.Location = new System.Drawing.Point(3, 46); - this.labelQty.Name = "labelQty"; - this.labelQty.Size = new System.Drawing.Size(91, 16); - this.labelQty.TabIndex = 2; - this.labelQty.Text = "Quantity :"; - this.labelQty.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelSize - // - this.labelSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelSize.AutoSize = true; - this.labelSize.Location = new System.Drawing.Point(3, 10); - this.labelSize.Name = "labelSize"; - this.labelSize.Size = new System.Drawing.Size(91, 16); - this.labelSize.TabIndex = 0; - this.labelSize.Text = "Size :"; - this.labelSize.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // textBoxSize - // - this.textBoxSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxSize.Location = new System.Drawing.Point(100, 7); - this.textBoxSize.Name = "textBoxSize"; - this.textBoxSize.Size = new System.Drawing.Size(133, 22); - this.textBoxSize.TabIndex = 1; - this.textBoxSize.TextChanged += new System.EventHandler(this.textBox1_TextChanged); // - // labelPartSpacing - // - this.labelPartSpacing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelPartSpacing.AutoSize = true; - this.labelPartSpacing.Location = new System.Drawing.Point(3, 118); - this.labelPartSpacing.Name = "labelPartSpacing"; - this.labelPartSpacing.Size = new System.Drawing.Size(91, 16); - this.labelPartSpacing.TabIndex = 6; - this.labelPartSpacing.Text = "Part Spacing :"; - this.labelPartSpacing.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.tableLayoutPanel2); - this.groupBox1.Location = new System.Drawing.Point(12, 173); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(248, 175); - this.groupBox1.TabIndex = 1; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Edge Spacing"; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingLeft, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingTop, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingRight, 0, 2); - this.tableLayoutPanel2.Controls.Add(this.labelEdgeSpacingBottom, 0, 3); - this.tableLayoutPanel2.Controls.Add(this.numericUpDownEdgeSpacingLeft, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.numericUpDownEdgeSpacingTop, 1, 1); - this.tableLayoutPanel2.Controls.Add(this.numericUpDownEdgeSpacingRight, 1, 2); - this.tableLayoutPanel2.Controls.Add(this.numericUpDownEdgeSpacingBottom, 1, 3); - this.tableLayoutPanel2.Location = new System.Drawing.Point(6, 21); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 4; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(236, 148); - this.tableLayoutPanel2.TabIndex = 0; - // - // labelEdgeSpacingLeft - // - this.labelEdgeSpacingLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingLeft.AutoSize = true; - this.labelEdgeSpacingLeft.Location = new System.Drawing.Point(3, 10); - this.labelEdgeSpacingLeft.Name = "labelEdgeSpacingLeft"; - this.labelEdgeSpacingLeft.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingLeft.TabIndex = 0; - this.labelEdgeSpacingLeft.Text = "Left :"; - this.labelEdgeSpacingLeft.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelEdgeSpacingTop - // - this.labelEdgeSpacingTop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingTop.AutoSize = true; - this.labelEdgeSpacingTop.Location = new System.Drawing.Point(3, 47); - this.labelEdgeSpacingTop.Name = "labelEdgeSpacingTop"; - this.labelEdgeSpacingTop.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingTop.TabIndex = 2; - this.labelEdgeSpacingTop.Text = "Top :"; - this.labelEdgeSpacingTop.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelEdgeSpacingRight - // - this.labelEdgeSpacingRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingRight.AutoSize = true; - this.labelEdgeSpacingRight.Location = new System.Drawing.Point(3, 84); - this.labelEdgeSpacingRight.Name = "labelEdgeSpacingRight"; - this.labelEdgeSpacingRight.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingRight.TabIndex = 4; - this.labelEdgeSpacingRight.Text = "Right :"; - this.labelEdgeSpacingRight.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelEdgeSpacingBottom - // - this.labelEdgeSpacingBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.labelEdgeSpacingBottom.AutoSize = true; - this.labelEdgeSpacingBottom.Location = new System.Drawing.Point(3, 121); - this.labelEdgeSpacingBottom.Name = "labelEdgeSpacingBottom"; - this.labelEdgeSpacingBottom.Size = new System.Drawing.Size(56, 16); - this.labelEdgeSpacingBottom.TabIndex = 6; - this.labelEdgeSpacingBottom.Text = "Bottom :"; - this.labelEdgeSpacingBottom.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // groupBox2 - // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox2.Controls.Add(this.quadrantSelect1); - this.groupBox2.Location = new System.Drawing.Point(277, 12); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(261, 209); - this.groupBox2.TabIndex = 6; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Quadrant"; - // - // applyButton - // - this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.applyButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.applyButton.Enabled = false; - this.applyButton.Location = new System.Drawing.Point(352, 11); - this.applyButton.Name = "applyButton"; - this.applyButton.Size = new System.Drawing.Size(90, 28); - this.applyButton.TabIndex = 3; - this.applyButton.Text = "Done"; - this.applyButton.UseVisualStyleBackColor = true; - this.applyButton.Click += new System.EventHandler(this.button1_Click); - // - // cancelButton - // - this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(448, 11); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(90, 28); - this.cancelButton.TabIndex = 4; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // bottomPanel1 - // - this.bottomPanel1.Controls.Add(this.applyButton); - this.bottomPanel1.Controls.Add(this.cancelButton); - this.bottomPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.bottomPanel1.Location = new System.Drawing.Point(0, 359); - this.bottomPanel1.Name = "bottomPanel1"; - this.bottomPanel1.Size = new System.Drawing.Size(550, 50); - this.bottomPanel1.TabIndex = 7; - // + // labelQty + // + this.labelQty.AutoSize = true; + this.labelQty.Location = new System.Drawing.Point(15, 19); + this.labelQty.Name = "labelQty"; + this.labelQty.TabIndex = 0; + this.labelQty.Text = "Quantity :"; + // + // numericUpDownQty + // + this.numericUpDownQty.Location = new System.Drawing.Point(119, 16); + this.numericUpDownQty.Name = "numericUpDownQty"; + this.numericUpDownQty.Size = new System.Drawing.Size(154, 22); + this.numericUpDownQty.Suffix = ""; + this.numericUpDownQty.TabIndex = 1; + // // labelOutline - // - this.labelOutline.AutoSize = true; - this.labelOutline.Location = new System.Drawing.Point(21, 131); + // + this.labelOutline.AutoEllipsis = true; + this.labelOutline.Location = new System.Drawing.Point(294, 19); this.labelOutline.Name = "labelOutline"; - this.labelOutline.Size = new System.Drawing.Size(103, 16); - this.labelOutline.TabIndex = 8; + this.labelOutline.Size = new System.Drawing.Size(132, 18); + this.labelOutline.TabIndex = 2; this.labelOutline.Text = "Rectangular sheet"; - // + // // buttonImportOutline - // - this.buttonImportOutline.Location = new System.Drawing.Point(130, 125); + // + this.buttonImportOutline.Location = new System.Drawing.Point(430, 13); this.buttonImportOutline.Name = "buttonImportOutline"; - this.buttonImportOutline.Size = new System.Drawing.Size(70, 28); - this.buttonImportOutline.TabIndex = 9; + this.buttonImportOutline.Size = new System.Drawing.Size(72, 28); + this.buttonImportOutline.TabIndex = 3; this.buttonImportOutline.Text = "Outline..."; this.buttonImportOutline.UseVisualStyleBackColor = true; this.buttonImportOutline.Click += new System.EventHandler(this.buttonImportOutline_Click); - // + // // buttonClearOutline - // + // this.buttonClearOutline.Enabled = false; - this.buttonClearOutline.Location = new System.Drawing.Point(204, 125); + this.buttonClearOutline.Location = new System.Drawing.Point(506, 13); this.buttonClearOutline.Name = "buttonClearOutline"; this.buttonClearOutline.Size = new System.Drawing.Size(56, 28); - this.buttonClearOutline.TabIndex = 10; + this.buttonClearOutline.TabIndex = 4; this.buttonClearOutline.Text = "Clear"; this.buttonClearOutline.UseVisualStyleBackColor = true; this.buttonClearOutline.Click += new System.EventHandler(this.buttonClearOutline_Click); - // - // quadrantSelect1 - // - this.quadrantSelect1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.quadrantSelect1.Location = new System.Drawing.Point(6, 19); - this.quadrantSelect1.Name = "quadrantSelect1"; - this.quadrantSelect1.Quadrant = 1; - this.quadrantSelect1.Size = new System.Drawing.Size(249, 184); - this.quadrantSelect1.TabIndex = 5; - this.quadrantSelect1.Text = "quadrantSelect1"; - // - // numericUpDownEdgeSpacingLeft - // - this.numericUpDownEdgeSpacingLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.numericUpDownEdgeSpacingLeft.DecimalPlaces = 4; - this.numericUpDownEdgeSpacingLeft.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.numericUpDownEdgeSpacingLeft.Location = new System.Drawing.Point(65, 7); - this.numericUpDownEdgeSpacingLeft.Name = "numericUpDownEdgeSpacingLeft"; - this.numericUpDownEdgeSpacingLeft.Size = new System.Drawing.Size(168, 22); - this.numericUpDownEdgeSpacingLeft.Suffix = ""; - this.numericUpDownEdgeSpacingLeft.TabIndex = 1; - this.numericUpDownEdgeSpacingLeft.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); - // - // numericUpDownEdgeSpacingTop - // - this.numericUpDownEdgeSpacingTop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.numericUpDownEdgeSpacingTop.DecimalPlaces = 4; - this.numericUpDownEdgeSpacingTop.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.numericUpDownEdgeSpacingTop.Location = new System.Drawing.Point(65, 44); - this.numericUpDownEdgeSpacingTop.Name = "numericUpDownEdgeSpacingTop"; - this.numericUpDownEdgeSpacingTop.Size = new System.Drawing.Size(168, 22); - this.numericUpDownEdgeSpacingTop.Suffix = ""; - this.numericUpDownEdgeSpacingTop.TabIndex = 3; - this.numericUpDownEdgeSpacingTop.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); - // - // numericUpDownEdgeSpacingRight - // - this.numericUpDownEdgeSpacingRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.numericUpDownEdgeSpacingRight.DecimalPlaces = 4; - this.numericUpDownEdgeSpacingRight.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.numericUpDownEdgeSpacingRight.Location = new System.Drawing.Point(65, 81); - this.numericUpDownEdgeSpacingRight.Name = "numericUpDownEdgeSpacingRight"; - this.numericUpDownEdgeSpacingRight.Size = new System.Drawing.Size(168, 22); - this.numericUpDownEdgeSpacingRight.Suffix = ""; - this.numericUpDownEdgeSpacingRight.TabIndex = 5; - this.numericUpDownEdgeSpacingRight.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); - // - // numericUpDownEdgeSpacingBottom - // - this.numericUpDownEdgeSpacingBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.numericUpDownEdgeSpacingBottom.DecimalPlaces = 4; - this.numericUpDownEdgeSpacingBottom.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.numericUpDownEdgeSpacingBottom.Location = new System.Drawing.Point(65, 118); - this.numericUpDownEdgeSpacingBottom.Name = "numericUpDownEdgeSpacingBottom"; - this.numericUpDownEdgeSpacingBottom.Size = new System.Drawing.Size(168, 22); - this.numericUpDownEdgeSpacingBottom.Suffix = ""; - this.numericUpDownEdgeSpacingBottom.TabIndex = 7; - this.numericUpDownEdgeSpacingBottom.ValueChanged += new System.EventHandler(this.spacing_ValueChanged); - // - // numericUpDownQty - // - this.numericUpDownQty.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.numericUpDownQty.Location = new System.Drawing.Point(100, 43); - this.numericUpDownQty.Name = "numericUpDownQty"; - this.numericUpDownQty.Size = new System.Drawing.Size(133, 22); - this.numericUpDownQty.Suffix = ""; - this.numericUpDownQty.TabIndex = 3; // - // numericUpDownPartSpacing - // - this.numericUpDownPartSpacing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.numericUpDownPartSpacing.DecimalPlaces = 4; - this.numericUpDownPartSpacing.Increment = new decimal(new int[] { - 25, - 0, - 0, - 131072}); - this.numericUpDownPartSpacing.Location = new System.Drawing.Point(100, 115); - this.numericUpDownPartSpacing.Name = "numericUpDownPartSpacing"; - this.numericUpDownPartSpacing.Size = new System.Drawing.Size(133, 22); - this.numericUpDownPartSpacing.Suffix = ""; - this.numericUpDownPartSpacing.TabIndex = 7; - // + // plateSettings + // + this.plateSettings.Location = new System.Drawing.Point(12, 50); + this.plateSettings.Name = "plateSettings"; + this.plateSettings.Size = new System.Drawing.Size(550, 236); + this.plateSettings.TabIndex = 5; + this.plateSettings.SizeTextChanged += new System.EventHandler(this.plateSettings_SizeTextChanged); + this.plateSettings.SpacingChanged += new System.EventHandler(this.spacing_ValueChanged); + // + // bottomPanel1 + // + this.bottomPanel1.Controls.Add(this.applyButton); + this.bottomPanel1.Controls.Add(this.cancelButton); + this.bottomPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.bottomPanel1.Location = new System.Drawing.Point(0, 298); + this.bottomPanel1.Name = "bottomPanel1"; + this.bottomPanel1.Size = new System.Drawing.Size(574, 50); + this.bottomPanel1.TabIndex = 6; + // + // applyButton + // + this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.applyButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.applyButton.Enabled = false; + this.applyButton.Location = new System.Drawing.Point(376, 11); + this.applyButton.Name = "applyButton"; + this.applyButton.Size = new System.Drawing.Size(90, 28); + this.applyButton.TabIndex = 0; + this.applyButton.Text = "Done"; + this.applyButton.UseVisualStyleBackColor = true; + this.applyButton.Click += new System.EventHandler(this.button1_Click); + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(472, 11); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(90, 28); + this.cancelButton.TabIndex = 1; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // // EditPlateForm - // + // this.AcceptButton = this.applyButton; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(550, 409); - this.Controls.Add(this.bottomPanel1); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.tableLayoutPanel1); + this.ClientSize = new System.Drawing.Size(574, 348); + this.Controls.Add(this.labelQty); + this.Controls.Add(this.numericUpDownQty); this.Controls.Add(this.labelOutline); this.Controls.Add(this.buttonImportOutline); this.Controls.Add(this.buttonClearOutline); + this.Controls.Add(this.plateSettings); + this.Controls.Add(this.bottomPanel1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; @@ -406,49 +152,23 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Edit Plate"; - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - this.groupBox1.ResumeLayout(false); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.bottomPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingLeft)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingTop)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingRight)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownEdgeSpacingBottom)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownQty)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPartSpacing)).EndInit(); + this.bottomPanel1.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Label labelSize; - private System.Windows.Forms.Button applyButton; + private System.Windows.Forms.Label labelQty; + private OpenNest.Controls.NumericUpDown numericUpDownQty; private System.Windows.Forms.Label labelOutline; private System.Windows.Forms.Button buttonImportOutline; private System.Windows.Forms.Button buttonClearOutline; - private System.Windows.Forms.TextBox textBoxSize; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.Label labelEdgeSpacingLeft; - private System.Windows.Forms.Label labelEdgeSpacingTop; - private System.Windows.Forms.Label labelEdgeSpacingRight; - private System.Windows.Forms.Label labelEdgeSpacingBottom; - private Controls.NumericUpDown numericUpDownEdgeSpacingLeft; - private Controls.NumericUpDown numericUpDownEdgeSpacingTop; - private Controls.NumericUpDown numericUpDownEdgeSpacingRight; - private Controls.NumericUpDown numericUpDownEdgeSpacingBottom; + private OpenNest.Controls.PlateSettingsEditor plateSettings; + private OpenNest.Controls.BottomPanel bottomPanel1; + private System.Windows.Forms.Button applyButton; private System.Windows.Forms.Button cancelButton; - private System.Windows.Forms.Label labelQty; - private Controls.NumericUpDown numericUpDownQty; - private Controls.QuadrantSelect quadrantSelect1; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.Label labelPartSpacing; - private Controls.NumericUpDown numericUpDownPartSpacing; - private Controls.BottomPanel bottomPanel1; } -} \ No newline at end of file +} diff --git a/OpenNest/Forms/EditPlateForm.cs b/OpenNest/Forms/EditPlateForm.cs index 041f26f9..deb63a68 100644 --- a/OpenNest/Forms/EditPlateForm.cs +++ b/OpenNest/Forms/EditPlateForm.cs @@ -52,62 +52,42 @@ namespace OpenNest.Forms } } - private void SetUnits(Units units) - { - string suffix = " " + UnitsHelper.GetShortString(units); - var increment = (decimal)PlateEditValues.SpacingIncrement(units); - - var controls = new[] - { - numericUpDownPartSpacing, - numericUpDownEdgeSpacingBottom, - numericUpDownEdgeSpacingLeft, - numericUpDownEdgeSpacingRight, - numericUpDownEdgeSpacingTop, - }; - - foreach (var control in controls) - { - control.Suffix = suffix; - control.Increment = increment; - control.Invalidate(true); - } - } + private void SetUnits(Units units) => plateSettings.Units = units; public string SizeString { - get { return textBoxSize.Text; } - set { textBoxSize.Text = value; } + get { return plateSettings.SizeText; } + set { plateSettings.SizeText = value; } } public double LeftSpacing { - get { return (double)numericUpDownEdgeSpacingLeft.Value; } - set { numericUpDownEdgeSpacingLeft.Value = (decimal)value; } + get { return plateSettings.LeftSpacing; } + set { plateSettings.LeftSpacing = value; } } public double TopSpacing { - get { return (double)numericUpDownEdgeSpacingTop.Value; } - set { numericUpDownEdgeSpacingTop.Value = (decimal)value; } + get { return plateSettings.TopSpacing; } + set { plateSettings.TopSpacing = value; } } public double RightSpacing { - get { return (double)numericUpDownEdgeSpacingRight.Value; } - set { numericUpDownEdgeSpacingRight.Value = (decimal)value; } + get { return plateSettings.RightSpacing; } + set { plateSettings.RightSpacing = value; } } public double BottomSpacing { - get { return (double)numericUpDownEdgeSpacingBottom.Value; } - set { numericUpDownEdgeSpacingBottom.Value = (decimal)value; } + get { return plateSettings.BottomSpacing; } + set { plateSettings.BottomSpacing = value; } } public double PartSpacing { - get { return (double)numericUpDownPartSpacing.Value; } - set { numericUpDownPartSpacing.Value = (decimal)value; } + get { return plateSettings.PartSpacing; } + set { plateSettings.PartSpacing = value; } } public int Quantity @@ -118,8 +98,8 @@ namespace OpenNest.Forms public int Quadrant { - get { return quadrantSelect1.Quadrant; } - set { quadrantSelect1.Quadrant = value; } + get { return plateSettings.Quadrant; } + set { plateSettings.Quadrant = value; } } /// @@ -133,10 +113,10 @@ namespace OpenNest.Forms set { outline = value; - textBoxSize.ReadOnly = value != null; + plateSettings.SizeReadOnly = value != null; buttonClearOutline.Enabled = value != null; if (value != null) - textBoxSize.Text = value.Size.ToString(4); + plateSettings.SizeText = value.Size.ToString(4); labelOutline.Text = PlateEditValues.OutlineText(value); EnableCheck(); } @@ -160,7 +140,7 @@ namespace OpenNest.Forms private new void Load(Plate plate) { var values = PlateEditValues.FromPlate(plate); - textBoxSize.Text = values.Size.ToString(); + plateSettings.SizeText = values.Size.ToString(); LeftSpacing = values.LeftSpacing; TopSpacing = values.TopSpacing; RightSpacing = values.RightSpacing; @@ -178,7 +158,7 @@ namespace OpenNest.Forms private void Save() => (Values with { Size = Outline?.Size ?? OpenNest.Geometry.Size.Parse(SizeString) }).ApplyTo(plate); - private void textBox1_TextChanged(object sender, EventArgs e) + private void plateSettings_SizeTextChanged(object sender, EventArgs e) { timer.Stop(); timer.Start(); diff --git a/docs/nest-storage.md b/docs/nest-storage.md index f5ff5ebf..b326ba69 100644 --- a/docs/nest-storage.md +++ b/docs/nest-storage.md @@ -1134,10 +1134,11 @@ The Open list's Thickness column shows the name with the decimal in parentheses, "10 ga (0.135)", still sorting by the decimal. A record without a name is named for display only (`ThicknessNames`): the first machine configuration that names its material and thickness, otherwise the nearest standard steel gauge or plate fraction -within 0.001 in, so 0.135 reads as 10 ga and 0.188 as 3/16". Nest Information has a -**Thickness name** box that fills in the same way (a picked list entry names itself, -the nest's own machine is asked first); a new thickness replaces the name, a new -material only a blank or suggested one, and a typed name is kept. +within 0.001 in, so 0.135 reads as 10 ga and 0.188 as 3/16". Edit Nest shows the +thickness as its bare decimal with a **Name** box beside it that fills in the same way +(a picked list entry names itself, the nest's own machine is asked first); a new +thickness replaces the name, a new material only a blank or suggested one, and a typed +name is kept. ## Material list endpoints