Fix null reference on PopupContent object

- Make base explicitly call to virtual function after content load
- Remove debugging color, switch back to expected - White
This commit is contained in:
John Lewin 2017-06-12 16:55:07 -07:00
parent 39e8d67327
commit 63894551f9

View file

@ -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()
{
}
}
}