Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Conceição <Tiago_caza@hotmail.com>2020-10-05 05:22:15 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2020-10-05 05:22:15 +0300
commita52d6e3266f2864f75acb755af75e12cd5cafa0c (patch)
treec87776221e2f22aed4d5675dfce282797e84d4b0 /UVtools.GUI
parentcaed241b93a85c45d72431fe0b68f014f37bd8f2 (diff)
WPF progress
Diffstat (limited to 'UVtools.GUI')
-rw-r--r--UVtools.GUI/Controls/Tools/CtrlToolLayerClone.cs4
-rw-r--r--UVtools.GUI/Controls/Tools/CtrlToolLayerImport.cs14
-rw-r--r--UVtools.GUI/Controls/Tools/CtrlToolPixelDimming.resx2
-rw-r--r--UVtools.GUI/FrmMain.cs79
4 files changed, 49 insertions, 50 deletions
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolLayerClone.cs b/UVtools.GUI/Controls/Tools/CtrlToolLayerClone.cs
index 5486dc3..20d6ca1 100644
--- a/UVtools.GUI/Controls/Tools/CtrlToolLayerClone.cs
+++ b/UVtools.GUI/Controls/Tools/CtrlToolLayerClone.cs
@@ -35,8 +35,8 @@ namespace UVtools.GUI.Controls.Tools
{
uint extraLayers = (uint)Math.Max(0, (ParentToolWindow.nmLayerRangeEnd.Value - ParentToolWindow.nmLayerRangeStart.Value + 1) * nmClones.Value);
float extraHeight = (float)Math.Round(extraLayers * Program.SlicerFile.LayerHeight, 2);
- lbLayersCount.Text = $"Layers: {Program.SlicerFile.TotalHeight} → {Program.SlicerFile.TotalHeight + extraLayers} (+ {extraLayers})";
- lbHeights.Text = $"Heights: {Program.SlicerFile.TotalHeight}mm → {Program.SlicerFile.TotalHeight + extraHeight}mm (+ {extraHeight}mm)";
+ lbLayersCount.Text = $"Result layers: {Program.SlicerFile.LayerCount} → {Program.SlicerFile.LayerCount + extraLayers} (+ {extraLayers})";
+ lbHeights.Text = $"Result heights: {Program.SlicerFile.TotalHeight}mm → {Program.SlicerFile.TotalHeight + extraHeight}mm (+ {extraHeight}mm)";
}
public override bool UpdateOperation()
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolLayerImport.cs b/UVtools.GUI/Controls/Tools/CtrlToolLayerImport.cs
index 53090af..e900652 100644
--- a/UVtools.GUI/Controls/Tools/CtrlToolLayerImport.cs
+++ b/UVtools.GUI/Controls/Tools/CtrlToolLayerImport.cs
@@ -10,8 +10,6 @@ using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Drawing;
-using System.IO;
-using System.Text;
using System.Windows.Forms;
using UVtools.Core.Objects;
using UVtools.Core.Operations;
@@ -55,7 +53,7 @@ namespace UVtools.GUI.Controls.Tools
message.Content += "\nDo you want to remove all invalid files from list?";
if (MessageBoxError(message.ToString(), MessageBoxButtons.YesNo) == DialogResult.Yes)
{
- ConcurrentBag<string> result = (ConcurrentBag<string>)message.Tag;
+ ConcurrentBag<StringTag> result = (ConcurrentBag<StringTag>)message.Tag;
foreach (var file in result)
{
Operation.Files.Remove(file);
@@ -104,7 +102,10 @@ namespace UVtools.GUI.Controls.Tools
{
if (fileOpen.ShowDialog() != DialogResult.OK) return;
- Operation.Files.AddRange(fileOpen.FileNames);
+ foreach (var filename in fileOpen.FileNames)
+ {
+ Operation.AddFile(filename);
+ }
if (cbAutoSort.Checked)
{
@@ -121,7 +122,7 @@ namespace UVtools.GUI.Controls.Tools
{
foreach (StringTag selectedItem in lbFiles.SelectedItems)
{
- Operation.Files.Remove(selectedItem.TagString);
+ Operation.Files.Remove(selectedItem);
}
UpdateListBox();
@@ -189,8 +190,7 @@ namespace UVtools.GUI.Controls.Tools
foreach (var file in Operation.Files)
{
- var stringTag = new StringTag(Path.GetFileNameWithoutExtension(file), file);
- lbFiles.Items.Add(stringTag);
+ lbFiles.Items.Add(file);
}
ButtonOkEnabled = btnRemove.Enabled = btnSort.Enabled = btnClear.Enabled = Operation.Files.Count > 0;
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolPixelDimming.resx b/UVtools.GUI/Controls/Tools/CtrlToolPixelDimming.resx
index b4eb075..3cab13f 100644
--- a/UVtools.GUI/Controls/Tools/CtrlToolPixelDimming.resx
+++ b/UVtools.GUI/Controls/Tools/CtrlToolPixelDimming.resx
@@ -131,6 +131,6 @@ Enable the "Fade in/out" to fade the iteration over layers, you can use a start
WARNING: Using high iteration values can destroy your model depending on the mutator being used, please use low values or with caution!</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>25</value>
+ <value>121</value>
</metadata>
</root> \ No newline at end of file
diff --git a/UVtools.GUI/FrmMain.cs b/UVtools.GUI/FrmMain.cs
index 40d7353..6710c6d 100644
--- a/UVtools.GUI/FrmMain.cs
+++ b/UVtools.GUI/FrmMain.cs
@@ -2806,57 +2806,56 @@ namespace UVtools.GUI
// the cross cursor is displayed even before the pblayer control has focus.
// This ensures the user is aware that even in this case, a click in the layer
// preview will draw a pixel.
- if (ReferenceEquals(sender, this) && !ReferenceEquals(SlicerFile, null))
- {
- // This event repeats for as long as the key is pressed, so if we've
- // already set the cursor from a previous key down event, just return.
- if (!ReferenceEquals(pbLayer.Cursor.Tag, null) || pbLayer.Cursor == pixelEditCursor || pbLayer.Cursor == Cursors.Cross
- || pbLayer.Cursor == Cursors.Hand || pbLayer.SelectionMode == ImageBoxSelectionMode.Rectangle) return;
+ if (!ReferenceEquals(sender, this) || ReferenceEquals(SlicerFile, null)) return;
+
+ // This event repeats for as long as the key is pressed, so if we've
+ // already set the cursor from a previous key down event, just return.
+ if (!ReferenceEquals(pbLayer.Cursor.Tag, null) || pbLayer.Cursor == pixelEditCursor || pbLayer.Cursor == Cursors.Cross
+ || pbLayer.Cursor == Cursors.Hand || pbLayer.SelectionMode == ImageBoxSelectionMode.Rectangle) return;
- // Pixel Edit is active, Shift is down, and the cursor is over the image region.
- if (pbLayer.ClientRectangle.Contains(pbLayer.PointToClient(MousePosition)))
+ // Pixel Edit is active, Shift is down, and the cursor is over the image region.
+ if (pbLayer.ClientRectangle.Contains(pbLayer.PointToClient(MousePosition)))
+ {
+ if (e.Modifiers == Keys.Shift)
{
- if (e.Modifiers == Keys.Shift)
+ if (btnLayerImagePixelEdit.Checked)
{
- if (btnLayerImagePixelEdit.Checked)
- {
- pbLayer.PanMode = ImageBoxPanMode.None;
- lbLayerImageTooltipOverlay.Text = "Pixel editing is on:\n" +
- "» Click over a pixel to draw\n" +
- "» Hold CTRL to clear pixels";
-
- UpdatePixelEditorCursor();
- }
- else
- {
- pbLayer.Cursor = Cursors.Cross;
- pbLayer.SelectionMode = ImageBoxSelectionMode.Rectangle;
- lbLayerImageTooltipOverlay.Text = "ROI selection mode:\n" +
- "» Left-click drag to select a fixed region\n" +
- "» Left-click + ALT drag to select specific objects\n" +
- "» Right click on a specific object to select it\n" +
- "Press Esc to clear the ROI";
- }
-
- lbLayerImageTooltipOverlay.Visible = Settings.Default.LayerTooltipOverlay;
+ pbLayer.PanMode = ImageBoxPanMode.None;
+ lbLayerImageTooltipOverlay.Text = "Pixel editing is on:\n" +
+ "» Click over a pixel to draw\n" +
+ "» Hold CTRL to clear pixels";
- return;
+ UpdatePixelEditorCursor();
}
- if (e.Modifiers == Keys.Control)
+ else
{
- pbLayer.Cursor = Cursors.Hand;
- pbLayer.PanMode = ImageBoxPanMode.None;
- lbLayerImageTooltipOverlay.Text = "Issue selection mode:\n" +
- "» Click over an issue to select it";
+ pbLayer.Cursor = Cursors.Cross;
+ pbLayer.SelectionMode = ImageBoxSelectionMode.Rectangle;
+ lbLayerImageTooltipOverlay.Text = "ROI selection mode:\n" +
+ "» Left-click drag to select a fixed region\n" +
+ "» Left-click + ALT drag to select specific objects\n" +
+ "» Right click on a specific object to select it\n" +
+ "Press Esc to clear the ROI";
+ }
- lbLayerImageTooltipOverlay.Visible = Settings.Default.LayerTooltipOverlay;
+ lbLayerImageTooltipOverlay.Visible = Settings.Default.LayerTooltipOverlay;
- return;
- }
+ return;
}
+ if (e.Modifiers == Keys.Control)
+ {
+ pbLayer.Cursor = Cursors.Hand;
+ pbLayer.PanMode = ImageBoxPanMode.None;
+ lbLayerImageTooltipOverlay.Text = "Issue selection mode:\n" +
+ "» Click over an issue to select it";
- return;
+ lbLayerImageTooltipOverlay.Visible = Settings.Default.LayerTooltipOverlay;
+
+ return;
+ }
}
+
+ return;
}
private void EventKeyUp(object sender, KeyEventArgs e)