feat: move add/remove plate buttons to plate tab, sync remove state

Removed add and remove plate buttons from the plate header panel.
The plate tab toolbar now has add/remove buttons with the remove
button state driven by PlateManager.CanRemoveCurrent. MainForm's
Plate > Remove menu item also syncs on plate change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 00:12:59 -04:00
parent ede06b1bf6
commit d65f3460a9
8 changed files with 123 additions and 71 deletions
+44 -8
View File
@@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditNestForm));
splitContainer = new System.Windows.Forms.SplitContainer();
tabControl1 = new System.Windows.Forms.TabControl();
@@ -39,6 +40,9 @@
partsColumn = new System.Windows.Forms.ColumnHeader();
utilColumn = new System.Windows.Forms.ColumnHeader();
toolStrip1 = new System.Windows.Forms.ToolStrip();
toolStripLabel1 = new System.Windows.Forms.ToolStripButton();
toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
toolStripLabel2 = new System.Windows.Forms.ToolStripButton();
tabPage2 = new System.Windows.Forms.TabPage();
drawingListBox1 = new OpenNest.Controls.DrawingListBox();
toolStrip2 = new System.Windows.Forms.ToolStrip();
@@ -52,6 +56,7 @@
splitContainer.SuspendLayout();
tabControl1.SuspendLayout();
tabPage1.SuspendLayout();
toolStrip1.SuspendLayout();
tabPage2.SuspendLayout();
toolStrip2.SuspendLayout();
SuspendLayout();
@@ -107,11 +112,11 @@
platesListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
platesListView.FullRowSelect = true;
platesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
platesListView.Location = new System.Drawing.Point(4, 28);
platesListView.Location = new System.Drawing.Point(4, 30);
platesListView.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
platesListView.MultiSelect = false;
platesListView.Name = "platesListView";
platesListView.Size = new System.Drawing.Size(265, 396);
platesListView.Size = new System.Drawing.Size(265, 394);
platesListView.TabIndex = 1;
platesListView.UseCompatibleStateImageBehavior = false;
platesListView.View = System.Windows.Forms.View.Details;
@@ -128,16 +133,16 @@
sizeColumn.Width = 80;
//
// qtyColumn
//
//
qtyColumn.Text = "Qty";
//
//
// partsColumn
//
//
partsColumn.Text = "Parts";
partsColumn.Width = 45;
//
//
// utilColumn
//
//
utilColumn.Text = "Util";
utilColumn.Width = 45;
//
@@ -145,12 +150,38 @@
//
toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripLabel1, toolStripSeparator3, toolStripLabel2 });
toolStrip1.Location = new System.Drawing.Point(4, 3);
toolStrip1.Name = "toolStrip1";
toolStrip1.Size = new System.Drawing.Size(265, 25);
toolStrip1.Size = new System.Drawing.Size(265, 27);
toolStrip1.TabIndex = 2;
toolStrip1.Text = "toolStrip1";
//
// toolStripLabel1
//
toolStripLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
toolStripLabel1.Image = Properties.Resources.plus;
toolStripLabel1.Name = "toolStripLabel1";
toolStripLabel1.Padding = new System.Windows.Forms.Padding(5, 0, 5, 0);
toolStripLabel1.Size = new System.Drawing.Size(34, 24);
toolStripLabel1.Text = "Remove Selected Plate";
toolStripLabel1.Click += toolStripLabel1_Click;
//
// toolStripSeparator3
//
toolStripSeparator3.Name = "toolStripSeparator3";
toolStripSeparator3.Size = new System.Drawing.Size(6, 27);
//
// toolStripLabel2
//
toolStripLabel2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
toolStripLabel2.Image = Properties.Resources.delete;
toolStripLabel2.Name = "toolStripLabel2";
toolStripLabel2.Padding = new System.Windows.Forms.Padding(5, 0, 5, 0);
toolStripLabel2.Size = new System.Drawing.Size(34, 24);
toolStripLabel2.Text = "Remove Selected";
toolStripLabel2.Click += toolStripLabel2_Click;
//
// tabPage2
//
tabPage2.Controls.Add(drawingListBox1);
@@ -255,6 +286,8 @@
tabControl1.ResumeLayout(false);
tabPage1.ResumeLayout(false);
tabPage1.PerformLayout();
toolStrip1.ResumeLayout(false);
toolStrip1.PerformLayout();
tabPage2.ResumeLayout(false);
tabPage2.PerformLayout();
toolStrip2.ResumeLayout(false);
@@ -283,5 +316,8 @@
private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripButton hideNestedButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripButton toolStripLabel1;
private System.Windows.Forms.ToolStripButton toolStripLabel2;
}
}