From 401cc688d678b0623e6d8bf534c1906bffb93de1 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 19 Jan 2018 13:43:39 -0800 Subject: [PATCH 1/3] Make sure we can use the shift key to switch to pan --- PartPreviewWindow/View3D/View3DWidget.cs | 84 ++++++++++++------------ Submodules/agg-sharp | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index c6eda6f5d..e8a821dbc 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -968,6 +968,48 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } } + public override void OnMouseMove(MouseEventArgs mouseEvent) + { + // File system Drop validation + mouseEvent.AcceptDrop = this.AllowDragDrop() + && mouseEvent.DragFiles?.Count > 0 + && mouseEvent.DragFiles.TrueForAll(filePath => ApplicationController.Instance.IsLoadableFile(filePath)); + + // View3DWidgets Filesystem DropDrop handler + if (mouseEvent.AcceptDrop + && this.PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y)) + { + if (this.DragOperationActive) + { + DragOver(screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position)); + } + else + { + // Project DragFiles to IEnumerable + this.StartDragDrop( + mouseEvent.DragFiles.Select(path => new FileSystemFileItem(path)), + screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position), + trackSourceFiles: true); + } + } + + if (CurrentSelectInfo.DownOnPart && this.TrackballTumbleWidget.TransformState == TrackBallController.MouseDownType.None) + { + DragSelectedObject(new Vector2(mouseEvent.X, mouseEvent.Y)); + } + + if (DragSelectionInProgress) + { + DragSelectionEndPosition = mouseEvent.Position - OffsetToMeshViewerWidget(); + DragSelectionEndPosition = new Vector2( + Math.Max(Math.Min(DragSelectionEndPosition.X, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left), + Math.Max(Math.Min(DragSelectionEndPosition.Y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom)); + Invalidate(); + } + + base.OnMouseMove(mouseEvent); + } + public IntersectInfo GetIntersectPosition(Vector2 screenSpacePosition) { //Vector2 meshViewerWidgetScreenPosition = meshViewerWidget.TransformFromParentSpace(this, new Vector2(mouseEvent.X, mouseEvent.Y)); @@ -1058,48 +1100,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } } - public override void OnMouseMove(MouseEventArgs mouseEvent) - { - // File system Drop validation - mouseEvent.AcceptDrop = this.AllowDragDrop() - && mouseEvent.DragFiles?.Count > 0 - && mouseEvent.DragFiles.TrueForAll(filePath => ApplicationController.Instance.IsLoadableFile(filePath)); - - // View3DWidgets Filesystem DropDrop handler - if (mouseEvent.AcceptDrop - && this.PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y)) - { - if (this.DragOperationActive) - { - DragOver(screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position)); - } - else - { - // Project DragFiles to IEnumerable - this.StartDragDrop( - mouseEvent.DragFiles.Select(path => new FileSystemFileItem(path)), - screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position), - trackSourceFiles: true); - } - } - - if (CurrentSelectInfo.DownOnPart && this.TrackballTumbleWidget.TransformState == TrackBallController.MouseDownType.None) - { - DragSelectedObject(new Vector2(mouseEvent.X, mouseEvent.Y)); - } - - if (DragSelectionInProgress) - { - DragSelectionEndPosition = mouseEvent.Position - OffsetToMeshViewerWidget(); - DragSelectionEndPosition = new Vector2( - Math.Max(Math.Min(DragSelectionEndPosition.X, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left), - Math.Max(Math.Min(DragSelectionEndPosition.Y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom)); - Invalidate(); - } - - base.OnMouseMove(mouseEvent); - } - Vector2 OffsetToMeshViewerWidget() { List parents = new List(); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 9b89cd664..7fd54159b 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 9b89cd664f4d642229459fa9e86d6c8aa201e5d4 +Subproject commit 7fd54159b5795c89203a516fe551347f5708a831 From 6edd906af0476815d64711cbd497d9b97b29d6c6 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 19 Jan 2018 16:19:16 -0800 Subject: [PATCH 2/3] Working a bit on load unload --- StaticData/SliceSettings/Layouts.txt | 2 +- StaticData/SliceSettings/Properties.json | 4 ++-- StaticData/SliceSettings/load_filament.txt | 1 + StaticData/SliceSettings/unload_filament.txt | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/StaticData/SliceSettings/Layouts.txt b/StaticData/SliceSettings/Layouts.txt index 5d67256f1..e0e51a197 100644 --- a/StaticData/SliceSettings/Layouts.txt +++ b/StaticData/SliceSettings/Layouts.txt @@ -198,11 +198,11 @@ Printer Material Loading Loading load_filament_length + unload_filament_length load_filament_speed trim_image insert_image running_clean_image - unload_filament_length G-Code G-Code G-Code diff --git a/StaticData/SliceSettings/Properties.json b/StaticData/SliceSettings/Properties.json index 12b3aefc9..59e513565 100644 --- a/StaticData/SliceSettings/Properties.json +++ b/StaticData/SliceSettings/Properties.json @@ -44,8 +44,8 @@ }, { "SlicerConfigName": "load_filament_speed", - "PresentationName": "Load Filament Speed", - "HelpText": "The speed to run filament into the printer when loading.", + "PresentationName": "Filament Speed", + "HelpText": "The speed to run filament into and out of the printer.", "DataEditType": "POSITIVE_DOUBLE", "Units": "mm/s", "ShowIfSet": "!sla_printer", diff --git a/StaticData/SliceSettings/load_filament.txt b/StaticData/SliceSettings/load_filament.txt index 7edf5d829..ea8b7d06c 100644 --- a/StaticData/SliceSettings/load_filament.txt +++ b/StaticData/SliceSettings/load_filament.txt @@ -1,5 +1,6 @@ ; host.choose_material(title:"Choose the material that you are loading.") +M106 S0 ; turn off the fan M104 S[temperature] ; start heating up the extruder ; host.show_message(title:"Trim the end of the filament to ensure a good load.", image:"[trim_image]", wait_ok:"true") diff --git a/StaticData/SliceSettings/unload_filament.txt b/StaticData/SliceSettings/unload_filament.txt index 7f890b6e5..ff16fa970 100644 --- a/StaticData/SliceSettings/unload_filament.txt +++ b/StaticData/SliceSettings/unload_filament.txt @@ -1,6 +1,7 @@ ; host.choose_material(title:"Confirm the material you are unloading.") ; host.show_message(title:"Waiting for extruder to heat to [temperature], before unloading.") +M106 S0 ; turn off the fan G4 S1 ; wait message to display M109 S[temperature] ; heat up the extruder From c809aaf0d1500f77d205cd3f183bb5222037a61b Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 19 Jan 2018 17:19:20 -0800 Subject: [PATCH 3/3] Make sure we draw black text on this control --- PrinterControls/MacroListPage.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PrinterControls/MacroListPage.cs b/PrinterControls/MacroListPage.cs index 5fb7ed21c..6eeb1a19d 100644 --- a/PrinterControls/MacroListPage.cs +++ b/PrinterControls/MacroListPage.cs @@ -90,6 +90,8 @@ namespace MatterHackers.MatterControl // We make a local variable to create a closure around it to ensure we get the correct instance var localMacroReference = macro; + var oldColor = linkButtonFactory.textColor; + linkButtonFactory.textColor = Color.Black; Button editLink = linkButtonFactory.Generate("edit".Localize()); editLink.Margin = new BorderDouble(right: 5); editLink.Click += (s, e) => @@ -106,6 +108,7 @@ namespace MatterHackers.MatterControl this.RebuildList(printerSettings, linkButtonFactory); }; macroRow.AddChild(removeLink); + linkButtonFactory.textColor = oldColor; contentRow.AddChild(macroRow); }