Switch to gcode in the embedded view if loaded.

This commit is contained in:
Lars Brubaker 2014-12-17 16:59:09 -08:00
parent 8ea4b9bb52
commit 1085d0e66b
2 changed files with 9 additions and 8 deletions

View file

@ -62,7 +62,15 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
this.AnchorAll();
this.Load(printItem);
}
// We do this after showing the system window so that when we try and take focus of the parent window (the system window)
// it exists and can give the focus to its child the gcode window.
if (printItem != null
&& Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
{
SwitchToGcodeView();
}
}
public void Reload(PrintItemWrapper printItem)
{

View file

@ -68,13 +68,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
MinimumSize = new Vector2(400, 300);
ShowAsSystemWindow();
// We do this after showing the system window so that when we try and take focus of the parent window (the system window)
// it exists and can give the focus to its child the gcode window.
if (Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
{
partPreviewWidget.SwitchToGcodeView();
}
}
private void AddHandlers()