From ae80f25b83cd1a5ed71a2e9b7a13913080eff8db Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Mon, 13 Jun 2022 09:16:50 -0700 Subject: [PATCH 1/4] fixing typo --- .../CalibrateProbeRemovePaperInstructions.cs | 2 +- StaticData/Translations/Master.txt | 78 +++++++++++++++++++ Submodules/agg-sharp | 2 +- 3 files changed, 80 insertions(+), 2 deletions(-) diff --git a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/CalibrateProbeRemovePaperInstructions.cs b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/CalibrateProbeRemovePaperInstructions.cs index da5869929..c721a342f 100644 --- a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/CalibrateProbeRemovePaperInstructions.cs +++ b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/CalibrateProbeRemovePaperInstructions.cs @@ -122,7 +122,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling completedText += "\n\n • " + "Remove the bed from the printer so the nozzle can get low enough to touch the pad".Localize(); } - completedText += "\n • " + "Ensure the nozzle is clear of any debri or filament".Localize(); + completedText += "\n • " + "Ensure the nozzle is clear of any debris or filament".Localize(); completedText += "\n\n" + "Click 'Next' to continue.".Localize(); contentRow.AddChild(this.CreateTextField(completedText)); diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 98c224d7f..a366998b7 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -31,6 +31,15 @@ Translated:% English:(Press 'Skip' to setup connection later) Translated:(Press 'Skip' to setup connection later) +English:\"{0}\" already exists.\nDo you want to replace it? +Translated:\"{0}\" already exists.\nDo you want to replace it? + +English:\nBelow you can find a list of each setting that has changed. +Translated:\nBelow you can find a list of each setting that has changed. + +English:\nUpdating a default setting will not change any override that you have applied. +Translated:\nUpdating a default setting will not change any override that you have applied. + English:{0} (Update Available) Translated:{0} (Update Available) @@ -391,6 +400,9 @@ Translated:Are you sure you want to delete printer '{0}'? English:Are you sure you want to exit while a print is running from SD Card?\n\nNote: If you exit, it is recommended you wait until the print is completed before running MatterControl again. Translated:Are you sure you want to exit while a print is running from SD Card?\n\nNote: If you exit, it is recommended you wait until the print is completed before running MatterControl again. +English:Are you sure you want to exit while a print is running from SD Card?\n\nNote: If you exit, it is recommended you wait until the print is completed before running MatterControl again. +Translated:Are you sure you want to exit while a print is running from SD Card?\n\nNote: If you exit, it is recommended you wait until the print is completed before running MatterControl again. + English:Are you sure you want to remove the currently selected items? Translated:Are you sure you want to remove the currently selected items? @@ -1579,6 +1591,9 @@ Translated:Error: Could not create file for saving. Original error English:Error: Could not read file from disk. Original error: Translated:Error: Could not read file from disk. Original error: +English:Error: Could not read file from disk. Original error: +Translated:Error: Could not read file from disk. Original error: + English:Estimated Cost Translated:Estimated Cost @@ -1597,6 +1612,9 @@ Translated:Exit while printing English:Expand Translated:Expand +English:Expand All +Translated:Expand All + English:Expand Distance Translated:Expand Distance @@ -1951,6 +1969,9 @@ Translated:Forums English:Found a line that is {0} characters long.\n{1}... Translated:Found a line that is {0} characters long.\n{1}... +English:Found a line that is {0} characters long.\n{1}... +Translated:Found a line that is {0} characters long.\n{1}... + English:Furthest Back Translated:Furthest Back @@ -2074,6 +2095,9 @@ Translated:GRID English:Group Translated:Group +English:Group Setings +Translated:Group Setings + English:Guides and Articles Translated:Guides and Articles @@ -2173,6 +2197,9 @@ Translated:HEXAGON English:Hide Translated:Hide +English:Hide All +Translated:Hide All + English:High Precision Translated:High Precision @@ -2437,6 +2464,9 @@ Translated:IP Finder English:It appears your last print failed to complete.\n\nWould your like to attempt to recover from the last know position? Translated:It appears your last print failed to complete.\n\nWould your like to attempt to recover from the last know position? +English:It appears your last print failed to complete.\n\nWould your like to attempt to recover from the last know position? +Translated:It appears your last print failed to complete.\n\nWould your like to attempt to recover from the last know position? + English:It is currently set to {0}. Translated:It is currently set to {0}. @@ -3868,6 +3898,9 @@ Translated:Quality English:Quality Setting Translated:Quality Setting +English:Queue +Translated:Queue + English:Radial Array Translated:Radial Array @@ -4075,6 +4108,9 @@ Translated:Reset View English:Resetting to default values will remove your current overrides and restore your original printer settings.\nAre you sure you want to continue? Translated:Resetting to default values will remove your current overrides and restore your original printer settings.\nAre you sure you want to continue? +English:Resetting to default values will remove your current overrides and restore your original printer settings.\nAre you sure you want to continue? +Translated:Resetting to default values will remove your current overrides and restore your original printer settings.\nAre you sure you want to continue? + English:Reshape Translated:Reshape @@ -4369,6 +4405,9 @@ Translated:Select a new Destination English:Select a printer to continue Translated:Select a printer to continue +English:Select all +Translated:Select all + English:Select All Translated:Select All @@ -4909,6 +4948,12 @@ Translated:Success!\n\nYour filament should now be loaded English:Success!\n\nYour filament should now be unloaded Translated:Success!\n\nYour filament should now be unloaded +English:Success!\n\nYour filament should now be loaded +Translated:Success!\n\nYour filament should now be loaded + +English:Success!\n\nYour filament should now be unloaded +Translated:Success!\n\nYour filament should now be unloaded + English:Support Translated:Support @@ -5134,6 +5179,9 @@ Translated:The extra distance the raft will extend around the edge of the part. English:The extruder is currently heating and its target temperature cannot be changed until it reaches {0}°C.\n\nYou can set the starting extruder temperature in 'Slice Settings' -> 'Filament'.\n\n{1} Translated:The extruder is currently heating and its target temperature cannot be changed until it reaches {0}°C.\n\nYou can set the starting extruder temperature in 'Slice Settings' -> 'Filament'.\n\n{1} +English:The extruder is currently heating and its target temperature cannot be changed until it reaches {0}°C.\n\nYou can set the starting extruder temperature in 'Slice Settings' -> 'Filament'.\n\n{1} +Translated:The extruder is currently heating and its target temperature cannot be changed until it reaches {0}°C.\n\nYou can set the starting extruder temperature in 'Slice Settings' -> 'Filament'.\n\n{1} + English:The extruder to use for support material. Default will use whichever extruder active at the time. Translated:The extruder to use for support material. Default will use whichever extruder active at the time. @@ -5149,6 +5197,9 @@ Translated:The extruder to use to print the raft. Default will use extruder 1. English:The file you are attempting to print is a GCode file.\n\nIt is recommended that you only print Gcode files known to match your printer's configuration.\n\nAre you sure you want to print this GCode file? Translated:The file you are attempting to print is a GCode file.\n\nIt is recommended that you only print Gcode files known to match your printer's configuration.\n\nAre you sure you want to print this GCode file? +English:The file you are attempting to print is a GCode file.\n\nIt is recommended that you only print Gcode files known to match your printer's configuration.\n\nAre you sure you want to print this GCode file? +Translated:The file you are attempting to print is a GCode file.\n\nIt is recommended that you only print Gcode files known to match your printer's configuration.\n\nAre you sure you want to print this GCode file? + English:The firmware being used by the printer. Allows for improvements based on firmware such as optimized G-Code output. Translated:The firmware being used by the printer. Allows for improvements based on firmware such as optimized G-Code output. @@ -5170,6 +5221,9 @@ Translated:The ideal resistance is when the paper first begins to bend, but can English:The inset amount for each side of the bed.\n- As a % of the width or depth\n- Ordered: Left, Front, Right, Back\n- NOTE: The probe offset is added on top of this Translated:The inset amount for each side of the bed.\n- As a % of the width or depth\n- Ordered: Left, Front, Right, Back\n- NOTE: The probe offset is added on top of this +English:The inset amount for each side of the bed.\n- As a % of the width or depth\n- Ordered: Left, Front, Right, Back\n- NOTE: The probe offset is added on top of this +Translated:The inset amount for each side of the bed.\n- As a % of the width or depth\n- Ordered: Left, Front, Right, Back\n- NOTE: The probe offset is added on top of this + English:The inset amount for nozzle 1 from the bed (Left, Front, Right, Back). Translated:The inset amount for nozzle 1 from the bed (Left, Front, Right, Back). @@ -5188,6 +5242,9 @@ Translated:The layer(s) at which the print will pause, allowing for a change in English:The layer(s) at which the print will pause, allowing for a change in filament. Printer is paused before starting the given layer. Leave blank to disable. To pause on multiple layers, separate the layer numbers with semicolons. For example: \"16; 37\". Translated:The layer(s) at which the print will pause, allowing for a change in filament. Printer is paused before starting the given layer. Leave blank to disable. To pause on multiple layers, separate the layer numbers with semicolons. For example: \"16; 37\". +English:The layer(s) at which the print will pause, allowing for a change in filament. Printer is paused before starting the given layer. Leave blank to disable. To pause on multiple layers, separate the layer numbers with semicolons. For example: \"16; 37\". Rafts layers are not considered. The 1st pause layer is the first above the raft. +Translated:The layer(s) at which the print will pause, allowing for a change in filament. Printer is paused before starting the given layer. Leave blank to disable. To pause on multiple layers, separate the layer numbers with semicolons. For example: \"16; 37\". Rafts layers are not considered. The 1st pause layer is the first above the raft. + English:The length and width of a tower created at the back left of the print used for wiping the next nozzle when changing between multiple extruders. Set to 0 to disable. Translated:The length and width of a tower created at the back left of the print used for wiping the next nozzle when changing between multiple extruders. Set to 0 to disable. @@ -5416,6 +5473,9 @@ Translated:The serial port communication speed of the printers firmware. English:The 'Serial Port' section lists all available serial\nports on your device. Changing which USB port the printer\nis connected to may change the associated serial port.\n\nTip: If you are uncertain, unplug/plug in your printer\nand hit refresh. The new port that appears should be\nyour printer. Translated:The 'Serial Port' section lists all available serial\nports on your device. Changing which USB port the printer\nis connected to may change the associated serial port.\n\nTip: If you are uncertain, unplug/plug in your printer\nand hit refresh. The new port that appears should be\nyour printer. +English:The 'Serial Port' section lists all available serial\nports on your device. Changing which USB port the printer\nis connected to may change the associated serial port.\n\nTip: If you are uncertain, unplug/plug in your printer\nand hit refresh. The new port that appears should be\nyour printer. +Translated:The 'Serial Port' section lists all available serial\nports on your device. Changing which USB port the printer\nis connected to may change the associated serial port.\n\nTip: If you are uncertain, unplug/plug in your printer\nand hit refresh. The new port that appears should be\nyour printer. + English:The serial port to use while connecting to this printer. Translated:The serial port to use while connecting to this printer. @@ -5575,6 +5635,9 @@ Translated:The temperature to which the nozzle will be heated before printing th English:The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000. Translated:The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000. +English:The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000. +Translated:The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000. + English:The thickness of each layer of the print, except the base layers. A smaller number will create more layers and more vertical accuracy but also a slower print. Translated:The thickness of each layer of the print, except the base layers. A smaller number will create more layers and more vertical accuracy but also a slower print. @@ -6175,6 +6238,12 @@ Translated:Warning, very short print English:WARNING: Disconnecting will stop the current print.\n\nAre you sure you want to disconnect? Translated:WARNING: Disconnecting will stop the current print.\n\nAre you sure you want to disconnect? +English:WARNING: Disconnecting will stop the current print.\n\nAre you sure you want to disconnect? +Translated:WARNING: Disconnecting will stop the current print.\n\nAre you sure you want to disconnect? + +English:WARNING: In order to perform print recovery, your printer must move down to reach its home position.\nIf your print is too large, part of your printer may collide with it when moving down.\nMake sure it is safe to perform this operation before proceeding. +Translated:WARNING: In order to perform print recovery, your printer must move down to reach its home position.\nIf your print is too large, part of your printer may collide with it when moving down.\nMake sure it is safe to perform this operation before proceeding. + English:WARNING: In order to perform print recovery, your printer must move down to reach its home position.\nIf your print is too large, part of your printer may collide with it when moving down.\nMake sure it is safe to perform this operation before proceeding. Translated:WARNING: In order to perform print recovery, your printer must move down to reach its home position.\nIf your print is too large, part of your printer may collide with it when moving down.\nMake sure it is safe to perform this operation before proceeding. @@ -6328,6 +6397,9 @@ Translated:You are connected to the Emulator not an actual printer. English:You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now? Translated:You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now? +English:You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now? +Translated:You are switching to a different thumbnail rendering mode. If you want, your current thumbnails can be removed and recreated in the new style. You can switch back and forth at any time. There will be some processing overhead while the new thumbnails are created.\n\nDo you want to rebuild your existing thumbnails now? + English:You can also Translated:You can also @@ -6379,6 +6451,12 @@ Translated:You should select the 'Material' your are printing with under the 'Ho English:Your 3D print has been auto-paused.\n\nLayer {0} reached. Translated:Your 3D print has been auto-paused.\n\nLayer {0} reached. +English:Your 3D print has been auto-paused.\n\nLayer {0} reached. +Translated:Your 3D print has been auto-paused.\n\nLayer {0} reached. + +English:Your 3D print has been paused.\n\nOut of filament, or jam, detected. Please load more filament or clear the jam. +Translated:Your 3D print has been paused.\n\nOut of filament, or jam, detected. Please load more filament or clear the jam. + English:Your 3D print has been paused.\n\nOut of filament, or jam, detected. Please load more filament or clear the jam. Translated:Your 3D print has been paused.\n\nOut of filament, or jam, detected. Please load more filament or clear the jam. diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 65fbb95b6..27c7b679c 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 65fbb95b6db2b3c219fee177c7c45b22b36b9f24 +Subproject commit 27c7b679c14a5f96ccd7f1684d4b45d9791d0834 From 5435dd930195ead9e5d56fe9bd458fea2703f7c4 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Tue, 14 Jun 2022 11:00:23 -0700 Subject: [PATCH 2/4] upgrading to v4.8 --- App.config | 2 +- Launcher/Launcher.csproj | 2 +- Launcher/app.config | 2 +- MatterControl.Winforms/MatterControl.Winforms.csproj | 2 +- MatterControl.csproj | 2 +- PrinterDriverInstaller/InfInstaller.csproj | 2 +- PrinterDriverInstaller/app.config | 2 +- Submodules/MatterSlice | 2 +- Submodules/agg-sharp | 2 +- .../MatterControl.AutomationTests.csproj | 2 +- Tests/MatterControl.Tests/MatterControl.Tests.csproj | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/App.config b/App.config index 6a4d4b1c2..12ace6c0f 100644 --- a/App.config +++ b/App.config @@ -1,7 +1,7 @@ - + diff --git a/Launcher/Launcher.csproj b/Launcher/Launcher.csproj index 24379e8b0..d9884aa52 100644 --- a/Launcher/Launcher.csproj +++ b/Launcher/Launcher.csproj @@ -16,7 +16,7 @@ 2.0 - v4.7.1 + v4.8 diff --git a/Launcher/app.config b/Launcher/app.config index ba98fc967..c0c3aed4e 100644 --- a/Launcher/app.config +++ b/Launcher/app.config @@ -1,6 +1,6 @@ - + diff --git a/MatterControl.Winforms/MatterControl.Winforms.csproj b/MatterControl.Winforms/MatterControl.Winforms.csproj index e2fa7c200..a484a9f43 100644 --- a/MatterControl.Winforms/MatterControl.Winforms.csproj +++ b/MatterControl.Winforms/MatterControl.Winforms.csproj @@ -9,7 +9,7 @@ Properties MatterControl.Winforms MatterControl.Winforms - v4.7.1 + v4.8 512 true diff --git a/MatterControl.csproj b/MatterControl.csproj index 1894fc39d..a6629da9d 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -8,7 +8,7 @@ WinExe MatterControl MatterControl - v4.7.1 + v4.8 win 512 diff --git a/PrinterDriverInstaller/InfInstaller.csproj b/PrinterDriverInstaller/InfInstaller.csproj index 2443f8a54..c2b5b281e 100644 --- a/PrinterDriverInstaller/InfInstaller.csproj +++ b/PrinterDriverInstaller/InfInstaller.csproj @@ -16,7 +16,7 @@ 2.0 - v4.7.1 + v4.8 diff --git a/PrinterDriverInstaller/app.config b/PrinterDriverInstaller/app.config index ba98fc967..c0c3aed4e 100644 --- a/PrinterDriverInstaller/app.config +++ b/PrinterDriverInstaller/app.config @@ -1,6 +1,6 @@ - + diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index 91c298606..b2b6261e0 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit 91c298606fa4bcc238cde19877b8d2ab913e5ed9 +Subproject commit b2b6261e0936f91a9f018da860c636dfafef2d91 diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 27c7b679c..895408eb6 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 27c7b679c14a5f96ccd7f1684d4b45d9791d0834 +Subproject commit 895408eb6799d006137c9bb8824f6b950064d0eb diff --git a/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj b/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj index 9363ba62a..c03586734 100644 --- a/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj +++ b/Tests/MatterControl.AutomationTests/MatterControl.AutomationTests.csproj @@ -17,7 +17,7 @@ Properties MatterControl.AutomationTests MatterControl.AutomationTests - v4.7.1 + v4.8 win 512 diff --git a/Tests/MatterControl.Tests/MatterControl.Tests.csproj b/Tests/MatterControl.Tests/MatterControl.Tests.csproj index c7c48707d..50845c69d 100644 --- a/Tests/MatterControl.Tests/MatterControl.Tests.csproj +++ b/Tests/MatterControl.Tests/MatterControl.Tests.csproj @@ -17,7 +17,7 @@ Properties MatterControl.Tests MatterControl.Tests - v4.7.1 + v4.8 win 512 ..\..\ From 2597347f9c99ec1bd031534767b2393ad41e9ecd Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Thu, 16 Jun 2022 13:11:26 -0700 Subject: [PATCH 3/4] adding in re-arrange item support --- .../ApplicationView/ApplicationController.cs | 23 +++++------------ .../Interfaces/EditorButtonData.cs | 18 +++++++++++++ .../Primitives/ComponentObject3D.cs | 25 ++++++++++++++++++- .../View3D/Actions/CombineObject3D_2.cs | 2 +- Submodules/agg-sharp | 2 +- 5 files changed, 50 insertions(+), 20 deletions(-) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index beaf71761..1ee1b6f43 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -209,25 +209,14 @@ namespace MatterHackers.MatterControl menuTheme.CreateMenuItems(popupMenu, actions); - if (selectedItem is ComponentObject3D componentObject) + if (selectedItem is IRightClickMenuProvider menuProvider) { - popupMenu.CreateSeparator(); + menuProvider.AddRightClickMenuItemsItems(popupMenu); + } - string componentID = componentObject.ComponentID; - - var helpItem = popupMenu.CreateMenuItem("Help".Localize()); - helpItem.Enabled = !string.IsNullOrEmpty(componentID) && this.HelpArticlesByID.ContainsKey(componentID); - helpItem.Click += (s, e) => - { - var helpTab = ApplicationController.Instance.ActivateHelpTab("Docs"); - if (helpTab.TabContent is HelpTreePanel helpTreePanel) - { - if (this.HelpArticlesByID.TryGetValue(componentID, out HelpArticle helpArticle)) - { - helpTreePanel.ActiveNodePath = componentID; - } - } - }; + if (selectedItem.Parent is IParentRightClickMenuProvider parentMenuProvider) + { + parentMenuProvider.AddRightClickMenuItemsItems(popupMenu, selectedItem); } return popupMenu; diff --git a/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs b/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs index a00f8b28e..a731a8e1f 100644 --- a/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs +++ b/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs @@ -28,6 +28,8 @@ either expressed or implied, of the FreeBSD Project. */ using MatterHackers.Agg.UI; +using MatterHackers.DataConverters3D; +using MatterHackers.MatterControl.PartPreviewWindow; using System; using System.Collections.Generic; @@ -53,4 +55,20 @@ namespace MatterHackers.MatterControl.DesignTools { IEnumerable GetEditorButtonsData(); } + + /// + /// Whene this item is right clicked it will append menu items to the right click menu + /// + public interface IRightClickMenuProvider + { + void AddRightClickMenuItemsItems(PopupMenu popupMenu); + } + + /// + /// When a child of this item is right clicked, it will add menu items + /// + public interface IParentRightClickMenuProvider + { + void AddRightClickMenuItemsItems(PopupMenu popupMenu, IObject3D itemRightClicked); + } } \ No newline at end of file diff --git a/MatterControlLib/DesignTools/Primitives/ComponentObject3D.cs b/MatterControlLib/DesignTools/Primitives/ComponentObject3D.cs index 39f91107e..42c5fc958 100644 --- a/MatterControlLib/DesignTools/Primitives/ComponentObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/ComponentObject3D.cs @@ -36,11 +36,12 @@ using MatterHackers.DataConverters3D; using MatterHackers.DataConverters3D.UndoCommands; using MatterHackers.Localizations; using MatterHackers.MatterControl.DesignTools.Operations; +using MatterHackers.MatterControl.PartPreviewWindow; namespace MatterHackers.MatterControl.DesignTools { [HideChildrenFromTreeView] - public class ComponentObject3D : Object3D + public class ComponentObject3D : Object3D, IRightClickMenuProvider { private const string ImageConverterComponentID = "4D9BD8DB-C544-4294-9C08-4195A409217A"; @@ -293,5 +294,27 @@ namespace MatterHackers.MatterControl.DesignTools } } } + + public void AddRightClickMenuItemsItems(PopupMenu popupMenu) + { + popupMenu.CreateSeparator(); + + string componentID = this.ComponentID; + + var helpItem = popupMenu.CreateMenuItem("Help".Localize()); + var helpArticlesByID = ApplicationController.Instance.HelpArticlesByID; + helpItem.Enabled = !string.IsNullOrEmpty(componentID) && helpArticlesByID.ContainsKey(componentID); + helpItem.Click += (s, e) => + { + var helpTab = ApplicationController.Instance.ActivateHelpTab("Docs"); + if (helpTab.TabContent is HelpTreePanel helpTreePanel) + { + if (helpArticlesByID.TryGetValue(componentID, out HelpArticle helpArticle)) + { + helpTreePanel.ActiveNodePath = componentID; + } + } + }; + } } } \ No newline at end of file diff --git a/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs b/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs index fc455bd39..f3e1d139f 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/Actions/CombineObject3D_2.cs @@ -142,7 +142,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D } else { - resultsMesh = Object3D.CombineParticipants(SourceContainer, participants, cancellationToken, reporter); + resultsMesh = Object3D.CombineParticipants(SourceContainer, participants, cancellationToken, reporter, Processing, InputResolution, OutputResolution); } var resultsItem = new Object3D() diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 895408eb6..238b25271 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 895408eb6799d006137c9bb8824f6b950064d0eb +Subproject commit 238b25271497943ece9ab855b119810abe2c9809 From 78aa8e353c565da284f884efdc6b977592260ba9 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Thu, 16 Jun 2022 13:17:36 -0700 Subject: [PATCH 4/4] Improving right click menu --- .../ApplicationView/ApplicationController.cs | 74 ++++++++++++++++++- .../Interfaces/EditorButtonData.cs | 2 +- 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 1ee1b6f43..4ec51783a 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -214,14 +214,84 @@ namespace MatterHackers.MatterControl menuProvider.AddRightClickMenuItemsItems(popupMenu); } - if (selectedItem.Parent is IParentRightClickMenuProvider parentMenuProvider) + var parent = selectedItem.Parent; + if (parent != null) { - parentMenuProvider.AddRightClickMenuItemsItems(popupMenu, selectedItem); + var orderChildrenByIndex = parent.GetType().GetCustomAttributes(typeof(OrderChildrenByIndexAttribute), true).Any(); + if (orderChildrenByIndex) + { + AddReorderChildrenRightClickMenuItems(popupMenu, selectedItem); + } } return popupMenu; } + public void AddReorderChildrenRightClickMenuItems(PopupMenu popupMenu, IObject3D itemRightClicked) + { + popupMenu.CreateSeparator(); + var parent = itemRightClicked.Parent; + if(parent == null) + { + return; + } + + // move to the top + var moveTopItem = popupMenu.CreateMenuItem("↑↑ Move Top".Localize()); + + moveTopItem.Enabled = parent.Children.IndexOf(itemRightClicked) != 0; + moveTopItem.Click += (s, e) => + { + parent.Children.Modify((list) => + { + list.Remove(itemRightClicked); + list.Insert(0, itemRightClicked); + }); + }; + + // move up one position + var moveUpItem = popupMenu.CreateMenuItem("↑ Move Up".Localize()); + + moveUpItem.Enabled = parent.Children.IndexOf(itemRightClicked) != 0; + moveUpItem.Click += (s, e) => + { + parent.Children.Modify((list) => + { + var index = list.IndexOf(itemRightClicked); + list.Remove(itemRightClicked); + list.Insert(index - 1, itemRightClicked); + }); + }; + + // move down one position + var moveDownItem = popupMenu.CreateMenuItem("↓ Move Down".Localize()); + + moveDownItem.Enabled = parent.Children.IndexOf(itemRightClicked) != parent.Children.Count - 1; + moveDownItem.Click += (s, e) => + { + parent.Children.Modify((list) => + { + var index = list.IndexOf(itemRightClicked); + list.Remove(itemRightClicked); + list.Insert(index + 1, itemRightClicked); + }); + }; + + // move to the bottom + var moveBottomItem = popupMenu.CreateMenuItem("↓↓ Move Bottom".Localize()); + + moveBottomItem.Enabled = parent.Children.IndexOf(itemRightClicked) != parent.Children.Count - 1; + moveBottomItem.Click += (s, e) => + { + parent.Children.Modify((list) => + { + var index = list.IndexOf(itemRightClicked); + list.Remove(itemRightClicked); + list.Add(itemRightClicked); + }); + }; + } + public PopupMenu GetModifyMenu(ISceneContext sceneContext) { var popupMenu = new PopupMenu(this.MenuTheme); diff --git a/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs b/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs index a731a8e1f..2efed0c79 100644 --- a/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs +++ b/MatterControlLib/DesignTools/Interfaces/EditorButtonData.cs @@ -69,6 +69,6 @@ namespace MatterHackers.MatterControl.DesignTools /// public interface IParentRightClickMenuProvider { - void AddRightClickMenuItemsItems(PopupMenu popupMenu, IObject3D itemRightClicked); + void AddRightClickMenuItems(PopupMenu popupMenu, IObject3D itemRightClicked); } } \ No newline at end of file