From ed573deb2db0db90f07c5d9b69cd9c871b23deee Mon Sep 17 00:00:00 2001 From: gregory-diaz Date: Wed, 19 Mar 2014 10:12:55 -0700 Subject: [PATCH] Changes to SaveAsWindow --- PartPreviewWindow/SaveAsWindow.cs | 53 ++++++++++++++++++++++++++--- PrinterControls/EditMacrosWindow.cs | 2 +- PrinterControls/MacroControls.cs | 18 +++++----- 3 files changed, 59 insertions(+), 14 deletions(-) diff --git a/PartPreviewWindow/SaveAsWindow.cs b/PartPreviewWindow/SaveAsWindow.cs index 79da3b43d..1fcc242f7 100644 --- a/PartPreviewWindow/SaveAsWindow.cs +++ b/PartPreviewWindow/SaveAsWindow.cs @@ -1,5 +1,4 @@ - -using System; +using System; using System.Collections.Generic; using System.Linq; using System.IO; @@ -16,22 +15,68 @@ namespace MatterHackers.MatterControl { public class SaveAsWindow : SystemWindow { + Button saveAsButton; + Button cancelSaveButton; + CheckBox addToLibraryOption; + protected TextImageButtonFactory testButtonFactory = new TextImageButtonFactory (); + protected TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory (); + public SaveAsWindow() - : base (360, 300) + : base (360, 420) { Title = "Save As Window"; + FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom); topToBottom.AnchorAll(); topToBottom.Padding = new BorderDouble(3, 0, 3, 5); + FlowLayoutWidget headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight); headerRow.HAnchor = HAnchor.ParentLeftRight; headerRow.Margin = new BorderDouble(0, 3, 0, 0); headerRow.Padding = new BorderDouble(0, 3, 0, 3); - ShowAsSystemWindow (); + BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; + + { + string saveAsLabel = "Save As"; + TextWidget elementHeader = new TextWidget (saveAsLabel, pointSize: 14); + elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor; + elementHeader.HAnchor = HAnchor.ParentLeftRight; + elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom; + + headerRow.AddChild (elementHeader); + topToBottom.AddChild (headerRow); + + } + + + saveAsButton = textImageButtonFactory.Generate("Save As".Localize(), centerText: true); + saveAsButton.Visible = true; + saveAsButton.Cursor = Cursors.Hand; + + + + this.AddChild (topToBottom); + + + ShowAsSystemWindow (); + } + + public void GenericButton() + { + this.textImageButtonFactory.normalFillColor = RGBA_Bytes.White; + this.textImageButtonFactory.FixedHeight = 24; + this.textImageButtonFactory.fontSize = 12; + + this.textImageButtonFactory.disabledTextColor = RGBA_Bytes.Gray; + this.textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; + this.textImageButtonFactory.normalTextColor = RGBA_Bytes.Black; + this.textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; + this.HAnchor = HAnchor.ParentLeftRight; + } } } diff --git a/PrinterControls/EditMacrosWindow.cs b/PrinterControls/EditMacrosWindow.cs index 4b9d6da06..433edee20 100644 --- a/PrinterControls/EditMacrosWindow.cs +++ b/PrinterControls/EditMacrosWindow.cs @@ -384,7 +384,7 @@ namespace MatterHackers.MatterControl public DataStorage.CustomCommands ActiveMacro; - public EditMacrosWindow(IEnumerable macros, EventHandler functionToCallOnSave) + public EditMacrosWindow(EventHandler functionToCallOnSave) : base(360, 420) { Title = LocalizedString.Get("Macro Editor"); diff --git a/PrinterControls/MacroControls.cs b/PrinterControls/MacroControls.cs index 762289e78..3a91c067e 100644 --- a/PrinterControls/MacroControls.cs +++ b/PrinterControls/MacroControls.cs @@ -61,16 +61,16 @@ namespace MatterHackers.MatterControl void SetDisplayAttributes() { - this.textImageButtonFactory.normalFillColor = RGBA_Bytes.White; - this.textImageButtonFactory.FixedHeight = 24; - this.textImageButtonFactory.fontSize = 12; + this.textImageButtonFactory.normalFillColor = RGBA_Bytes.White; + this.textImageButtonFactory.FixedHeight = 24; + this.textImageButtonFactory.fontSize = 12; - this.textImageButtonFactory.disabledTextColor = RGBA_Bytes.Gray; - this.textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; - this.textImageButtonFactory.normalTextColor = RGBA_Bytes.Black; - this.textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; + this.textImageButtonFactory.disabledTextColor = RGBA_Bytes.Gray; + this.textImageButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryTextColor; + this.textImageButtonFactory.normalTextColor = RGBA_Bytes.Black; + this.textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor; - this.HAnchor = HAnchor.ParentLeftRight; + this.HAnchor = HAnchor.ParentLeftRight; } public override RectangleDouble LocalBounds @@ -100,7 +100,7 @@ namespace MatterHackers.MatterControl { if (editSettingsWindow == null) { - editSettingsWindow = new EditMacrosWindow(GetMacros(), ReloadMacros); + editSettingsWindow = new EditMacrosWindow(ReloadMacros); editSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editSettingsWindow = null; }; } else