Merge branch 'development' of https://github.com/MatterHackers/MatterControl into development

This commit is contained in:
larsbrubaker 2014-03-24 12:21:47 -07:00
commit 98a53f312c
21 changed files with 208 additions and 121 deletions

View file

@ -40,6 +40,7 @@ using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.ContactForm;
using MatterHackers.MatterControl.VersionManagement;
using MatterHackers.MatterControl.CustomWidgets;
namespace MatterHackers.MatterControl
{
@ -95,8 +96,8 @@ namespace MatterHackers.MatterControl
public UpdateControl()
{
textImageButtonFactory.normalFillColor = ActiveTheme.Instance.PrimaryTextColor;
textImageButtonFactory.normalTextColor = RGBA_Bytes.Black;
textImageButtonFactory.normalFillColor = RGBA_Bytes.Gray;
textImageButtonFactory.normalTextColor = RGBA_Bytes.White;
HAnchor = HAnchor.ParentLeftRight;
BackgroundColor = ActiveTheme.Instance.TransparentDarkOverlay;
@ -374,7 +375,7 @@ namespace MatterHackers.MatterControl
{
LinkButtonFactory linkButtonFactory = new LinkButtonFactory();
TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory();
RGBA_Bytes offWhite = new RGBA_Bytes(245, 245, 245);
RGBA_Bytes aboutTextColor = ActiveTheme.Instance.PrimaryTextColor;
public AboutPage()
{
@ -385,16 +386,16 @@ namespace MatterHackers.MatterControl
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
linkButtonFactory.fontSize = 12;
linkButtonFactory.textColor = offWhite;
linkButtonFactory.textColor = aboutTextColor;
textImageButtonFactory.normalFillColor = ActiveTheme.Instance.PrimaryTextColor;
textImageButtonFactory.normalTextColor = RGBA_Bytes.Black;
textImageButtonFactory.normalFillColor = RGBA_Bytes.Gray;
textImageButtonFactory.normalTextColor = RGBA_Bytes.White;
FlowLayoutWidget customInfoTopToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
customInfoTopToBottom.Name = "AboutPageCustomInfo";
customInfoTopToBottom.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
customInfoTopToBottom.VAnchor = Agg.UI.VAnchor.Max_FitToChildren_ParentHeight;
customInfoTopToBottom.Padding = new BorderDouble(5, 10);
customInfoTopToBottom.Padding = new BorderDouble(5, 10, 5, 0);
customInfoTopToBottom.AddChild(new UpdateControl());
AddMatterHackersInfo(customInfoTopToBottom);
@ -408,21 +409,33 @@ namespace MatterHackers.MatterControl
headerContainer.Margin = new BorderDouble(0, 0, 0, 10);
headerContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
{
TextWidget headerText = new TextWidget(string.Format("MatterControl"), textColor: RGBA_Bytes.White, pointSize: 20);
TextWidget headerText = new TextWidget(string.Format("MatterControl"), textColor: aboutTextColor, pointSize: 20);
headerText.MinimumSize = new VectorMath.Vector2(headerText.Width, headerText.Height);
headerText.HAnchor = Agg.UI.HAnchor.ParentCenter;
headerContainer.AddChild(headerText);
TextWidget versionText = new TextWidget(string.Format("Version {0}".Localize(), VersionInfo.Instance.ReleaseVersion), textColor: RGBA_Bytes.White, pointSize: 10);
TextWidget versionText = new TextWidget(string.Format("Version {0}".Localize(), VersionInfo.Instance.ReleaseVersion).ToUpper(), textColor: aboutTextColor, pointSize: 10);
versionText.MinimumSize = new VectorMath.Vector2(versionText.Width, versionText.Height);
versionText.HAnchor = Agg.UI.HAnchor.ParentCenter;
headerContainer.AddChild(versionText);
TextWidget developedByText = new TextWidget("Developed by MatterHackers".Localize(), textColor: RGBA_Bytes.White);
developedByText.Margin = new BorderDouble(top: 5);
developedByText.HAnchor = Agg.UI.HAnchor.ParentCenter;
FlowLayoutWidget developedByContainer = new FlowLayoutWidget();
developedByContainer.Margin = new BorderDouble(top: 5);
developedByContainer.HAnchor = HAnchor.ParentLeftRight;
TextWidget developedByText = new TextWidget("Developed By: ".Localize().ToUpper(), pointSize:10, textColor: aboutTextColor);
developedByText.MinimumSize = new VectorMath.Vector2(developedByText.Width, developedByText.Height);
headerContainer.AddChild(developedByText);
TextWidget MatterHackersText = new TextWidget("MatterHackers", pointSize: 14, textColor: aboutTextColor);
developedByContainer.AddChild(new HorizontalSpacer());
developedByContainer.AddChild(developedByText);
developedByContainer.AddChild(MatterHackersText);
developedByContainer.AddChild(new HorizontalSpacer());
headerContainer.AddChild(developedByContainer);
}
topToBottom.AddChild(headerContainer);
@ -435,14 +448,17 @@ namespace MatterHackers.MatterControl
// donate to mc
{
FlowLayoutWidget donateTextContanier = new FlowLayoutWidget();
TextWidget donateStartText = new TextWidget("Please consider ".Localize(), textColor: RGBA_Bytes.White);
donateTextContanier.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
TextWidget donateStartText = new TextWidget("Please consider ".Localize(), textColor: ActiveTheme.Instance.PrimaryTextColor);
TextWidget donateEndText = new TextWidget(" to help support MatterControl.".Localize(), textColor: ActiveTheme.Instance.PrimaryTextColor);
donateTextContanier.AddChild(new HorizontalSpacer());
donateTextContanier.AddChild(donateStartText);
Button matterControlDonateLink = linkButtonFactory.Generate("donating".Localize());
matterControlDonateLink.OriginRelativeParent = new VectorMath.Vector2(matterControlDonateLink.OriginRelativeParent.x, matterControlDonateLink.OriginRelativeParent.y + donateStartText.Printer.TypeFaceStyle.DescentInPixels);
matterControlDonateLink.Click += (sender, mouseEvent) => { System.Diagnostics.Process.Start("http://www.matterhackers.com/store/printer-accessories/mattercontrol-donation"); };
donateTextContanier.AddChild(matterControlDonateLink);
donateTextContanier.AddChild(new TextWidget(" to help support and improve MatterControl.".Localize(), textColor: RGBA_Bytes.White));
donateTextContanier.HAnchor = Agg.UI.HAnchor.ParentCenter;
donateTextContanier.AddChild(getDonateLink(donateStartText));
donateTextContanier.AddChild(donateEndText);
donateTextContanier.AddChild(new HorizontalSpacer());
topToBottom.AddChild(donateTextContanier);
}
@ -479,7 +495,7 @@ namespace MatterHackers.MatterControl
learnMoreLink.Margin = new BorderDouble(0, 5);
topToBottom.AddChild(learnMoreLink);
TextWidget copyrightText = new TextWidget(string.Format("Copyright © 2014 MatterHackers, Inc."), textColor: offWhite);
TextWidget copyrightText = new TextWidget(string.Format("Copyright © 2014 MatterHackers, Inc."), textColor: aboutTextColor);
copyrightText.HAnchor = Agg.UI.HAnchor.ParentCenter;
topToBottom.AddChild(copyrightText);
@ -487,7 +503,7 @@ namespace MatterHackers.MatterControl
FlowLayoutWidget leftToRightBuildInfo = new FlowLayoutWidget();
leftToRightBuildInfo.HAnchor |= HAnchor.ParentCenter;
TextWidget buildText = new TextWidget(string.Format("Build: {0} | ".Localize(), VersionInfo.Instance.BuildVersion), textColor: offWhite, pointSize: 10);
TextWidget buildText = new TextWidget(string.Format("Build: {0} | ".Localize(), VersionInfo.Instance.BuildVersion), textColor: aboutTextColor, pointSize: 10);
leftToRightBuildInfo.AddChild(buildText);
double oldFontSize = linkButtonFactory.fontSize;
@ -502,12 +518,21 @@ namespace MatterHackers.MatterControl
}
}
Button getDonateLink(TextWidget donateStartText )
{
Button matterControlDonateLink = linkButtonFactory.Generate("donating".Localize());
matterControlDonateLink.OriginRelativeParent = new VectorMath.Vector2(matterControlDonateLink.OriginRelativeParent.x, matterControlDonateLink.OriginRelativeParent.y + donateStartText.Printer.TypeFaceStyle.DescentInPixels);
matterControlDonateLink.Click += (sender, mouseEvent) => { System.Diagnostics.Process.Start("http://www.matterhackers.com/store/printer-accessories/mattercontrol-donation"); };
return matterControlDonateLink;
}
public static void InsertAttributionText(GuiWidget topToBottom, LinkButtonFactory linkButtonFactory)
{
// slicer credit
{
FlowLayoutWidget donateTextContainer = new FlowLayoutWidget();
TextWidget thanksText = new TextWidget("Special thanks to Alessandro Ranellucci for his incredible work on ".Localize(), textColor: RGBA_Bytes.White);
TextWidget thanksText = new TextWidget("Special thanks to Alessandro Ranellucci for his incredible work on ".Localize() ,textColor: ActiveTheme.Instance.PrimaryTextColor);
donateTextContainer.AddChild(thanksText);
Button slic3rOrgLink = linkButtonFactory.Generate("Slic3r");
//slic3rOrgLink.VAnchor = Agg.UI.VAnchor.Bottom;
@ -521,14 +546,14 @@ namespace MatterHackers.MatterControl
// cura engine credit
{
FlowLayoutWidget curaEngineTextContanier = new FlowLayoutWidget();
TextWidget donateStartText = new TextWidget("and to David Braam and Ultimaker BV, for the amazing ".Localize(), textColor: RGBA_Bytes.White);
TextWidget donateStartText = new TextWidget("and to David Braam and Ultimaker BV, for the amazing ".Localize(), textColor: ActiveTheme.Instance.PrimaryTextColor);
curaEngineTextContanier.AddChild(donateStartText);
Button curaEngineSourceLink = linkButtonFactory.Generate("CuraEngine");
curaEngineSourceLink.OriginRelativeParent = new VectorMath.Vector2(curaEngineSourceLink.OriginRelativeParent.x, curaEngineSourceLink.OriginRelativeParent.y + donateStartText.Printer.TypeFaceStyle.DescentInPixels);
curaEngineSourceLink.Click += (sender, mouseEvent) => { System.Diagnostics.Process.Start("https://github.com/Ultimaker/CuraEngine"); };
curaEngineTextContanier.AddChild(curaEngineSourceLink);
curaEngineTextContanier.AddChild(new TextWidget(".", textColor: RGBA_Bytes.White));
curaEngineTextContanier.AddChild(new TextWidget(".", textColor: ActiveTheme.Instance.PrimaryTextColor));
curaEngineTextContanier.HAnchor = Agg.UI.HAnchor.ParentCenter;
topToBottom.AddChild(curaEngineTextContanier);
@ -581,7 +606,7 @@ namespace MatterHackers.MatterControl
}
#endif
graphics2D.FillRectangle(new RectangleDouble(0, this.Height - 1, this.Width, this.Height), RGBA_Bytes.White);
graphics2D.FillRectangle(new RectangleDouble(0, this.Height - 1, this.Width, this.Height), ActiveTheme.Instance.PrimaryTextColor);
base.OnDraw(graphics2D);
}
}

View file

@ -96,25 +96,24 @@ namespace MatterHackers.MatterControl
mainControlsTabControl.TabBar.Margin = new BorderDouble(0, 0);
mainControlsTabControl.TabBar.Padding = new BorderDouble(0, 2);
QueueTabPage = new TabPage(new QueueControlsWidget(), "Queue");
QueueTabPage = new TabPage(new QueueControlsWidget(), "QUEUE");
NumQueueItemsChanged(this, null);
mainControlsTabControl.AddTab(new SimpleTextTabWidget(QueueTabPage, 18,
mainControlsTabControl.AddTab(new SimpleTextTabWidget(QueueTabPage, 16,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
//mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new GuiWidget(), "History"), 18,
// ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new GuiWidget(), LocalizedString.Get("HISTORY")), 16,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
string libraryTabLabel = LocalizedString.Get("Library");
mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new PrintLibraryWidget(), libraryTabLabel), 18,
string libraryTabLabel = LocalizedString.Get("LIBRARY");
mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new PrintLibraryWidget(), libraryTabLabel), 16,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
//mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new ToolsWidget(), "Tools"), 18,
//mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new ToolsWidget(), "Tools"), 16,
//ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
AboutTabPage = new TabPage(new AboutPage(), LocalizedString.Get("About"));
aboutTabView = new SimpleTextTabWidget(AboutTabPage, 18,
AboutTabPage = new TabPage(new AboutPage(), LocalizedString.Get("ABOUT"));
aboutTabView = new SimpleTextTabWidget(AboutTabPage, 16,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes());
mainControlsTabControl.AddTab(aboutTabView);
@ -263,18 +262,18 @@ namespace MatterHackers.MatterControl
manualPrinterControlsScrollArea.AddChild(manualPrinterControls);
//Add the tab contents for 'Advanced Controls'
string printerControlsLabel = LocalizedString.Get("Controls");
advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(manualPrinterControlsScrollArea, printerControlsLabel), 18,
string printerControlsLabel = LocalizedString.Get("CONTROLS");
advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(manualPrinterControlsScrollArea, printerControlsLabel), 16,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
string sliceSettingsLabel = LocalizedString.Get("Slice Settings");
string sliceSettingsLabel = LocalizedString.Get("SLICE SETTINGS");
sliceSettingsWidget = new SliceSettingsWidget(sliceSettingsUiState);
advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(sliceSettingsWidget, sliceSettingsLabel), 18,
advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(sliceSettingsWidget, sliceSettingsLabel), 16,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
string configurationLabel = LocalizedString.Get("Configuration");
string configurationLabel = LocalizedString.Get("CONFIGURATION");
ScrollableWidget configurationControls = new ConfigurationPage();
advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(configurationControls, configurationLabel), 18,
advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(configurationControls, configurationLabel), 16,
ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
@ -334,7 +333,7 @@ namespace MatterHackers.MatterControl
{
UpdateControl.NeedToCheckForUpdateFirstTimeEver = false;
addedUpdateMark = new NotificationWidget();
addedUpdateMark.OriginRelativeParent = new Vector2(63, 10);
addedUpdateMark.OriginRelativeParent = new Vector2(70, 10);
aboutTabView.AddChild(addedUpdateMark);
}
#endif
@ -345,13 +344,13 @@ namespace MatterHackers.MatterControl
{
addedUpdateMark.Visible = false;
}
AboutTabPage.Text = string.Format("About");
AboutTabPage.Text = string.Format("ABOUT");
}
}
void NumQueueItemsChanged(object sender, EventArgs widgetEvent)
{
string queueStringBeg = LocalizedString.Get("Queue");
string queueStringBeg = LocalizedString.Get("QUEUE");
string queueString = string.Format("{1} ({0})", PrintQueue.PrintQueueControl.Instance.Count, queueStringBeg);
QueueTabPage.Text = string.Format(queueString, PrintQueue.PrintQueueControl.Instance.Count);
}

View file

@ -405,6 +405,7 @@ namespace MatterHackers.MatterControl
TabPage QueueTabPage;
TabPage LibraryTabPage;
TabPage HistoryTabPage;
TabPage AboutTabPage;
SimpleTextTabWidget AboutTabView;
RGBA_Bytes unselectedTextColor = ActiveTheme.Instance.TabLabelUnselected;
@ -419,16 +420,20 @@ namespace MatterHackers.MatterControl
this.Margin = new BorderDouble(top: 4);
QueueTabPage = new TabPage(new QueueControlsWidget(), "QUEUE");
this.AddTab(new SimpleTextTabWidget(QueueTabPage, 16,
QueueTabPage = new TabPage(new QueueControlsWidget(), LocalizedString.Get("Queue").ToUpper());
this.AddTab(new SimpleTextTabWidget(QueueTabPage, 15,
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
LibraryTabPage = new TabPage(new PrintLibraryWidget(), "LIBRARY");
this.AddTab(new SimpleTextTabWidget(LibraryTabPage, 16,
LibraryTabPage = new TabPage(new PrintLibraryWidget(), LocalizedString.Get("Library").ToUpper());
this.AddTab(new SimpleTextTabWidget(LibraryTabPage, 15,
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
AboutTabPage = new TabPage(new AboutPage(), "ABOUT");
AboutTabView = new SimpleTextTabWidget(AboutTabPage, 16,
HistoryTabPage = new TabPage(new GuiWidget(), LocalizedString.Get("History").ToUpper());
this.AddTab(new SimpleTextTabWidget(HistoryTabPage, 15,
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()));
AboutTabPage = new TabPage(new AboutPage(), LocalizedString.Get("About").ToUpper());
AboutTabView = new SimpleTextTabWidget(AboutTabPage, 15,
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes());
this.AddTab(AboutTabView);
@ -439,7 +444,7 @@ namespace MatterHackers.MatterControl
void NumQueueItemsChanged(object sender, EventArgs widgetEvent)
{
string queueStringBeg = LocalizedString.Get("QUEUE");
string queueStringBeg = LocalizedString.Get("Queue").ToUpper();
string queueString = string.Format("{1} ({0})", PrintQueue.PrintQueueControl.Instance.Count, queueStringBeg);
QueueTabPage.Text = string.Format(queueString, PrintQueue.PrintQueueControl.Instance.Count);
}
@ -462,7 +467,7 @@ namespace MatterHackers.MatterControl
{
UpdateControl.NeedToCheckForUpdateFirstTimeEver = false;
addedUpdateMark = new NotificationWidget();
addedUpdateMark.OriginRelativeParent = new Vector2(72, 10);
addedUpdateMark.OriginRelativeParent = new Vector2(68, 7);
AboutTabView.AddChild(addedUpdateMark);
}
#else
@ -475,7 +480,7 @@ namespace MatterHackers.MatterControl
{
addedUpdateMark.Visible = false;
}
AboutTabPage.Text = string.Format("ABOUT");
AboutTabPage.Text = string.Format("About").ToUpper();
}
}

View file

@ -151,10 +151,10 @@ namespace MatterHackers.MatterControl
public RGBA_Bytes pressedBorderColor = new RGBA_Bytes(0, 0, 0, 0);
public RGBA_Bytes disabledBorderColor = new RGBA_Bytes(0, 0, 0, 0);
public RGBA_Bytes normalTextColor = RGBA_Bytes.White;
public RGBA_Bytes hoverTextColor = RGBA_Bytes.White;
public RGBA_Bytes pressedTextColor = RGBA_Bytes.White;
public RGBA_Bytes disabledTextColor = RGBA_Bytes.White;
public RGBA_Bytes normalTextColor = ActiveTheme.Instance.PrimaryTextColor;
public RGBA_Bytes hoverTextColor = ActiveTheme.Instance.PrimaryTextColor;
public RGBA_Bytes pressedTextColor = ActiveTheme.Instance.PrimaryTextColor;
public RGBA_Bytes disabledTextColor = ActiveTheme.Instance.PrimaryTextColor;
public int fontSize = 12;
public double borderWidth = 1;
public bool invertImageLocation = false;

View file

@ -255,7 +255,7 @@ namespace MatterHackers.MatterControl
this.tabLabelSelectedColor = new RGBA_Bytes(255, 255, 255);
this.tabLabelUnselectedColor = new RGBA_Bytes(180, 180, 180);
this.primaryTextColor = new RGBA_Bytes(255, 255, 255);
this.secondaryTextColor = new RGBA_Bytes(40, 40, 40);
this.secondaryTextColor = new RGBA_Bytes(240, 240, 240);
}
else

View file

@ -0,0 +1,26 @@
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MatterHackers.MatterControl.CustomWidgets
{
public class HorizontalSpacer : GuiWidget
{
public HorizontalSpacer()
{
HAnchor = Agg.UI.HAnchor.ParentLeftRight;
}
}
public class VerticalSpacer : GuiWidget
{
public VerticalSpacer()
{
VAnchor = Agg.UI.VAnchor.ParentBottomTop;
}
}
}

View file

@ -73,6 +73,7 @@
<Compile Include="ActionBar\PrintStatusRow.cs" />
<Compile Include="ApplicationView\CompactSlidePanel.cs" />
<Compile Include="ConfigurationPage\LanguageSelector.cs" />
<Compile Include="CustomWidgets\FlowSpacers.cs" />
<Compile Include="LocalizedString.cs" />
<Compile Include="PrinterCommunication\ActivePrinterProfile.cs" />
<Compile Include="ConfigurationPage\ConfigurationPage.cs" />

View file

@ -328,7 +328,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
string filamentVolumeLblFull = string.Format("{0}:", filamentVolumeLbl);
modelInfoContainer.AddChild(new TextWidget(filamentVolumeLblFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 9));
{
double filamentMm3 = gcodeViewWidget.LoadedGCode.GetFilamentCubicMm(ActiveSliceSettings.Instance.FillamentDiameter);
double filamentMm3 = gcodeViewWidget.LoadedGCode.GetFilamentCubicMm(ActiveSliceSettings.Instance.FilamentDiameter);
GuiWidget estimatedPrintTime = new TextWidget(string.Format("{0:0.00} cm3", filamentMm3 / 1000), pointSize:14, textColor: ActiveTheme.Instance.PrimaryTextColor);
//estimatedPrintTime.HAnchor = Agg.UI.HAnchor.ParentLeft;
@ -338,7 +338,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
string weightLbl = LocalizedString.Get("EST. WEIGHT");
string weightLblFull = string.Format("{0}:", weightLbl);
modelInfoContainer.AddChild(new TextWidget(weightLblFull, pointSize: 9, textColor: ActiveTheme.Instance.SecondaryTextColor));
modelInfoContainer.AddChild(new TextWidget(weightLblFull, pointSize: 9, textColor: ActiveTheme.Instance.PrimaryTextColor));
{
var density = 1.0;
string filamentType = "PLA";
@ -351,7 +351,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
density = 1.24;
}
double filamentWeightGrams = gcodeViewWidget.LoadedGCode.GetFilamentWeightGrams(ActiveSliceSettings.Instance.FillamentDiameter, density);
double filamentWeightGrams = gcodeViewWidget.LoadedGCode.GetFilamentWeightGrams(ActiveSliceSettings.Instance.FilamentDiameter, density);
GuiWidget estimatedPrintTime = new TextWidget(string.Format("{0:0.00} g", filamentWeightGrams), pointSize: 14, textColor: ActiveTheme.Instance.PrimaryTextColor);
//estimatedPrintTime.HAnchor = Agg.UI.HAnchor.ParentLeft;

View file

@ -40,7 +40,7 @@ using MatterHackers.Agg.Image;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl.PrintLibrary
namespace MatterHackers.MatterControl.CreatorPlugins
{
public class PluginChooserWindow : SystemWindow
@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
public PluginChooserWindow()
: base(360, 300)
{
Title = LocalizedString.Get("Installed Plugins");
Title = LocalizedString.Get("Installed Plugins");
FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottom.AnchorAll();
@ -150,7 +150,9 @@ namespace MatterHackers.MatterControl.PrintLibrary
//ShowAsSystemWindow();
Button cancelPresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel"));
cancelPresetsButton.Click += (sender, e) => { Close(); };
cancelPresetsButton.Click += (sender, e) => {
UiThread.RunOnIdle(CloseOnIdle);
};
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
buttonRow.HAnchor = HAnchor.ParentLeftRight;

View file

@ -54,39 +54,34 @@ namespace MatterHackers.MatterControl.PrintLibrary
Button deleteFromLibraryButton;
Button addToQueueButton;
Button searchButton;
MHTextEditWidget searchInput;
PluginChooserWindow pluginChooserWindow;
MHTextEditWidget searchInput;
public PrintLibraryWidget()
{
SetDisplayAttributes();
textImageButtonFactory.normalTextColor = RGBA_Bytes.White;
textImageButtonFactory.hoverTextColor = RGBA_Bytes.White;
textImageButtonFactory.disabledTextColor = RGBA_Bytes.White;
textImageButtonFactory.pressedTextColor = RGBA_Bytes.White;
textImageButtonFactory.borderWidth = 0;
searchButtonFactory.normalTextColor = ActiveTheme.Instance.PrimaryBackgroundColor;
searchButtonFactory.hoverTextColor = ActiveTheme.Instance.PrimaryBackgroundColor;
searchButtonFactory.disabledTextColor = ActiveTheme.Instance.PrimaryBackgroundColor;
searchButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryBackgroundColor;
searchButtonFactory.normalTextColor = RGBA_Bytes.White;
searchButtonFactory.hoverTextColor = RGBA_Bytes.White;
searchButtonFactory.disabledTextColor = RGBA_Bytes.White;
searchButtonFactory.pressedTextColor = RGBA_Bytes.White;
searchButtonFactory.borderWidth = 0;
searchButtonFactory.FixedWidth = 80;
FlowLayoutWidget allControls = new FlowLayoutWidget(FlowDirection.TopToBottom);
{
FlowLayoutWidget searchPanel = new FlowLayoutWidget();
searchPanel.BackgroundColor = new RGBA_Bytes(180, 180, 180);
searchPanel.BackgroundColor = ActiveTheme.Instance.TransparentDarkOverlay;
searchPanel.HAnchor = HAnchor.ParentLeftRight;
searchPanel.Padding = new BorderDouble(3, 3);
searchPanel.Padding = new BorderDouble(0);
{
searchInput = new MHTextEditWidget();
searchInput.Margin = new BorderDouble(6, 0);
searchInput.Margin = new BorderDouble(6, 3, 0, 0);
searchInput.HAnchor = HAnchor.ParentLeftRight;
searchInput.VAnchor = VAnchor.ParentCenter;
searchButton = searchButtonFactory.Generate(LocalizedString.Get("Search"));
searchButton.Margin = new BorderDouble(right:9);
searchButton = searchButtonFactory.Generate(LocalizedString.Get("Search"),centerText:true);
searchPanel.AddChild(searchInput);
searchPanel.AddChild(searchButton);
@ -101,14 +96,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
addToLibrary.Margin = new BorderDouble(0, 0, 3, 0);
addToLibrary.Click += new ButtonBase.ButtonEventHandler(loadFile_Click);
Button runCreator = textImageButtonFactory.Generate(LocalizedString.Get("Create"), "icon_creator_white_32x32.png");
buttonPanel.AddChild(runCreator);
runCreator.Margin = new BorderDouble(0, 0, 3, 0);
runCreator.Click += (sender, e) =>
{
OpenPluginChooserWindow();
};
addToQueueButton = textImageButtonFactory.Generate("Add to Queue");
addToQueueButton.Margin = new BorderDouble(3, 0);
addToQueueButton.Click += new ButtonBase.ButtonEventHandler(addToQueueButton_Click);
@ -137,22 +124,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
AddHandlers();
}
private void OpenPluginChooserWindow()
{
if (pluginChooserWindow == null)
{
pluginChooserWindow = new PluginChooserWindow();
pluginChooserWindow.Closed += (sender, e) =>
{
pluginChooserWindow = null;
};
pluginChooserWindow.ShowAsSystemWindow();
}
else
{
pluginChooserWindow.BringToFront();
}
}
private void AddHandlers()
{

View file

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MatterHackers.MatterControl.PrintLibrary
namespace MatterHackers.MatterControl.CreatorPlugins
{
public class CreatorInformation
{

View file

@ -147,7 +147,7 @@ namespace MatterHackers.MatterControl.PrintQueue
if (!foundAmountInGCode)
{
GCodeFile gcodeFile = new GCodeFile(gcodeFileName);
total += gcodeFile.GetFilamentCubicMm(ActiveSliceSettings.Instance.FillamentDiameter) / 1000;
total += gcodeFile.GetFilamentCubicMm(ActiveSliceSettings.Instance.FilamentDiameter) / 1000;
}
}
}

View file

@ -131,7 +131,7 @@ namespace MatterHackers.MatterControl.PrintQueue
else
{
GCodeFile gcodeFile = new GCodeFile(gcodeFileName);
total += gcodeFile.GetFilamentCubicMm(ActiveSliceSettings.Instance.FillamentDiameter) / 1000;
total += gcodeFile.GetFilamentCubicMm(ActiveSliceSettings.Instance.FilamentDiameter) / 1000;
}
}

View file

@ -14,12 +14,14 @@ using MatterHackers.Agg.UI;
using MatterHackers.VectorMath;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.CreatorPlugins;
namespace MatterHackers.MatterControl.PrintQueue
{
public class QueueControlsWidget : GuiWidget
{
TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory();
PluginChooserWindow pluginChooserWindow;
public QueueControlsWidget()
{
@ -51,6 +53,14 @@ namespace MatterHackers.MatterControl.PrintQueue
addToQueueButton.Margin = new BorderDouble(0, 0, 3, 0);
addToQueueButton.Click += new ButtonBase.ButtonEventHandler(loadFile_Click);
Button runCreator = textImageButtonFactory.Generate(LocalizedString.Get("Create"), "icon_creator_white_32x32.png");
buttonPanel1.AddChild(runCreator);
runCreator.Margin = new BorderDouble(0, 0, 3, 0);
runCreator.Click += (sender, e) =>
{
OpenPluginChooserWindow();
};
Button deleteAllFromQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Remove All"));
deleteAllFromQueueButton.Margin = new BorderDouble(3, 0);
deleteAllFromQueueButton.Click += new ButtonBase.ButtonEventHandler(deleteAllFromQueueButton_Click);
@ -82,7 +92,25 @@ namespace MatterHackers.MatterControl.PrintQueue
this.AnchorAll();
}
void createPatrsSheetsButton_Click(object sender, MouseEventArgs mouseEvent)
private void OpenPluginChooserWindow()
{
if (pluginChooserWindow == null)
{
pluginChooserWindow = new PluginChooserWindow();
pluginChooserWindow.Closed += (sender, e) =>
{
pluginChooserWindow = null;
};
pluginChooserWindow.ShowAsSystemWindow();
}
else
{
pluginChooserWindow.BringToFront();
}
}
void createPartsSheetsButton_Click(object sender, MouseEventArgs mouseEvent)
{
List<PrintItem> parts = PrintQueueControl.Instance.CreateReadOnlyPartList();

View file

@ -317,7 +317,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
get { return ParseDouble(GetActiveValue("nozzle_diameter")); }
}
public double FillamentDiameter
public double FilamentDiameter
{
get { return ParseDouble(GetActiveValue("filament_diameter")); }
}
@ -609,7 +609,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
string error = "The Min Fan Speed can only go as high as 100%.";
string details = string.Format("It is currently set to {0}.", MinFanSpeed);
string location = "Location: 'Advanced Controls' -> 'Slice Settings' -> 'Fillament' -> 'Cooling' (show all settings)";
string location = "Location: 'Advanced Controls' -> 'Slice Settings' -> 'Filament' -> 'Cooling' (show all settings)";
StyledMessageBox.ShowMessageBox(string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error");
return false;
}
@ -618,7 +618,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
string error = "The Max Fan Speed can only go as high as 100%.";
string details = string.Format("It is currently set to {0}.", MaxFanSpeed);
string location = "Location: 'Advanced Controls' -> 'Slice Settings' -> 'Fillament' -> 'Cooling' (show all settings)";
string location = "Location: 'Advanced Controls' -> 'Slice Settings' -> 'Filament' -> 'Cooling' (show all settings)";
StyledMessageBox.ShowMessageBox(string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error");
return false;
}

View file

@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop;
settingsStatusLabelContainer.Margin = new BorderDouble(0);
{
string activeSettingsLabelText = LocalizedString.Get ("Active Settings");
string activeSettingsLabelText = LocalizedString.Get ("Active Settings").ToUpper();
string activeSettingsLabelTextFull = string.Format ("{0}:", activeSettingsLabelText);
@ -104,7 +104,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
sliceEngineContainer.Margin = new BorderDouble(0,0,10,0);
sliceEngineContainer.VAnchor |= VAnchor.ParentTop;
{
string sliceEngineLabelText = LocalizedString.Get ("Slice Engine");
string sliceEngineLabelText = LocalizedString.Get("Slice Engine").ToUpper();
string sliceEngineLabelTextFull = string.Format ("{0}:", sliceEngineLabelText);
TextWidget sliceEngineLabel = new TextWidget(string.Format(sliceEngineLabelTextFull), pointSize: 10);
sliceEngineLabel.Margin = new BorderDouble(0);

View file

@ -154,7 +154,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
pageTopToBottomLayout.AddChild(noConnectionMessageContainer);
categoryTabs = new TabControl();
categoryTabs.TabBar.BorderColor = RGBA_Bytes.White;
categoryTabs.TabBar.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
categoryTabs.Margin = new BorderDouble(top: 8);
categoryTabs.AnchorAll();
List<TabBar> sideTabBarsListForLayout = new List<TabBar>();
@ -210,7 +210,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
// add in the ability to turn on and off all details settings
{
showAllDetails.TextColor = RGBA_Bytes.White;
showAllDetails.TextColor = ActiveTheme.Instance.PrimaryTextColor;
showAllDetails.Margin = new BorderDouble(right: 8);
showAllDetails.VAnchor = VAnchor.ParentCenter;
showAllDetails.Cursor = Cursors.Hand;
@ -221,7 +221,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
// add in the ability to turn on and off help text
{
showHelpBox.TextColor = RGBA_Bytes.White;
showHelpBox.TextColor = ActiveTheme.Instance.PrimaryTextColor;
showHelpBox.Margin = new BorderDouble(right: 3);
showHelpBox.VAnchor = VAnchor.ParentCenter;
showHelpBox.Cursor = Cursors.Hand;
@ -304,7 +304,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
TabControl groupTabs = new TabControl(Orientation.Vertical);
groupTabs.Margin = new BorderDouble(0, 0, 0, 5);
groupTabs.TabBar.BorderColor = RGBA_Bytes.White;
groupTabs.TabBar.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
foreach (OrganizerGroup group in category.GroupsList)
{
tabIndexForItem = 0;

View file

@ -389,7 +389,7 @@ enableOozeShield = 0;
{
double lengthToExtrudeMm = double.Parse(base.MappedValue);
// we need to convert mm of filament to mm of extrusion path
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.FillamentDiameter * MathHelper.Tau * lengthToExtrudeMm;
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.FilamentDiameter * MathHelper.Tau * lengthToExtrudeMm;
double extrusionSquareSize = ActiveSliceSettings.Instance.FirstLayerHeight * ActiveSliceSettings.Instance.NozzleDiameter;
double lineLength = amountOfFilamentCubicMms / extrusionSquareSize;

View file

@ -451,7 +451,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
double lengthToExtrudeMm = double.Parse(base.MappedValue);
// we need to convert mm of filament to mm of extrusion path
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.FillamentDiameter * MathHelper.Tau * lengthToExtrudeMm;
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.FilamentDiameter * MathHelper.Tau * lengthToExtrudeMm;
double extrusionSquareSize = ActiveSliceSettings.Instance.FirstLayerHeight * ActiveSliceSettings.Instance.NozzleDiameter;
double lineLength = amountOfFilamentCubicMms / extrusionSquareSize;

View file

@ -237,7 +237,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
#if DEBUG
if (ActivePrinterProfile.Instance.ActiveSliceEngineType == ActivePrinterProfile.SlicingEngineTypes.MatterSlice)
{
MatterSlice.MatterSlice.ProcessArgs(slicerProcess.StartInfo.Arguments);
//MatterSlice.MatterSlice.ProcessArgs(slicerProcess.StartInfo.Arguments);
}
else
#endif

View file

@ -1470,3 +1470,33 @@ Translated:Export as
English:Show file in folder after save
Translated:Show file in folder after save
English:HISTORY
Translated:HISTORY
English:LIBRARY
Translated:LIBRARY
English:Developed By:
Translated:Developed By:
English: to help support MatterControl.
Translated: to help support MatterControl.
English:ABOUT
Translated:ABOUT
English:Oops! Could not find this file
Translated:Oops! Could not find this file
English:Would you like to remove it from the queue
Translated:Would you like to remove it from the queue
English:Item not Found
Translated:Item not Found
English:Yes
Translated:Yes
English:No
Translated:No