From a958f041b4b2000cc213fd90fa8ca6071137c323 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 7 Jan 2015 10:38:16 -0800 Subject: [PATCH 1/2] Code to make sure object pop outs add correctly. --- ApplicationView/WidescreenPanel.cs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs index 0f6450599..b3bde1f18 100644 --- a/ApplicationView/WidescreenPanel.cs +++ b/ApplicationView/WidescreenPanel.cs @@ -166,19 +166,29 @@ namespace MatterHackers.MatterControl ColumnOne.Width = ColumnOneFixedWidth; //Ordering here matters - must go after children are added } + int columnTwoRequestCount = 0; void LoadColumnTwo(object state = null) { - ColumnTwo.CloseAndRemoveAllChildren(); - - UiThread.RunOnIdle((state2) => + columnTwoRequestCount++; + if (columnTwoRequestCount == 1) { - PartPreviewContent partViewContent = new PartPreviewContent(PrinterConnectionAndCommunication.Instance.ActivePrintItem, View3DWidget.WindowMode.Embeded, View3DWidget.AutoRotate.Enabled); - partViewContent.AnchorAll(); + ColumnTwo.CloseAndRemoveAllChildren(); - ColumnTwo.AddChild(partViewContent); - }); + UiThread.RunOnIdle((state2) => + { + PartPreviewContent partViewContent = new PartPreviewContent(PrinterConnectionAndCommunication.Instance.ActivePrintItem, View3DWidget.WindowMode.Embeded, View3DWidget.AutoRotate.Enabled); + partViewContent.AnchorAll(); - ColumnTwo.AnchorAll(); + ColumnTwo.AddChild(partViewContent); + columnTwoRequestCount--; + if (columnTwoRequestCount > 0) + { + UiThread.RunOnIdle(LoadColumnTwo); + } + }); + + ColumnTwo.AnchorAll(); + } } int NumberOfVisiblePanels() From 33c8fa45bc041f90728a4e1cf7564f5bbb3d6b96 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 7 Jan 2015 11:11:28 -0800 Subject: [PATCH 2/2] Took out millisecond display. --- PartPreviewWindow/PartPreviewMainWindow.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/PartPreviewWindow/PartPreviewMainWindow.cs b/PartPreviewWindow/PartPreviewMainWindow.cs index 40437e399..0f6af13eb 100644 --- a/PartPreviewWindow/PartPreviewMainWindow.cs +++ b/PartPreviewWindow/PartPreviewMainWindow.cs @@ -70,20 +70,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow ShowAsSystemWindow(); } -#if __ANDROID__ - Stopwatch totalDrawTime = new Stopwatch(); - AverageMillisecondTimer millisecondTimer = new AverageMillisecondTimer(); - public override void OnDraw(Graphics2D graphics2D) - { - totalDrawTime.Restart(); - base.OnDraw(graphics2D); - totalDrawTime.Stop(); - - millisecondTimer.Update((int)totalDrawTime.ElapsedMilliseconds); - millisecondTimer.Draw(graphics2D, this.Width * 3 / 4 - 15, this.Height - 40); - } -#endif - private void AddHandlers() { ActiveTheme.Instance.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents);