From 0ef5747ca91c4f691aa8ef81a7423b5fe2ef0bdb Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 12 Aug 2015 13:16:39 -0700 Subject: [PATCH] Put in many more tool tips. --- ActionBar/ActionBarBaseControls.cs | 2 + ActionBar/PrinterActionRow.cs | 2 + ActionBar/TemperatureWidgetBase.cs | 60 +++++++------------ ActionBar/TemperatureWidgetBed.cs | 4 +- ActionBar/TemperatureWidgetExtruder.cs | 5 +- ApplicationView/MenuRow/ApplicationMenuRow.cs | 1 + Library/LibraryDataView.cs | 57 +++++++++--------- Library/PrintLibraryWidget.cs | 1 + PrinterControls/EditMacrosWindow.cs | 1 + .../ChooseConnectionWidget.cs | 1 + Queue/QueueDataWidget.cs | 1 + .../SlicePresetListWidget.cs | 2 + Submodules/agg-sharp | 2 +- 13 files changed, 69 insertions(+), 70 deletions(-) diff --git a/ActionBar/ActionBarBaseControls.cs b/ActionBar/ActionBarBaseControls.cs index 9e60419e5..08a265a07 100644 --- a/ActionBar/ActionBarBaseControls.cs +++ b/ActionBar/ActionBarBaseControls.cs @@ -246,6 +246,8 @@ namespace MatterHackers.MatterControl.ActionBar ButtonViewStates buttonView = new ButtonViewStates(buttonWidgetNormal, buttonWidgetHover, buttonWidgetPressed, buttonWidgetDisabled); buttonView.HAnchor = HAnchor.ParentLeftRight; + this.ToolTipText = "Select a printer".Localize(); + Margin = DefaultMargin; OriginRelativeParent = new Vector2(0, 0); diff --git a/ActionBar/PrinterActionRow.cs b/ActionBar/PrinterActionRow.cs index 5065d4ace..1474bc363 100644 --- a/ActionBar/PrinterActionRow.cs +++ b/ActionBar/PrinterActionRow.cs @@ -69,6 +69,7 @@ namespace MatterHackers.MatterControl.ActionBar string connectString = "Connect".Localize().ToUpper(); connectPrinterButton = actionBarButtonFactory.Generate(connectString, "icon_power_32x32.png"); + connectPrinterButton.ToolTipText = "Connect to the currently selected printer".Localize(); if (ApplicationController.Instance.WidescreenMode) { connectPrinterButton.Margin = new BorderDouble(0, 0, 3, 3); @@ -82,6 +83,7 @@ namespace MatterHackers.MatterControl.ActionBar string disconnectString = "Disconnect".Localize().ToUpper(); disconnectPrinterButton = actionBarButtonFactory.Generate(disconnectString, "icon_power_32x32.png"); + disconnectPrinterButton.ToolTipText = "Disconnect from current printer".Localize(); if (ApplicationController.Instance.WidescreenMode) { disconnectPrinterButton.Margin = new BorderDouble(0, 0, 3, 3); diff --git a/ActionBar/TemperatureWidgetBase.cs b/ActionBar/TemperatureWidgetBase.cs index 3e0617f79..11351aeea 100644 --- a/ActionBar/TemperatureWidgetBase.cs +++ b/ActionBar/TemperatureWidgetBase.cs @@ -38,8 +38,8 @@ namespace MatterHackers.MatterControl.ActionBar { internal class TemperatureWidgetBase : GuiWidget { - protected TextWidget indicatorTextWidget; - protected TextWidget labelTextWidget; + protected TextWidget currentTempIndicator; + protected TextWidget temperatureTypeName; protected Button preheatButton; protected TextImageButtonFactory whiteButtonFactory = new TextImageButtonFactory(); @@ -51,13 +51,13 @@ namespace MatterHackers.MatterControl.ActionBar { get { - return indicatorTextWidget.Text; + return currentTempIndicator.Text; } set { - if (indicatorTextWidget.Text != value) + if (currentTempIndicator.Text != value) { - indicatorTextWidget.Text = value; + currentTempIndicator.Text = value; } } } @@ -72,35 +72,22 @@ namespace MatterHackers.MatterControl.ActionBar whiteButtonFactory.normalFillColor = RGBA_Bytes.White; whiteButtonFactory.normalTextColor = RGBA_Bytes.DarkGray; - FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom); - container.AnchorAll(); - this.BackgroundColor = new RGBA_Bytes(255, 255, 255, 200); this.Margin = new BorderDouble(0, 2) * TextWidget.GlobalPointSizeScaleRatio; - GuiWidget labelContainer = new GuiWidget(); - labelContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; - labelContainer.Height = 18 * TextWidget.GlobalPointSizeScaleRatio; + temperatureTypeName = new TextWidget("", pointSize: 8); + temperatureTypeName.AutoExpandBoundsToText = true; + temperatureTypeName.HAnchor = HAnchor.ParentCenter; + temperatureTypeName.VAnchor = VAnchor.ParentTop; + temperatureTypeName.Margin = new BorderDouble(0, 3); + temperatureTypeName.TextColor = ActiveTheme.Instance.SecondaryAccentColor; + temperatureTypeName.Visible = false; - labelTextWidget = new TextWidget("", pointSize: 8); - labelTextWidget.AutoExpandBoundsToText = true; - labelTextWidget.HAnchor = HAnchor.ParentCenter; - labelTextWidget.VAnchor = VAnchor.ParentCenter; - labelTextWidget.TextColor = ActiveTheme.Instance.SecondaryAccentColor; - labelTextWidget.Visible = false; - - labelContainer.AddChild(labelTextWidget); - - GuiWidget indicatorContainer = new GuiWidget(); - indicatorContainer.AnchorAll(); - - indicatorTextWidget = new TextWidget(textValue, pointSize: 11); - indicatorTextWidget.TextColor = ActiveTheme.Instance.PrimaryAccentColor; - indicatorTextWidget.HAnchor = HAnchor.ParentCenter; - indicatorTextWidget.VAnchor = VAnchor.ParentCenter; - indicatorTextWidget.AutoExpandBoundsToText = true; - - indicatorContainer.AddChild(indicatorTextWidget); + currentTempIndicator = new TextWidget(textValue, pointSize: 11); + currentTempIndicator.TextColor = ActiveTheme.Instance.PrimaryAccentColor; + currentTempIndicator.HAnchor = HAnchor.ParentCenter; + currentTempIndicator.VAnchor = VAnchor.ParentCenter; + currentTempIndicator.AutoExpandBoundsToText = true; GuiWidget buttonContainer = new GuiWidget(); buttonContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; @@ -112,11 +99,10 @@ namespace MatterHackers.MatterControl.ActionBar buttonContainer.AddChild(preheatButton); - container.AddChild(labelContainer); - container.AddChild(indicatorContainer); - container.AddChild(buttonContainer); + this.AddChild(temperatureTypeName); + this.AddChild(currentTempIndicator); + this.AddChild(buttonContainer); - this.AddChild(container); ActiveTheme.Instance.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents); this.MouseEnterBounds += onEnterBounds; @@ -135,13 +121,13 @@ namespace MatterHackers.MatterControl.ActionBar public void ThemeChanged(object sender, EventArgs e) { - this.indicatorTextWidget.TextColor = ActiveTheme.Instance.PrimaryAccentColor; + this.currentTempIndicator.TextColor = ActiveTheme.Instance.PrimaryAccentColor; this.Invalidate(); } private void onEnterBounds(Object sender, EventArgs e) { - labelTextWidget.Visible = true; + temperatureTypeName.Visible = true; if (PrinterConnectionAndCommunication.Instance.PrinterIsConnected && !PrinterConnectionAndCommunication.Instance.PrinterIsPrinting) { preheatButton.Visible = true; @@ -150,7 +136,7 @@ namespace MatterHackers.MatterControl.ActionBar private void onLeaveBounds(Object sender, EventArgs e) { - labelTextWidget.Visible = false; + temperatureTypeName.Visible = false; preheatButton.Visible = false; } diff --git a/ActionBar/TemperatureWidgetBed.cs b/ActionBar/TemperatureWidgetBed.cs index 1fc324b26..bc38f13b2 100644 --- a/ActionBar/TemperatureWidgetBed.cs +++ b/ActionBar/TemperatureWidgetBed.cs @@ -40,9 +40,11 @@ namespace MatterHackers.MatterControl.ActionBar public TemperatureWidgetBed() : base("150.3°") { - labelTextWidget.Text = "Print Bed"; + temperatureTypeName.Text = "Print Bed"; AddHandlers(); setToCurrentTemperature(); + ToolTipText = "Current bed temperature".Localize(); + preheatButton.ToolTipText = "Preheat the Bed".Localize(); } private event EventHandler unregisterEvents; diff --git a/ActionBar/TemperatureWidgetExtruder.cs b/ActionBar/TemperatureWidgetExtruder.cs index 958e4c92c..b08c7a3a0 100644 --- a/ActionBar/TemperatureWidgetExtruder.cs +++ b/ActionBar/TemperatureWidgetExtruder.cs @@ -41,9 +41,12 @@ namespace MatterHackers.MatterControl.ActionBar public TemperatureWidgetExtruder() : base("150.3°") { - labelTextWidget.Text = "Extruder"; + temperatureTypeName.Text = "Extruder"; AddHandlers(); setToCurrentTemperature(); + + ToolTipText = "Current extruder temperature".Localize(); + preheatButton.ToolTipText = "Preheat the Extruder".Localize(); } private event EventHandler unregisterEvents; diff --git a/ApplicationView/MenuRow/ApplicationMenuRow.cs b/ApplicationView/MenuRow/ApplicationMenuRow.cs index 5b47402df..8c594a9c9 100644 --- a/ApplicationView/MenuRow/ApplicationMenuRow.cs +++ b/ApplicationView/MenuRow/ApplicationMenuRow.cs @@ -59,6 +59,7 @@ namespace MatterHackers.MatterControl linkButtonFactory.fontSize = 8; Button signInLink = linkButtonFactory.Generate("(Sign Out)"); + signInLink.ToolTipText = "Sign in to your MatterControl account".Localize(); signInLink.VAnchor = Agg.UI.VAnchor.ParentCenter; signInLink.Margin = new BorderDouble(top: 0); diff --git a/Library/LibraryDataView.cs b/Library/LibraryDataView.cs index 679dbea5a..f5861c870 100644 --- a/Library/LibraryDataView.cs +++ b/Library/LibraryDataView.cs @@ -125,38 +125,35 @@ namespace MatterHackers.MatterControl.PrintLibrary set { - if (currentLibraryProvider != value) + // unhook the update we were getting + currentLibraryProvider.DataReloaded -= libraryDataViewInstance.LibraryDataReloaded; + // and hook the new one + value.DataReloaded += libraryDataViewInstance.LibraryDataReloaded; + + bool isChildOfCurrent = value.ParentLibraryProvider == currentLibraryProvider; + + // Dispose of all children below this one. + while (!isChildOfCurrent && currentLibraryProvider != value + && currentLibraryProvider.ParentLibraryProvider != null) { - // unhook the update we were getting - currentLibraryProvider.DataReloaded -= libraryDataViewInstance.LibraryDataReloaded; - // and hook the new one - value.DataReloaded += libraryDataViewInstance.LibraryDataReloaded; - - bool isChildOfCurrent = value.ParentLibraryProvider == currentLibraryProvider; - - // Dispose of all children below this one. - while (!isChildOfCurrent && currentLibraryProvider != value - && currentLibraryProvider.ParentLibraryProvider != null) - { - LibraryProvider parent = currentLibraryProvider.ParentLibraryProvider; - currentLibraryProvider.Dispose(); - currentLibraryProvider = parent; - } - - LibraryProvider previousLibraryProvider = currentLibraryProvider; - currentLibraryProvider = value; - - if (ChangedCurrentLibraryProvider != null) - { - ChangedCurrentLibraryProvider(previousLibraryProvider, value); - } - - ClearSelectedItems(); - - this.ProviderMessage = value.StatusMessage; - - UiThread.RunOnIdle(RebuildView); + LibraryProvider parent = currentLibraryProvider.ParentLibraryProvider; + currentLibraryProvider.Dispose(); + currentLibraryProvider = parent; } + + LibraryProvider previousLibraryProvider = currentLibraryProvider; + currentLibraryProvider = value; + + if (ChangedCurrentLibraryProvider != null) + { + ChangedCurrentLibraryProvider(previousLibraryProvider, value); + } + + ClearSelectedItems(); + + this.ProviderMessage = value.StatusMessage; + + UiThread.RunOnIdle(RebuildView); } } diff --git a/Library/PrintLibraryWidget.cs b/Library/PrintLibraryWidget.cs index b6681eec1..c4e96a301 100644 --- a/Library/PrintLibraryWidget.cs +++ b/Library/PrintLibraryWidget.cs @@ -199,6 +199,7 @@ namespace MatterHackers.MatterControl.PrintLibrary // the add button { addToLibraryButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); + addToLibraryButton.ToolTipText = "Add an .stl, .amf, .gcode or .zip file to the Library".Localize(); buttonPanel.AddChild(addToLibraryButton); addToLibraryButton.Margin = new BorderDouble(0, 0, 3, 0); addToLibraryButton.Click += (sender, e) => UiThread.RunOnIdle(importToLibraryloadFile_ClickOnIdle); diff --git a/PrinterControls/EditMacrosWindow.cs b/PrinterControls/EditMacrosWindow.cs index 495305b97..4cff697bb 100644 --- a/PrinterControls/EditMacrosWindow.cs +++ b/PrinterControls/EditMacrosWindow.cs @@ -323,6 +323,7 @@ namespace MatterHackers.MatterControl } Button addMacroButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); + addMacroButton.ToolTipText = "Add an new Macro".Localize(); addMacroButton.Click += new EventHandler(addMacro_Click); Button cancelPresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Close")); diff --git a/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs b/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs index 1a512ff26..0903a89fb 100644 --- a/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs +++ b/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs @@ -147,6 +147,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections closeButton = textImageButtonFactory.Generate(LocalizedString.Get("Close")); Button addPrinterButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); + addPrinterButton.ToolTipText = "Add a new Printer Profile".Localize(); addPrinterButton.Click += new EventHandler(AddConnectionLink_Click); Button refreshListButton = textImageButtonFactory.Generate(LocalizedString.Get("Refresh")); diff --git a/Queue/QueueDataWidget.cs b/Queue/QueueDataWidget.cs index e20595b6b..8764b9d71 100644 --- a/Queue/QueueDataWidget.cs +++ b/Queue/QueueDataWidget.cs @@ -180,6 +180,7 @@ namespace MatterHackers.MatterControl.PrintQueue if (OemSettings.Instance.ShowShopButton) { shopButton = textImageButtonFactory.Generate(LocalizedString.Get("Buy Materials"), "icon_shopping_cart_32x32.png"); + shopButton.ToolTipText = "Shop online for printing materials".Localize(); buttonPanel1.AddChild(shopButton); shopButton.Margin = new BorderDouble(0, 0, 3, 0); shopButton.Click += (sender, e) => diff --git a/SlicerConfiguration/SlicePresetsWindow/SlicePresetListWidget.cs b/SlicerConfiguration/SlicePresetsWindow/SlicePresetListWidget.cs index 0dc5840e9..4c41b6792 100644 --- a/SlicerConfiguration/SlicePresetsWindow/SlicePresetListWidget.cs +++ b/SlicerConfiguration/SlicePresetsWindow/SlicePresetListWidget.cs @@ -123,6 +123,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration container.HAnchor = HAnchor.ParentLeftRight; Button addPresetButton = buttonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); + addPresetButton.ToolTipText = "Add a new Material Preset".Localize(); addPresetButton.Click += (sender, e) => { UiThread.RunOnIdle(() => @@ -132,6 +133,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration }; importPresetButton = buttonFactory.Generate(LocalizedString.Get("Import")); + importPresetButton.ToolTipText = "Import an existing Material Preset".Localize(); Button closeButton = buttonFactory.Generate(LocalizedString.Get("Close")); closeButton.Click += (sender, e) => diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index c1645a38e..5f57c69fa 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit c1645a38ee7c8496e21c8c3576759e4135e4395a +Subproject commit 5f57c69fa2c55f9767c4ed113a554f1c1d81a0b5