From 9112ef6cbd6e258baf3760cfec020edb96c8d9e6 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Tue, 13 Jun 2017 13:43:51 -0700 Subject: [PATCH] Remove PreChangePanels event --- ApplicationView/AdvancedControlsPanel.cs | 1 - ApplicationView/ApplicationController.cs | 1 - ApplicationView/WidescreenPanel.cs | 25 ++---------------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/ApplicationView/AdvancedControlsPanel.cs b/ApplicationView/AdvancedControlsPanel.cs index 99c1f772e..8f98c8737 100644 --- a/ApplicationView/AdvancedControlsPanel.cs +++ b/ApplicationView/AdvancedControlsPanel.cs @@ -60,7 +60,6 @@ namespace MatterHackers.MatterControl public void ReloadSliceSettings() { - WidescreenPanel.PreChangePanels.CallEvents(null, null); if (tabControl.HasBeenClosed) { return; diff --git a/ApplicationView/ApplicationController.cs b/ApplicationView/ApplicationController.cs index e4c5eebce..897c7dbfd 100644 --- a/ApplicationView/ApplicationController.cs +++ b/ApplicationView/ApplicationController.cs @@ -682,7 +682,6 @@ namespace MatterHackers.MatterControl // give the widget a chance to hear about the close before they are actually closed. PopOutManager.SaveIfClosed = false; - WidescreenPanel.PreChangePanels.CallEvents(this, null); MainView?.CloseAllChildren(); using (new QuickTimer("ReloadAll_AddElements")) { diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs index 1fc46da41..1cd52bd45 100644 --- a/ApplicationView/WidescreenPanel.cs +++ b/ApplicationView/WidescreenPanel.cs @@ -30,13 +30,8 @@ either expressed or implied, of the FreeBSD Project. using System; using MatterHackers.Agg; using MatterHackers.Agg.UI; -using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.MatterControl.PartPreviewWindow; using MatterHackers.MatterControl.PrinterCommunication; -using MatterHackers.VectorMath; -using MatterHackers.Agg.Font; -using MatterHackers.Agg.Transform; -using MatterHackers.Agg.VertexSource; namespace MatterHackers.MatterControl { @@ -45,10 +40,6 @@ namespace MatterHackers.MatterControl private TextImageButtonFactory advancedControlsButtonFactory = new TextImageButtonFactory(); private RGBA_Bytes unselectedTextColor = ActiveTheme.Instance.TabLabelUnselected; - private EventHandler unregisterEvents; - - public static RootedObjectEventHandler PreChangePanels = new RootedObjectEventHandler(); - public WidescreenPanel() { } @@ -74,7 +65,8 @@ namespace MatterHackers.MatterControl SplitterBackground = ApplicationController.Instance.Theme.SplitterBackground }; library3DViewSplitter.AnchorAll(); - AddChild(library3DViewSplitter); + + this.AddChild(library3DViewSplitter); // put in the left column library3DViewSplitter.Panel1.AddChild(new AdvancedControlsPanel() @@ -88,19 +80,6 @@ namespace MatterHackers.MatterControl VAnchor = VAnchor.ParentBottom | VAnchor.ParentTop, HAnchor = HAnchor.ParentLeft | HAnchor.ParentRight }); - - ApplicationController.Instance.AdvancedControlsPanelReloading.RegisterEvent((s, e) => UiThread.RunOnIdle(ReloadAdvancedControlsPanel), ref unregisterEvents); - } - - public override void OnClosed(ClosedEventArgs e) - { - unregisterEvents?.Invoke(this, null); - base.OnClosed(e); - } - - public void ReloadAdvancedControlsPanel() - { - PreChangePanels.CallEvents(this, null); } }