Merge pull request #2372 from jlewin/design_tools

Revise Export window
This commit is contained in:
johnlewin 2017-08-19 20:41:38 -07:00 committed by GitHub
commit c1dab405fe
5 changed files with 43 additions and 16 deletions

View file

@ -46,9 +46,6 @@ namespace MatterHackers.MatterControl
public class ExportPrintItemPage : WizardPage
{
private CheckBox showInFolderAfterSave;
private string gcodePathAndFilenameToSave;
private bool partIsGCode = false;
private string documentsPath;
private EventHandler unregisterEvents;
@ -57,10 +54,9 @@ namespace MatterHackers.MatterControl
private IEnumerable<ILibraryItem> libraryItems;
public ExportPrintItemPage(IEnumerable<ILibraryItem> libraryItems)
: base(unlocalizedTextForTitle: "File export options:")
: base(unlocalizedTextForTitle: "Export selection to:")
{
this.libraryItems = libraryItems;
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
this.Name = "Export Item Window";
CreateWindowContent();
@ -73,8 +69,11 @@ namespace MatterHackers.MatterControl
{
var commonMargin = new BorderDouble(4, 2);
bool isFirstItem = true;
// GCode export
bool showExportGCodeButton = ActiveSliceSettings.Instance.PrinterSelected || partIsGCode;
bool showExportGCodeButton = ActiveSliceSettings.Instance.PrinterSelected;
if (showExportGCodeButton)
{
exportPluginButtons = new Dictionary<RadioButton, IExportPlugin>();
@ -90,6 +89,12 @@ namespace MatterHackers.MatterControl
};
contentRow.AddChild(pluginButton);
if (isFirstItem)
{
pluginButton.Checked = true;
isFirstItem = false;
}
var optionPanel = plugin.GetOptionsPanel();
if (optionPanel != null)
{

View file

@ -38,15 +38,36 @@ namespace MatterHackers.MatterControl
public RadioPanelWidget(string label, string info, ImageBuffer image)
: base(label)
{
var imageWidget = new ImageWidget(image);
this.AddChild(imageWidget, this.Children.IndexOf(labelTextWidget));
imageWidget.Margin = new BorderDouble(8, 5);
radioCircle.Margin = new BorderDouble(4);
radioCircle.VAnchor = VAnchor.Top;
var column = new FlowLayoutWidget(FlowDirection.TopToBottom);
this.ReplaceChild(labelTextWidget, column);
labelTextWidget.ClearRemovedFlag();
labelTextWidget.Margin = new BorderDouble(8, 0);
labelTextWidget.VAnchor = VAnchor.Center;
labelTextWidget.HAnchor = HAnchor.Left;
column.AddChild(labelTextWidget);
radioCircle.Margin = new BorderDouble(8, 0);
radioCircle.VAnchor = VAnchor.Center;
var imageWidget = new ImageWidget(image);
imageWidget.HAnchor = HAnchor.Left;
imageWidget.Margin = new BorderDouble(8, 5);
column.AddChild(imageWidget);
}
}
public static class RadioExentionMethods
{
public static void ReplaceChild(this GuiWidget widget, GuiWidget existingChild, GuiWidget replacement)
{
int index = widget.GetChildIndex(existingChild);
if (index >= 0)
{
widget.RemoveChild(existingChild);
widget.AddChild(replacement, index);
}
}
}
}

View file

@ -46,7 +46,7 @@ namespace MatterHackers.MatterControl.Library.Export
{
public class GCodeExport : IExportPlugin
{
public string ButtonText => "G-Code File".Localize();
public string ButtonText => "Machine File (G-Code)".Localize();
public string FileExtension => ".gcode";
@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.Library.Export
{
this.ApplyLeveling = checkbox.Checked;
};
container.AddChild(checkbox);
//container.AddChild(checkbox);
return container;
}

View file

@ -165,7 +165,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
base.OnMouseMove(mouseEvent);
if (SuppressUiVolumes)
if (SuppressUiVolumes
|| !this.PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y))
{
return;
}

@ -1 +1 @@
Subproject commit fde2552b36e71873dd7e7e65379e04f478e93f9f
Subproject commit 98be49c6a64feb50b7d57ece857760c563e7050e