Made the selected gcode layer match the first layer with rendering
made the window be focused when it is in gcode mode.
This commit is contained in:
parent
2279305d50
commit
1aac699037
2 changed files with 12 additions and 6 deletions
|
|
@ -510,13 +510,16 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
navigationWidget.Margin = new BorderDouble(0, 0, 20, 0);
|
||||
layerSelectionButtonsPannel.AddChild(navigationWidget);
|
||||
|
||||
|
||||
selectLayerSlider = new Slider(new Vector2(), 10, 0, gcodeViewWidget.LoadedGCode.NumChangesInZ - 1, Orientation.Vertical);
|
||||
selectLayerSlider.ValueChanged += new EventHandler(selectLayerSlider_ValueChanged);
|
||||
gcodeViewWidget.ActiveLayerChanged += new EventHandler(gcodeViewWidget_ActiveLayerChanged);
|
||||
AddChild(selectLayerSlider);
|
||||
SetSliderSize();
|
||||
|
||||
// let's change the active layer so that it is set to the first layer with data
|
||||
gcodeViewWidget.ActiveLayerIndex = gcodeViewWidget.ActiveLayerIndex + 1;
|
||||
gcodeViewWidget.ActiveLayerIndex = gcodeViewWidget.ActiveLayerIndex - 1;
|
||||
|
||||
BoundsChanged += new EventHandler(PartPreviewGCode_BoundsChanged);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,11 +79,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
tabControl.AddTab(new SimpleTextTabWidget(layerView, 16,
|
||||
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes()));
|
||||
|
||||
if (Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
|
||||
{
|
||||
tabControl.TabBar.SwitchToPage(layerView);
|
||||
}
|
||||
|
||||
this.AddChild(tabControl);
|
||||
this.AnchorAll();
|
||||
|
||||
|
|
@ -94,6 +89,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
ShowAsSystemWindow();
|
||||
MinimumSize = new Vector2(400, 300);
|
||||
|
||||
// We do this after showing the system window so that when we try and take fucus the parent window (the system window)
|
||||
// exists and can give the fucus to its child the gecode window.
|
||||
if (Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
|
||||
{
|
||||
tabControl.TabBar.SwitchToPage(layerView);
|
||||
partGcodeView.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
PerformanceFeedbackWindow timingWindow = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue