private FlowLayoutWidget CreateZButtons() { FlowLayoutWidget zButtons = JogControls.CreateZButtons(RGBA_Bytes.White, 4, out zPlusControl, out zMinusControl); // set these to 0 so the button does not do any movements by default (we will handle the movement on our click callback) zPlusControl.MoveAmount = 0; zMinusControl.MoveAmount = 0; zPlusControl.Click += new EventHandler(zPlusControl_Click); zMinusControl.Click += new EventHandler(zMinusControl_Click); return(zButtons); }
protected override void AddChildElements() { Button editButton; movementControlsGroupBox = new AltGroupBox(textImageButtonFactory.GenerateGroupBoxLabelWithEdit(new TextWidget("Movement Controls".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor), out editButton)); editButton.Click += (sender, e) => { if (editManualMovementSettingsWindow == null) { editManualMovementSettingsWindow = new EditManualMovementSpeedsWindow("Movement Speeds".Localize(), GetMovementSpeedsString(), SetMovementSpeeds); editManualMovementSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editManualMovementSettingsWindow = null; }; } else { editManualMovementSettingsWindow.BringToFront(); } }; movementControlsGroupBox.Margin = new BorderDouble(0); movementControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; movementControlsGroupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; movementControlsGroupBox.VAnchor = Agg.UI.VAnchor.FitToChildren; jogControls = new JogControls(new XYZColors()); jogControls.Margin = new BorderDouble(0); { manualControlsLayout = new FlowLayoutWidget(FlowDirection.TopToBottom); manualControlsLayout.HAnchor = Agg.UI.HAnchor.ParentLeftRight; manualControlsLayout.VAnchor = Agg.UI.VAnchor.FitToChildren; manualControlsLayout.Padding = new BorderDouble(3, 5, 3, 0) * TextWidget.GlobalPointSizeScaleRatio; { FlowLayoutWidget leftToRightContainer = new FlowLayoutWidget(FlowDirection.LeftToRight); manualControlsLayout.AddChild(GetHomeButtonBar()); manualControlsLayout.AddChild(CreateSeparatorLine()); manualControlsLayout.AddChild(jogControls); //manualControlsLayout.AddChild(leftToRightContainer); manualControlsLayout.AddChild(CreateSeparatorLine()); //manualControlsLayout.AddChild(GetManualMoveBar()); } movementControlsGroupBox.AddChild(manualControlsLayout); } this.AddChild(movementControlsGroupBox); }
private FlowLayoutWidget CreateZButtons() { FlowLayoutWidget zButtons = JogControls.CreateZButtons(printer, 4, out zPlusControl, out zMinusControl, new PrinterControls.XYZColors(theme), theme, true); // set these to 0 so the button does not do any movements by default (we will handle the movement on our click callback) zPlusControl.MoveAmount = 0; zPlusControl.ToolTipText += string.Format(" [{0}]", "Up Arrow".Localize()); zPlusControl.Click += zPlusControl_Click; zMinusControl.MoveAmount = 0; zMinusControl.ToolTipText += string.Format(" [{0}]", "Down Arrow".Localize()); zMinusControl.Click += zMinusControl_Click; return(zButtons); }
private MovementControls(PrinterConfig printer, XYZColors xyzColors, ThemeConfig theme) : base(FlowDirection.TopToBottom) { this.printer = printer; this.theme = theme; jogControls = new JogControls(printer, xyzColors, theme) { HAnchor = HAnchor.Left | HAnchor.Stretch, Margin = 0 }; this.AddChild(AddToDisableableList(GetHomeButtonBar())); this.AddChild(jogControls); this.AddChild(AddToDisableableList(GetHWDestinationBar())); }
protected override void AddChildElements() { Button editButton; movementControlsGroupBox = new AltGroupBox(textImageButtonFactory.GenerateGroupBoxLabelWithEdit(new TextWidget("Movement Controls".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor), out editButton)); editButton.Click += (sender, e) => { if (editManualMovementSettingsWindow == null) { editManualMovementSettingsWindow = new EditManualMovementSpeedsWindow("Movement Speeds".Localize(), GetMovementSpeedsString(), SetMovementSpeeds); editManualMovementSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editManualMovementSettingsWindow = null; }; } else { editManualMovementSettingsWindow.BringToFront(); } }; movementControlsGroupBox.Margin = new BorderDouble(0); movementControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; movementControlsGroupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; movementControlsGroupBox.VAnchor = Agg.UI.VAnchor.FitToChildren; jogControls = new JogControls(new XYZColors()); jogControls.Margin = new BorderDouble(0); { manualControlsLayout = new FlowLayoutWidget(FlowDirection.TopToBottom); manualControlsLayout.HAnchor = Agg.UI.HAnchor.ParentLeftRight; manualControlsLayout.VAnchor = Agg.UI.VAnchor.FitToChildren; manualControlsLayout.Padding = new BorderDouble(3, 5, 3, 0) * TextWidget.GlobalPointSizeScaleRatio; { FlowLayoutWidget leftToRightContainer = new FlowLayoutWidget(FlowDirection.LeftToRight); manualControlsLayout.AddChild(GetHomeButtonBar()); manualControlsLayout.AddChild(CreateSeparatorLine()); manualControlsLayout.AddChild(jogControls); //manualControlsLayout.AddChild(leftToRightContainer); manualControlsLayout.AddChild(CreateSeparatorLine()); manualControlsLayout.AddChild(GetHWDestinationBar()); manualControlsLayout.AddChild(CreateSeparatorLine()); } movementControlsGroupBox.AddChild(manualControlsLayout); } this.AddChild(movementControlsGroupBox); }