From 63894551f94dea1756ee3671b9ea9259ac33932d Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 12 Jun 2017 16:55:07 -0700 Subject: [PATCH] Fix null reference on PopupContent object - Make base explicitly call to virtual function after content load - Remove debugging color, switch back to expected - White --- PartPreviewWindow/OverflowDropdown.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PartPreviewWindow/OverflowDropdown.cs b/PartPreviewWindow/OverflowDropdown.cs index ab57a9b1f..fe52fd6a8 100644 --- a/PartPreviewWindow/OverflowDropdown.cs +++ b/PartPreviewWindow/OverflowDropdown.cs @@ -91,14 +91,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; } - public override void ShowPopup() + protected override void BeforeShowPopup() { if (this.PopupContent.BackgroundColor == RGBA_Bytes.Transparent) { - this.PopupContent.BackgroundColor = RGBA_Bytes.Blue; + this.PopupContent.BackgroundColor = RGBA_Bytes.White; } - - base.ShowPopup(); } } @@ -149,7 +147,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow base.OnMouseUp(mouseEvent); } - public virtual void ShowPopup() + public void ShowPopup() { menuVisible = true; @@ -165,6 +163,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow return; } + this.BeforeShowPopup(); + popupWidget = new PopupWidget(this.PopupContent, this, Vector2.Zero, this.PopDirection, 0, this.AlignToRightEdge) { BorderWidth = 1, @@ -178,5 +178,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; popupWidget.Focus(); } + + protected virtual void BeforeShowPopup() + { + } } } \ No newline at end of file