diff --git a/ActionBar/ActionBarPlus.cs b/ActionBar/ActionBarPlus.cs index 402a38167..5d22eaf6b 100644 --- a/ActionBar/ActionBarPlus.cs +++ b/ActionBar/ActionBarPlus.cs @@ -52,22 +52,4 @@ namespace MatterHackers.MatterControl base.OnClosed(e); } } - - internal class MessageActionRow : ActionRowBase - { - protected override void AddChildElements() - { - if (HelpTextWidget.Instance.Parent != null) - { - HelpTextWidget.Instance.Parent.RemoveChild(HelpTextWidget.Instance); - } - - this.AddChild(HelpTextWidget.Instance); - } - - protected override void Initialize() - { - this.Margin = new BorderDouble(0, 3, 0, 0); - } - } } \ No newline at end of file diff --git a/ActionBar/HelpTextWidget.cs b/ActionBar/HelpTextWidget.cs deleted file mode 100644 index 9105792cf..000000000 --- a/ActionBar/HelpTextWidget.cs +++ /dev/null @@ -1,151 +0,0 @@ -using MatterHackers.Agg; -using MatterHackers.Agg.UI; -using MatterHackers.MatterControl.PrinterCommunication; -using MatterHackers.VectorMath; -using System; - -namespace MatterHackers.MatterControl -{ - public class HelpTextWidget : TextWidget - { - private string defaultHelpMessage = ""; - private string hoverHelpMessage = ""; - - public bool showHoverText = false; - - private static HelpTextWidget globalInstance; - - public static HelpTextWidget Instance - { - get - { - if (globalInstance == null) - { - globalInstance = new HelpTextWidget(""); - } - return globalInstance; - } - } - - public void ShowHoverText(string message) - { - if (this.Text != message) - { - hoverHelpMessage = message; - if (!showHoverText) - { - showHoverText = true; - this.Invalidate(); - } - } - } - - public void HideHoverText() - { - showHoverText = false; - this.Invalidate(); - } - - public HelpTextWidget(string initialText) - : base(initialText, pointSize: 10, ellipsisIfClipped: true) - { - this.HAnchor = HAnchor.ParentLeftRight; - this.VAnchor = VAnchor.ParentCenter; - this.Margin = new BorderDouble(0); - this.TextColor = RGBA_Bytes.White; - this.MinimumSize = new Vector2(LocalBounds.Width, LocalBounds.Height); - AddHandlers(); - setHelpMessageFromStatus(); - } - - private void SetDefaultMessage(string message) - { - if (message != this.defaultHelpMessage) - { - this.defaultHelpMessage = message; - this.Invalidate(); - } - } - - private event EventHandler unregisterEvents; - - private void AddHandlers() - { - ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents); - PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents); - } - - public override void OnClosed(EventArgs e) - { - if (unregisterEvents != null) - { - unregisterEvents(this, null); - } - - base.OnClosed(e); - } - - private void onPrinterStatusChanged(object sender, EventArgs e) - { - setHelpMessageFromStatus(); - } - - public override void OnDraw(Graphics2D graphics2D) - { - if (this.showHoverText == true && this.Text != hoverHelpMessage) - { - this.Text = hoverHelpMessage; - } - else - { - if (this.Text != defaultHelpMessage) - { - this.Text = defaultHelpMessage; - } - } - - base.OnDraw(graphics2D); - } - - private void setHelpMessageFromStatus() - { - string newMessage = getHelpMessageFromStatus(); - SetDefaultMessage(newMessage); - } - - private string getHelpMessageFromStatus() - { - return ""; - //if (ActivePrinterProfile.Instance.ActivePrinter == null) - //{ - // return LocalizedString.Get("Press 'Connect' to choose a printer."); - //} - //else - //{ - // switch (PrinterCommunication.Instance.CommunicationState) - // { - // case PrinterCommunication.CommunicationStates.Disconnected: - // return LocalizedString.Get("Not connected. Press 'Connect' to enable printing."); - // case PrinterCommunication.CommunicationStates.AttemptingToConnect: - // string attemptToConnect = LocalizedString.Get ("Attempting to Connect"); - // string attemptToConnectFull = string.Format ("{0}...", attemptToConnect); - // return attemptToConnectFull; - // case PrinterCommunication.CommunicationStates.ConnectionLost: - // case PrinterCommunication.CommunicationStates.FailedToConnect: - // return LocalizedString.Get("Unable to communicate with printer."); - // case PrinterCommunication.CommunicationStates.Connected: - // if (PrinterCommunication.Instance.ActivePrintItem != null) - // { - // return LocalizedString.Get("Press 'Start' to begin your print."); - // } - // else - // { - // return LocalizedString.Get("No items to select. Press 'Add' to select a file to print."); - // } - // default: - // return ""; - // } - //} - } - } -} \ No newline at end of file diff --git a/ActionBar/PrintStatusRow.cs b/ActionBar/PrintStatusRow.cs index 92731eb11..161f9dbd3 100644 --- a/ActionBar/PrintStatusRow.cs +++ b/ActionBar/PrintStatusRow.cs @@ -224,8 +224,6 @@ namespace MatterHackers.MatterControl.ActionBar container.AddChild(activePrintStatus); //container.AddChild(activePrintInfo); container.AddChild(printActionRow); - container.AddChild(new VerticalSpacer()); - container.AddChild(new MessageActionRow()); return container; } @@ -239,8 +237,7 @@ namespace MatterHackers.MatterControl.ActionBar Button autoLevelButton = imageButtonFactory.Generate(notifyIconPath, notifyHoverIconPath); autoLevelButton.Cursor = Cursors.Hand; autoLevelButton.Margin = new Agg.BorderDouble(top: 3); - autoLevelButton.MouseEnterBounds += (sender, mouseEvent) => { HelpTextWidget.Instance.ShowHoverText("Print leveling is enabled."); }; - autoLevelButton.MouseLeaveBounds += (sender, mouseEvent) => { HelpTextWidget.Instance.HideHoverText(); }; + autoLevelButton.ToolTipText = "Print leveling is enabled.".Localize(); autoLevelButton.Visible = ActivePrinterProfile.Instance.DoPrintLeveling; ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent((sender, e) => diff --git a/ActionBar/TemperatureWidgetBed.cs b/ActionBar/TemperatureWidgetBed.cs index bc38f13b2..2557a4985 100644 --- a/ActionBar/TemperatureWidgetBed.cs +++ b/ActionBar/TemperatureWidgetBed.cs @@ -41,21 +41,14 @@ namespace MatterHackers.MatterControl.ActionBar : base("150.3°") { temperatureTypeName.Text = "Print Bed"; - AddHandlers(); setToCurrentTemperature(); ToolTipText = "Current bed temperature".Localize(); preheatButton.ToolTipText = "Preheat the Bed".Localize(); + PrinterConnectionAndCommunication.Instance.BedTemperatureRead.RegisterEvent(onTemperatureRead, ref unregisterEvents); } private event EventHandler unregisterEvents; - private void AddHandlers() - { - PrinterConnectionAndCommunication.Instance.BedTemperatureRead.RegisterEvent(onTemperatureRead, ref unregisterEvents); - this.MouseEnterBounds += onMouseEnterBounds; - this.MouseLeaveBounds += onMouseLeaveBounds; - } - public override void OnClosed(EventArgs e) { if (unregisterEvents != null) @@ -65,16 +58,6 @@ namespace MatterHackers.MatterControl.ActionBar base.OnClosed(e); } - private void onMouseEnterBounds(Object sender, EventArgs e) - { - HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("Bed Temperature")); - } - - private void onMouseLeaveBounds(Object sender, EventArgs e) - { - HelpTextWidget.Instance.HideHoverText(); - } - private void setToCurrentTemperature() { string tempDirectionIndicator = ""; diff --git a/ActionBar/TemperatureWidgetExtruder.cs b/ActionBar/TemperatureWidgetExtruder.cs index b08c7a3a0..c18e7b4f6 100644 --- a/ActionBar/TemperatureWidgetExtruder.cs +++ b/ActionBar/TemperatureWidgetExtruder.cs @@ -42,22 +42,16 @@ namespace MatterHackers.MatterControl.ActionBar : base("150.3°") { temperatureTypeName.Text = "Extruder"; - AddHandlers(); setToCurrentTemperature(); ToolTipText = "Current extruder temperature".Localize(); preheatButton.ToolTipText = "Preheat the Extruder".Localize(); + + PrinterConnectionAndCommunication.Instance.ExtruderTemperatureRead.RegisterEvent(onTemperatureRead, ref unregisterEvents); } private event EventHandler unregisterEvents; - private void AddHandlers() - { - PrinterConnectionAndCommunication.Instance.ExtruderTemperatureRead.RegisterEvent(onTemperatureRead, ref unregisterEvents); - this.MouseEnterBounds += onMouseEnterBounds; - this.MouseLeaveBounds += onMouseLeaveBounds; - } - public override void OnClosed(EventArgs e) { if (unregisterEvents != null) @@ -67,16 +61,6 @@ namespace MatterHackers.MatterControl.ActionBar base.OnClosed(e); } - private void onMouseEnterBounds(Object sender, EventArgs e) - { - HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("Extruder Temperature")); - } - - private void onMouseLeaveBounds(Object sender, EventArgs e) - { - HelpTextWidget.Instance.HideHoverText(); - } - private void setToCurrentTemperature() { string tempDirectionIndicator = ""; diff --git a/ApplicationView/CompactSlidePanel.cs b/ApplicationView/CompactSlidePanel.cs index e18b6af48..e08855cfa 100644 --- a/ApplicationView/CompactSlidePanel.cs +++ b/ApplicationView/CompactSlidePanel.cs @@ -90,8 +90,6 @@ namespace MatterHackers.MatterControl advancedControlsLinkButton.VAnchor = VAnchor.ParentBottom; advancedControlsLinkButton.Cursor = Cursors.Hand; advancedControlsLinkButton.Click += new EventHandler(AdvancedControlsButton_Click); - advancedControlsLinkButton.MouseEnterBounds += new EventHandler(onMouseEnterBoundsAdvancedControlsLink); - advancedControlsLinkButton.MouseLeaveBounds += new EventHandler(onMouseLeaveBoundsAdvancedControlsLink); GuiWidget hSpacer = new GuiWidget(); hSpacer.HAnchor = HAnchor.ParentLeftRight; @@ -107,7 +105,7 @@ namespace MatterHackers.MatterControl // do the right panel { this.RightPanel.AddChild(new PrintProgressBar()); - ThirdPanelTabView thirdPanelTabView = new ThirdPanelTabView(AdvancedControlsButton_Click, onMouseEnterBoundsPrintQueueLink, onMouseLeaveBoundsPrintQueueLink); + ThirdPanelTabView thirdPanelTabView = new ThirdPanelTabView(AdvancedControlsButton_Click); thirdPanelTabView.Name = "For - CompactSlidePanel"; this.RightPanel.AddChild(thirdPanelTabView); } @@ -134,26 +132,6 @@ namespace MatterHackers.MatterControl } } - private void onMouseEnterBoundsAdvancedControlsLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("View Manual Printer Controls and Slicing Settings")); - } - - private void onMouseLeaveBoundsAdvancedControlsLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.HideHoverText(); - } - - private void onMouseEnterBoundsPrintQueueLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("View Queue and Library")); - } - - private void onMouseLeaveBoundsPrintQueueLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.HideHoverText(); - } - public override void OnClosed(EventArgs e) { if (unregisterEvents != null) diff --git a/ApplicationView/ThirdPanelTabView.cs b/ApplicationView/ThirdPanelTabView.cs index 60d62705c..bde33b7d8 100644 --- a/ApplicationView/ThirdPanelTabView.cs +++ b/ApplicationView/ThirdPanelTabView.cs @@ -43,20 +43,14 @@ namespace MatterHackers.MatterControl private Button advancedControlsBackButton; private SliceSettingsWidget sliceSettingsWidget; private EventHandler AdvancedControlsButton_Click; - private EventHandler onMouseEnterBoundsPrintQueueLink; - private EventHandler onMouseLeaveBoundsPrintQueueLink; private TabControl advancedControls2; - public ThirdPanelTabView(EventHandler AdvancedControlsButton_Click = null, - EventHandler onMouseEnterBoundsPrintQueueLink = null, - EventHandler onMouseLeaveBoundsPrintQueueLink = null) + public ThirdPanelTabView(EventHandler AdvancedControlsButton_Click = null) { this.AdvancedControlsButton_Click = AdvancedControlsButton_Click; - this.onMouseEnterBoundsPrintQueueLink = onMouseEnterBoundsPrintQueueLink; - this.onMouseLeaveBoundsPrintQueueLink = onMouseLeaveBoundsPrintQueueLink; - advancedControls2 = CreateNewAdvancedControls(AdvancedControlsButton_Click, onMouseEnterBoundsPrintQueueLink, onMouseLeaveBoundsPrintQueueLink); + advancedControls2 = CreateNewAdvancedControls(AdvancedControlsButton_Click); AddChild(advancedControls2); @@ -81,7 +75,7 @@ namespace MatterHackers.MatterControl private static readonly string ThirdPanelTabView_AdvancedControls_CurrentTab = "ThirdPanelTabView_AdvancedControls_CurrentTab"; - private TabControl CreateNewAdvancedControls(EventHandler AdvancedControlsButton_Click, EventHandler onMouseEnterBoundsPrintQueueLink, EventHandler onMouseLeaveBoundsPrintQueueLink) + private TabControl CreateNewAdvancedControls(EventHandler AdvancedControlsButton_Click) { TabControl advancedControls = new TabControl(); @@ -105,8 +99,6 @@ namespace MatterHackers.MatterControl advancedControlsBackButton.VAnchor = VAnchor.ParentBottom; advancedControlsBackButton.Cursor = Cursors.Hand; advancedControlsBackButton.Click += new EventHandler(AdvancedControlsButton_Click); - advancedControlsBackButton.MouseEnterBounds += new EventHandler(onMouseEnterBoundsPrintQueueLink); - advancedControlsBackButton.MouseLeaveBounds += new EventHandler(onMouseLeaveBoundsPrintQueueLink); advancedControls.TabBar.AddChild(advancedControlsBackButton); } @@ -183,13 +175,9 @@ namespace MatterHackers.MatterControl if (advancedControlsBackButton != null) { advancedControlsBackButton.Click -= new EventHandler(AdvancedControlsButton_Click); - advancedControlsBackButton.MouseEnterBounds -= new EventHandler(onMouseEnterBoundsPrintQueueLink); - advancedControlsBackButton.MouseLeaveBounds -= new EventHandler(onMouseLeaveBoundsPrintQueueLink); } - advancedControls2 = CreateNewAdvancedControls(AdvancedControlsButton_Click, - onMouseEnterBoundsPrintQueueLink, - onMouseLeaveBoundsPrintQueueLink); + advancedControls2 = CreateNewAdvancedControls(AdvancedControlsButton_Click); AddChild(advancedControls2, advancedControlsIndex); // This is a hack to make the panel remain on the screen. It would be great to debug it and understand diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs index 9c4f5c3bd..3c15c64cd 100644 --- a/ApplicationView/WidescreenPanel.cs +++ b/ApplicationView/WidescreenPanel.cs @@ -94,26 +94,6 @@ namespace MatterHackers.MatterControl } } - private void onMouseEnterBoundsAdvancedControlsLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.ShowHoverText("View Manual Printer Controls and Slicing Settings"); - } - - private void onMouseLeaveBoundsAdvancedControlsLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.HideHoverText(); - } - - private void onMouseEnterBoundsPrintQueueLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.ShowHoverText("View Queue and Library"); - } - - private void onMouseLeaveBoundsPrintQueueLink(Object sender, EventArgs e) - { - HelpTextWidget.Instance.HideHoverText(); - } - public override void OnClosed(EventArgs e) { if (unregisterEvents != null) diff --git a/ControlElements/TextImageButtonFactory.cs b/ControlElements/TextImageButtonFactory.cs index 0c8f63d1e..adb69b9ac 100644 --- a/ControlElements/TextImageButtonFactory.cs +++ b/ControlElements/TextImageButtonFactory.cs @@ -184,8 +184,6 @@ namespace MatterHackers.MatterControl buttonViewWidget.Height = this.FixedHeight; textImageButton.Height = this.FixedHeight; - textImageButton.MouseEnterBounds += new EventHandler(onEnterTooltipButton); - textImageButton.MouseLeaveBounds += new EventHandler(onExitTooltipButton); return textImageButton; } @@ -238,17 +236,6 @@ namespace MatterHackers.MatterControl return groupLableAndEditControl; } - private void onEnterTooltipButton(object sender, EventArgs e) - { - Button button = sender as Button; - HelpTextWidget.Instance.ShowHoverText(button.ToolTipText); - } - - private void onExitTooltipButton(object sender, EventArgs e) - { - HelpTextWidget.Instance.HideHoverText(); - } - public CheckBox GenerateCheckBoxButton(string label, string normalImageName = null, string normalToPressedImageName = null, string pressedImageName = null, string pressedToNormalImageName = null, string pressedLabel = null) { CheckBoxViewStates checkBoxButtonViewWidget = getCheckBoxButtonView(label, normalImageName, normalToPressedImageName, pressedImageName, pressedToNormalImageName, pressedLabel); diff --git a/MatterControl.csproj b/MatterControl.csproj index 1aa4c6033..7f643c392 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -130,7 +130,6 @@ - diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 807643fef..747638533 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -3673,3 +3673,9 @@ Translated:Zoom (Ctrl + L. Mouse) English:Enter Multi Select mode Translated:Enter Multi Select mode +English:Print leveling is enabled. +Translated:Print leveling is enabled. + +English:Edit notification settings +Translated:Edit notification settings +