public static FlowLayoutWidget CreateZButtons(RGBA_Bytes color, double buttonSeparationDistance, out MoveButton zPlusControl, out MoveButton zMinusControl, bool levelingButtons = false) { FlowLayoutWidget zButtons = new FlowLayoutWidget(FlowDirection.TopToBottom); { MoveButtonFactory moveButtonFactory = new MoveButtonFactory(); moveButtonFactory.Colors.Fill.Normal = color; zPlusControl = CreateMoveButton("Z+", PrinterConnectionAndCommunication.Axis.Z, MovementControls.ZSpeed, levelingButtons, moveButtonFactory); zPlusControl.Name = "Move Z positive".Localize(); zPlusControl.ToolTipText = "Move Z positive".Localize(); zButtons.AddChild(zPlusControl); GuiWidget spacer = new GuiWidget(2, buttonSeparationDistance); spacer.HAnchor = Agg.UI.HAnchor.ParentCenter; spacer.BackgroundColor = XYZColors.zColor; zButtons.AddChild(spacer); zMinusControl = CreateMoveButton("Z-", PrinterConnectionAndCommunication.Axis.Z, MovementControls.ZSpeed, levelingButtons, moveButtonFactory); zMinusControl.ToolTipText = "Move Z negative".Localize(); zButtons.AddChild(zMinusControl); } zButtons.Margin = new BorderDouble(0, 5); return(zButtons); }
public static FlowLayoutWidget CreateZButtons(RGBA_Bytes color, double buttonSeparationDistance, out MoveButton zPlusControl, out MoveButton zMinusControl) { FlowLayoutWidget zButtons = new FlowLayoutWidget(FlowDirection.TopToBottom); { MoveButtonFactory moveButtonFactory = new MoveButtonFactory(); moveButtonFactory.normalFillColor = color; zPlusControl = moveButtonFactory.Generate("Z+", PrinterConnectionAndCommunication.Axis.Z, MovementControls.ZSpeed); zButtons.AddChild(zPlusControl); GuiWidget spacer = new GuiWidget(2, buttonSeparationDistance); spacer.HAnchor = Agg.UI.HAnchor.ParentCenter; spacer.BackgroundColor = XYZColors.zColor; zButtons.AddChild(spacer); zMinusControl = moveButtonFactory.Generate("Z-", PrinterConnectionAndCommunication.Axis.Z, MovementControls.ZSpeed); zButtons.AddChild(zMinusControl); } zButtons.Margin = new BorderDouble(0, 5); return(zButtons); }
private static MoveButton CreateMoveButton(string label, PrinterConnectionAndCommunication.Axis axis, double moveSpeed, bool levelingButtons, MoveButtonFactory buttonFactory) { var button = buttonFactory.GenerateMoveButton(label, axis, moveSpeed); button.VAnchor = VAnchor.AbsolutePosition; button.HAnchor = HAnchor.AbsolutePosition; button.Height = (levelingButtons ? 45 : 40) * GuiWidget.DeviceScale; button.Width = (levelingButtons ? 90 : 40) * GuiWidget.DeviceScale; return(button); }
private static ExtrudeButton CreateExtrudeButton(string label, double moveSpeed, int extruderNumber, MoveButtonFactory buttonFactory = null) { var button = buttonFactory.GenerateExtrudeButton(label, moveSpeed, extruderNumber); button.Height = 40 * GuiWidget.DeviceScale; button.Width = 40 * GuiWidget.DeviceScale; return(button); }
public static FlowLayoutWidget CreateZButtons(RGBA_Bytes color, double buttonSeparationDistance, out MoveButton zPlusControl, out MoveButton zMinusControl) { FlowLayoutWidget zButtons = new FlowLayoutWidget(FlowDirection.TopToBottom); { MoveButtonFactory moveButtonFactory = new MoveButtonFactory(); moveButtonFactory.normalFillColor = color; zPlusControl = moveButtonFactory.Generate("Z+", PrinterCommunication.Axis.Z, ManualPrinterControls.ZSpeed); zButtons.AddChild(zPlusControl); GuiWidget spacer = new GuiWidget(2, buttonSeparationDistance); spacer.HAnchor = Agg.UI.HAnchor.ParentCenter; spacer.BackgroundColor = XYZColors.zColor; zButtons.AddChild(spacer); zMinusControl = moveButtonFactory.Generate("Z-", PrinterCommunication.Axis.Z, ManualPrinterControls.ZSpeed); zButtons.AddChild(zMinusControl); } zButtons.Margin = new BorderDouble(0, 5); return zButtons; }