mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-29 02:41:33 -05:00
With every part drawn the same, it was hard to see which parts the drawn lines had not reached yet. Parts no line reaches are now drawn muted, and update live while dragging. Clicking a part adds it as a one-point line, so a stray part can be picked without drawing a line to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace OpenNest.Forms
|
|
{
|
|
public partial class SequenceByPathForm : Form
|
|
{
|
|
public SequenceByPathForm()
|
|
{
|
|
InitializeComponent();
|
|
SetLineCount(0);
|
|
}
|
|
|
|
public event EventHandler UndoClicked;
|
|
public event EventHandler ClearClicked;
|
|
public event EventHandler DoneClicked;
|
|
|
|
public void SetLineCount(int count)
|
|
{
|
|
statusLabel.Text = count == 0
|
|
? "Drag a line through the parts, or click them, in cut order."
|
|
: $"{count} line{(count == 1 ? "" : "s")}. Drag or click to add the next.";
|
|
undoButton.Enabled = count > 0;
|
|
clearButton.Enabled = count > 0;
|
|
}
|
|
|
|
private void undoButton_Click(object sender, EventArgs e) => UndoClicked?.Invoke(this, EventArgs.Empty);
|
|
|
|
private void clearButton_Click(object sender, EventArgs e) => ClearClicked?.Invoke(this, EventArgs.Empty);
|
|
|
|
private void doneButton_Click(object sender, EventArgs e) => DoneClicked?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|