From 8b72131769b823b59ab64f795e7d8ee66066c90e Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Thu, 6 Oct 2016 10:59:51 -0700 Subject: [PATCH] Fixed down arrows on edit model page MatterHackers/MCCentral#538 Lost down arrow for edit options on 3D view --- BrailleBuilder/View3DBrailleBuilder.cs | 4 ++- ControlElements/TextImageButtonFactory.cs | 7 +++-- .../View3D/SideBar/MirrorControls.cs | 5 +++- .../View3D/SideBar/ScaleControls.cs | 4 ++- PartPreviewWindow/View3D/View3DWidget.cs | 29 +++++++++++++++++-- PartPreviewWindow/ViewGcodeBasic.cs | 8 +++-- Submodules/agg-sharp | 2 +- TextCreator/View3DTextCreator.cs | 8 +++-- 8 files changed, 54 insertions(+), 13 deletions(-) diff --git a/BrailleBuilder/View3DBrailleBuilder.cs b/BrailleBuilder/View3DBrailleBuilder.cs index 54953f4f3..393b41be7 100644 --- a/BrailleBuilder/View3DBrailleBuilder.cs +++ b/BrailleBuilder/View3DBrailleBuilder.cs @@ -593,7 +593,9 @@ namespace MatterHackers.MatterControl.Plugins.BrailleBuilder // put in the word editing menu { - CheckBox expandWordOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Word Edit".Localize(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + CheckBox expandWordOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Word Edit".Localize(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandWordOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandWordOptions); diff --git a/ControlElements/TextImageButtonFactory.cs b/ControlElements/TextImageButtonFactory.cs index 6b1d396dc..5b260e3ac 100644 --- a/ControlElements/TextImageButtonFactory.cs +++ b/ControlElements/TextImageButtonFactory.cs @@ -265,9 +265,12 @@ namespace MatterHackers.MatterControl return groupLableAndEditControl; } - public CheckBox GenerateCheckBoxButton(string label, ImageBuffer normalImageName, ImageBuffer normalToPressedImageName = null, ImageBuffer pressedImageName = null, ImageBuffer pressedToNormalImageName = null, string pressedLabel = null) + public CheckBox GenerateCheckBoxButton(string label, ImageBuffer normalImage, ImageBuffer normalToPressedImage = null, ImageBuffer pressedImage = null, ImageBuffer pressedToNormalImage = null, string pressedLabel = null) { - CheckBoxViewStates checkBoxButtonViewWidget = getCheckBoxButtonView(label, normalImageName, normalToPressedImageName, pressedImageName, pressedToNormalImageName, pressedLabel); + if (pressedImage == null) pressedImage = normalImage; + if (pressedToNormalImage == null) pressedToNormalImage = normalToPressedImage; + + CheckBoxViewStates checkBoxButtonViewWidget = getCheckBoxButtonView(label, normalImage, normalToPressedImage, pressedImage, pressedToNormalImage, pressedLabel); //Override the width if requested if (this.FixedWidth != 0) diff --git a/PartPreviewWindow/View3D/SideBar/MirrorControls.cs b/PartPreviewWindow/View3D/SideBar/MirrorControls.cs index ab4c1a43b..8d5b2cf09 100644 --- a/PartPreviewWindow/View3D/SideBar/MirrorControls.cs +++ b/PartPreviewWindow/View3D/SideBar/MirrorControls.cs @@ -52,7 +52,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // put in the mirror options { - expandMirrorOptions = view3DWidget.ExpandMenuOptionFactory.GenerateCheckBoxButton("Mirror".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32,32).InvertLightness()); + expandMirrorOptions = view3DWidget.ExpandMenuOptionFactory.GenerateCheckBoxButton( + "Mirror".Localize().ToUpper(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandMirrorOptions.Margin = new BorderDouble(bottom: 2); this.AddChild(expandMirrorOptions); diff --git a/PartPreviewWindow/View3D/SideBar/ScaleControls.cs b/PartPreviewWindow/View3D/SideBar/ScaleControls.cs index 7c7d78479..d0588b503 100644 --- a/PartPreviewWindow/View3D/SideBar/ScaleControls.cs +++ b/PartPreviewWindow/View3D/SideBar/ScaleControls.cs @@ -55,7 +55,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { this.view3DWidget = view3DWidget; { - expandScaleOptions = view3DWidget.ExpandMenuOptionFactory.GenerateCheckBoxButton("Scale".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + expandScaleOptions = view3DWidget.ExpandMenuOptionFactory.GenerateCheckBoxButton("Scale".Localize().ToUpper(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandScaleOptions.Margin = new BorderDouble(bottom: 2); this.AddChild(expandScaleOptions); diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index a14bf1ca4..df22923a4 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -132,6 +132,22 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public event EventHandler SelectedTransformChanged; + public static ImageBuffer ArrowRight + { + get + { + return StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness(); + } + } + + public static ImageBuffer ArrowDown + { + get + { + return StaticData.Instance.LoadIcon("icon_arrow_down_no_border_32x32.png", 32, 32).InvertLightness(); + } + } + public View3DWidget(PrintItemWrapper printItemWrapper, Vector3 viewerVolume, Vector2 bedCenter, BedShape bedShape, WindowMode windowType, AutoRotate autoRotate, OpenMode openMode = OpenMode.Viewing) { this.openMode = openMode; @@ -1446,7 +1462,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { BorderDouble buttonMargin = new BorderDouble(top: 3); - expandRotateOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Rotate".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + expandRotateOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton( + "Rotate".Localize().ToUpper(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandRotateOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandRotateOptions); expandRotateOptions.CheckedStateChanged += expandRotateOptions_CheckedStateChanged; @@ -1469,7 +1488,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // put in the material options int numberOfExtruders = ActiveSliceSettings.Instance.GetValue(SettingsKey.extruder_count); - expandMaterialOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Materials".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + expandMaterialOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Materials".Localize().ToUpper(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandMaterialOptions.Margin = new BorderDouble(bottom: 2); expandMaterialOptions.CheckedStateChanged += expandMaterialOptions_CheckedStateChanged; @@ -1487,7 +1508,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // put in the view options { - expandViewOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Display".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + expandViewOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Display".Localize().ToUpper(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandViewOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandViewOptions); expandViewOptions.CheckedStateChanged += expandViewOptions_CheckedStateChanged; diff --git a/PartPreviewWindow/ViewGcodeBasic.cs b/PartPreviewWindow/ViewGcodeBasic.cs index 9a72f56da..652b53d59 100644 --- a/PartPreviewWindow/ViewGcodeBasic.cs +++ b/PartPreviewWindow/ViewGcodeBasic.cs @@ -398,7 +398,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow buttonRightPanel.Width = 200; { string label = "Model".Localize().ToUpper(); - expandModelOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton(label, StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + expandModelOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton(label, + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandModelOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandModelOptions); expandModelOptions.Checked = true; @@ -408,7 +410,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow //modelOptionsContainer.Visible = false; buttonRightPanel.AddChild(modelOptionsContainer); - expandDisplayOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Display".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + expandDisplayOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Display".Localize().ToUpper(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandDisplayOptions.Name = "Display Checkbox"; expandDisplayOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandDisplayOptions); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 2e51c5453..306631347 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 2e51c545392b3d6886e9abc7c84cbb62871792d4 +Subproject commit 30663134718628bf6baa1bbd2343a562a99b8617 diff --git a/TextCreator/View3DTextCreator.cs b/TextCreator/View3DTextCreator.cs index 9c2ab0860..22f54e6c5 100644 --- a/TextCreator/View3DTextCreator.cs +++ b/TextCreator/View3DTextCreator.cs @@ -607,7 +607,9 @@ namespace MatterHackers.MatterControl.Plugins.TextCreator // put in the word editing menu { - CheckBox expandWordOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Word Edit".Localize(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + CheckBox expandWordOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Word Edit".Localize(), + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandWordOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandWordOptions); @@ -680,7 +682,9 @@ namespace MatterHackers.MatterControl.Plugins.TextCreator // put in the letter editing menu { - CheckBox expandLetterOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Letter", StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + CheckBox expandLetterOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Letter", + View3DWidget.ArrowRight, + View3DWidget.ArrowDown); expandLetterOptions.Margin = new BorderDouble(bottom: 2); //buttonRightPanel.AddChild(expandLetterOptions);