Changes to SaveAsWindow
This commit is contained in:
parent
4405c356a5
commit
ed573deb2d
3 changed files with 59 additions and 14 deletions
|
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public DataStorage.CustomCommands ActiveMacro;
|
||||
|
||||
public EditMacrosWindow(IEnumerable<DataStorage.CustomCommands> macros, EventHandler functionToCallOnSave)
|
||||
public EditMacrosWindow(EventHandler functionToCallOnSave)
|
||||
: base(360, 420)
|
||||
{
|
||||
Title = LocalizedString.Get("Macro Editor");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue