Highlight completely nested parts.

This commit is contained in:
AJ
2021-05-18 09:21:33 -04:00
parent 4bb092e0e5
commit 8367d9f400
2 changed files with 11 additions and 2 deletions
+5 -1
View File
@@ -8,7 +8,11 @@
public int Remaining public int Remaining
{ {
get { return Required - Nested; } get
{
var x = Required - Nested;
return x < 0 ? 0: x;
}
} }
} }
} }
+6 -1
View File
@@ -27,6 +27,8 @@ namespace OpenNest.Controls
public Units Units { get; set; } public Units Units { get; set; }
public bool HideDepletedParts { get; set; }
protected override void OnDrawItem(DrawItemEventArgs e) protected override void OnDrawItem(DrawItemEventArgs e)
{ {
if (e.Index >= Items.Count || e.Index <= -1) if (e.Index >= Items.Count || e.Index <= -1)
@@ -37,7 +39,10 @@ namespace OpenNest.Controls
if (dwg == null) if (dwg == null)
return; return;
e.Graphics.FillRectangle(Brushes.White, e.Bounds); var isComplete = dwg.Quantity.Nested > 0 && dwg.Quantity.Remaining == 0;
var bgBrush = isComplete ? SystemBrushes.Info : Brushes.White;
e.Graphics.FillRectangle(bgBrush, e.Bounds);
var pt = new PointF(5, e.Bounds.Y + 5); var pt = new PointF(5, e.Bounds.Y + 5);