Refactoring VAnchor and HAnchore names
Making more debug info for show bounds
This commit is contained in:
parent
0e641e98b9
commit
f7d4163125
113 changed files with 865 additions and 859 deletions
|
|
@ -58,13 +58,13 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
Margin = 0,
|
||||
BorderColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
HAnchor = HAnchor.ParentLeftRight
|
||||
HAnchor = HAnchor.Stretch
|
||||
};
|
||||
|
||||
var topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||
{
|
||||
Margin = new BorderDouble(0, 0, 0, 0),
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Padding = new BorderDouble(3, 0, 3, 0)
|
||||
};
|
||||
|
||||
|
|
@ -82,16 +82,16 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
var row = new FlowLayoutWidget()
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = 0,
|
||||
VAnchor = VAnchor.FitToChildren
|
||||
VAnchor = VAnchor.Fit
|
||||
};
|
||||
|
||||
var feedRateDescription = new TextWidget("Speed Multiplier".Localize())
|
||||
{
|
||||
MinimumSize = new Vector2(140, 0) * GuiWidget.DeviceScale,
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
VAnchor = VAnchor.ParentCenter,
|
||||
VAnchor = VAnchor.Center,
|
||||
};
|
||||
row.AddChild(feedRateDescription);
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
Name = "Feed Rate Slider",
|
||||
Margin = new BorderDouble(5, 0),
|
||||
Value = FeedRateMultiplyerStream.FeedRateRatio,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
TotalWidthInPixels = sliderWidth,
|
||||
};
|
||||
feedRateRatioSlider.View.BackgroundColor = new RGBA_Bytes();
|
||||
|
|
@ -125,7 +125,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
Name = "Feed Rate NumberEdit",
|
||||
SelectAllOnFocus = true,
|
||||
Margin = new BorderDouble(0, 0, 5, 0),
|
||||
VAnchor = VAnchor.ParentCenter | VAnchor.FitToChildren,
|
||||
VAnchor = VAnchor.Center | VAnchor.Fit,
|
||||
Padding = 0
|
||||
};
|
||||
feedRateValue.ActuallNumberEdit.EditComplete += (sender, e) =>
|
||||
|
|
@ -148,16 +148,16 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
var row = new FlowLayoutWidget()
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = new BorderDouble(top: 10),
|
||||
VAnchor = VAnchor.FitToChildren
|
||||
VAnchor = VAnchor.Fit
|
||||
};
|
||||
|
||||
var extrusionDescription = new TextWidget("Extrusion Multiplier".Localize())
|
||||
{
|
||||
MinimumSize = new Vector2(140, 0) * GuiWidget.DeviceScale,
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
VAnchor = VAnchor.ParentCenter
|
||||
VAnchor = VAnchor.Center
|
||||
};
|
||||
row.AddChild(extrusionDescription);
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
Name = "Extrusion Multiplier Slider",
|
||||
TotalWidthInPixels = sliderWidth,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = new BorderDouble(5, 0),
|
||||
Value = ExtrusionMultiplyerStream.ExtrusionRatio
|
||||
};
|
||||
|
|
@ -190,7 +190,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
Name = "Extrusion Multiplier NumberEdit",
|
||||
SelectAllOnFocus = true,
|
||||
Margin = new BorderDouble(0, 0, 5, 0),
|
||||
VAnchor = VAnchor.ParentCenter | VAnchor.FitToChildren,
|
||||
VAnchor = VAnchor.Center | VAnchor.Fit,
|
||||
Padding = 0
|
||||
};
|
||||
extrusionValue.ActuallNumberEdit.EditComplete += (sender, e) =>
|
||||
|
|
|
|||
|
|
@ -48,15 +48,15 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
|
||||
public FanControls(int headingPointSize)
|
||||
{
|
||||
this.HAnchor = HAnchor.ParentLeftRight;
|
||||
this.HAnchor = HAnchor.ParentLeftRight;
|
||||
this.HAnchor = HAnchor.Stretch;
|
||||
this.HAnchor = HAnchor.Stretch;
|
||||
|
||||
var fanControlsGroupBox = new AltGroupBox(new TextWidget("Fan".Localize(), pointSize: headingPointSize, textColor: ActiveTheme.Instance.SecondaryAccentColor))
|
||||
{
|
||||
Margin = new BorderDouble(0),
|
||||
BorderColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
VAnchor = VAnchor.FitToChildren
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Fit
|
||||
};
|
||||
this.AddChild(fanControlsGroupBox);
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
bool fanActive = PrinterConnection.Instance.FanSpeed0To255 != 0;
|
||||
|
||||
toggleSwitch = ImageButtonFactory.CreateToggleSwitch(fanActive);
|
||||
toggleSwitch.VAnchor = VAnchor.ParentCenter;
|
||||
toggleSwitch.VAnchor = VAnchor.Center;
|
||||
toggleSwitch.CheckedStateChanged += new EventHandler(ToggleSwitch_Click);
|
||||
toggleSwitch.Margin = new BorderDouble(5, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,23 +65,23 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
var buttonFactory = ApplicationController.Instance.Theme.HomingButtons;
|
||||
|
||||
this.HAnchor = HAnchor.ParentLeftRight;
|
||||
this.HAnchor = HAnchor.Stretch;
|
||||
|
||||
// add the widgets to this window
|
||||
FlowLayoutWidget groupBox = new FlowLayoutWidget()
|
||||
{
|
||||
Padding = new BorderDouble(5),
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
BackgroundColor = ActiveTheme.Instance.TertiaryBackgroundColor,
|
||||
};
|
||||
|
||||
groupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
|
||||
groupBox.HAnchor |= Agg.UI.HAnchor.Stretch;
|
||||
// make sure the client area will get smaller when the contents get smaller
|
||||
groupBox.VAnchor = Agg.UI.VAnchor.FitToChildren;
|
||||
groupBox.VAnchor = Agg.UI.VAnchor.Fit;
|
||||
|
||||
FlowLayoutWidget controlRow = new FlowLayoutWidget(Agg.UI.FlowDirection.TopToBottom);
|
||||
controlRow.Margin = new BorderDouble(top: 5);
|
||||
controlRow.HAnchor |= HAnchor.ParentLeftRight;
|
||||
controlRow.HAnchor |= HAnchor.Stretch;
|
||||
|
||||
var macroButtonContainer = new FlowLayoutWidget();
|
||||
macroButtonContainer.Margin = new BorderDouble(0, 0, 3, 0);
|
||||
|
|
@ -121,7 +121,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
var buttonFactory = ApplicationController.Instance.Theme.HomingButtons;
|
||||
|
||||
this.HAnchor = HAnchor.ParentLeftRight;
|
||||
this.HAnchor = HAnchor.Stretch;
|
||||
|
||||
// add the widgets to this window
|
||||
Button editButton;
|
||||
|
|
@ -132,13 +132,13 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
};
|
||||
|
||||
groupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
groupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
|
||||
groupBox.HAnchor |= Agg.UI.HAnchor.Stretch;
|
||||
// make sure the client area will get smaller when the contents get smaller
|
||||
groupBox.ClientArea.VAnchor = Agg.UI.VAnchor.FitToChildren;
|
||||
groupBox.ClientArea.VAnchor = Agg.UI.VAnchor.Fit;
|
||||
|
||||
FlowLayoutWidget controlRow = new FlowLayoutWidget(Agg.UI.FlowDirection.TopToBottom);
|
||||
controlRow.Margin = new BorderDouble(top: 5);
|
||||
controlRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
controlRow.HAnchor = HAnchor.Stretch;
|
||||
{
|
||||
controlRow.AddChild(GetMacroButtonContainer(buttonFactory));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
Margin = new BorderDouble(0),
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
VAnchor = VAnchor.FitToChildren
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Fit
|
||||
};
|
||||
|
||||
editButton.Click += (sender, e) =>
|
||||
|
|
@ -137,8 +137,8 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
|
||||
manualControlsLayout = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
VAnchor = VAnchor.FitToChildren,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Fit,
|
||||
Padding = new BorderDouble(3, 0)
|
||||
};
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
private FlowLayoutWidget GetHomeButtonBar()
|
||||
{
|
||||
FlowLayoutWidget homeButtonBar = new FlowLayoutWidget();
|
||||
homeButtonBar.HAnchor = HAnchor.ParentLeftRight;
|
||||
homeButtonBar.HAnchor = HAnchor.Stretch;
|
||||
homeButtonBar.Margin = new BorderDouble(0);
|
||||
homeButtonBar.Padding = new BorderDouble(0);
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
Margin = new BorderDouble(left: 10),
|
||||
AutoExpandBoundsToText = true,
|
||||
VAnchor = VAnchor.ParentCenter
|
||||
VAnchor = VAnchor.Center
|
||||
};
|
||||
homeButtonBar.AddChild(offsetStreamLabel);
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
private FlowLayoutWidget GetHWDestinationBar()
|
||||
{
|
||||
FlowLayoutWidget hwDestinationBar = new FlowLayoutWidget();
|
||||
hwDestinationBar.HAnchor = HAnchor.ParentLeftRight;
|
||||
hwDestinationBar.HAnchor = HAnchor.Stretch;
|
||||
hwDestinationBar.Margin = new BorderDouble(3, 0, 3, 6);
|
||||
hwDestinationBar.Padding = new BorderDouble(0);
|
||||
|
||||
|
|
@ -328,8 +328,8 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
public ZTuningWidget(bool allowRemoveButton = true)
|
||||
{
|
||||
this.allowRemoveButton = allowRemoveButton;
|
||||
this.HAnchor = HAnchor.FitToChildren;
|
||||
this.VAnchor = VAnchor.FitToChildren | VAnchor.ParentCenter;
|
||||
this.HAnchor = HAnchor.Fit;
|
||||
this.VAnchor = VAnchor.Fit | VAnchor.Center;
|
||||
|
||||
ActiveSliceSettings.SettingChanged.RegisterEvent((s, e) =>
|
||||
{
|
||||
|
|
@ -343,8 +343,8 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
{
|
||||
Margin = new BorderDouble(3, 0),
|
||||
Padding = new BorderDouble(3),
|
||||
HAnchor = HAnchor.FitToChildren,
|
||||
VAnchor = VAnchor.ParentCenter,
|
||||
HAnchor = HAnchor.Fit,
|
||||
VAnchor = VAnchor.Center,
|
||||
BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor,
|
||||
Height = 20
|
||||
};
|
||||
|
|
@ -356,7 +356,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
AutoExpandBoundsToText = true,
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
Margin = new BorderDouble(5, 0, 8, 0),
|
||||
VAnchor = VAnchor.ParentCenter
|
||||
VAnchor = VAnchor.Center
|
||||
};
|
||||
zOffsetStreamContainer.AddChild(zOffsetStreamDisplay);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
AltGroupBox fanControlsGroupBox = new AltGroupBox(new TextWidget("ATX Power Control".Localize(), pointSize: headingPointSize, textColor: ActiveTheme.Instance.SecondaryAccentColor));
|
||||
fanControlsGroupBox.Margin = new BorderDouble(0);
|
||||
fanControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
fanControlsGroupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
|
||||
fanControlsGroupBox.HAnchor |= Agg.UI.HAnchor.Stretch;
|
||||
this.AddChild(fanControlsGroupBox);
|
||||
|
||||
atxPowertoggleSwitch = ImageButtonFactory.CreateToggleSwitch(false);
|
||||
|
|
@ -69,9 +69,9 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
PrinterConnection.Instance.CommunicationStateChanged.RegisterEvent(this.UpdateControlVisibility, ref unregisterEvents);
|
||||
PrinterConnection.Instance.AtxPowerStateChanged.RegisterEvent(this.UpdatePowerSwitch, ref unregisterEvents);
|
||||
|
||||
this.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
this.HAnchor = HAnchor.ParentLeftRight;
|
||||
this.VAnchor = VAnchor.ParentBottomTop;
|
||||
this.HAnchor = Agg.UI.HAnchor.Stretch;
|
||||
this.HAnchor = HAnchor.Stretch;
|
||||
this.VAnchor = VAnchor.Stretch;
|
||||
}
|
||||
|
||||
private void UpdateControlVisibility(object sender, EventArgs args)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl
|
|||
topToBottom.Padding = new BorderDouble(3, 0, 3, 5);
|
||||
|
||||
FlowLayoutWidget headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight);
|
||||
headerRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
headerRow.HAnchor = HAnchor.Stretch;
|
||||
headerRow.Margin = new BorderDouble(0, 3, 0, 0);
|
||||
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
|
||||
|
||||
|
|
@ -64,8 +64,8 @@ namespace MatterHackers.MatterControl
|
|||
string movementSpeedsLabel = LocalizedString.Get("Sampled Positions".Localize());
|
||||
TextWidget elementHeader = new TextWidget(string.Format("{0}:", movementSpeedsLabel), pointSize: 14);
|
||||
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
elementHeader.HAnchor = HAnchor.ParentLeftRight;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
elementHeader.HAnchor = HAnchor.Stretch;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.Bottom;
|
||||
|
||||
headerRow.AddChild(elementHeader);
|
||||
}
|
||||
|
|
@ -75,8 +75,8 @@ namespace MatterHackers.MatterControl
|
|||
FlowLayoutWidget presetsFormContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
//ListBox printerListContainer = new ListBox();
|
||||
{
|
||||
presetsFormContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
presetsFormContainer.VAnchor = VAnchor.ParentBottomTop;
|
||||
presetsFormContainer.HAnchor = HAnchor.Stretch;
|
||||
presetsFormContainer.VAnchor = VAnchor.Stretch;
|
||||
presetsFormContainer.Padding = new BorderDouble(3);
|
||||
presetsFormContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
|
||||
}
|
||||
|
|
@ -97,13 +97,13 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
FlowLayoutWidget leftRightEdit = new FlowLayoutWidget();
|
||||
leftRightEdit.Padding = new BorderDouble(3);
|
||||
leftRightEdit.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
|
||||
leftRightEdit.HAnchor |= Agg.UI.HAnchor.Stretch;
|
||||
TextWidget positionLabel;
|
||||
|
||||
string whichPositionText = "Position".Localize();
|
||||
positionLabel = new TextWidget("{0} {1,-5}".FormatWith(whichPositionText, row + 1), textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
|
||||
positionLabel.VAnchor = VAnchor.ParentCenter;
|
||||
positionLabel.VAnchor = VAnchor.Center;
|
||||
leftRightEdit.AddChild(positionLabel);
|
||||
|
||||
for (int axis = 0; axis < 3; axis++)
|
||||
|
|
@ -115,7 +115,7 @@ namespace MatterHackers.MatterControl
|
|||
else if (axis == 2) axisName = "z";
|
||||
|
||||
TextWidget typeEdit = new TextWidget(" {0}: ".FormatWith(axisName), textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
typeEdit.VAnchor = VAnchor.ParentCenter;
|
||||
typeEdit.VAnchor = VAnchor.Center;
|
||||
leftRightEdit.AddChild(typeEdit);
|
||||
|
||||
int linkCompatibleRow = row;
|
||||
|
|
@ -165,11 +165,11 @@ namespace MatterHackers.MatterControl
|
|||
};
|
||||
|
||||
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
|
||||
buttonRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
buttonRow.HAnchor = HAnchor.Stretch;
|
||||
buttonRow.Padding = new BorderDouble(0, 3);
|
||||
|
||||
GuiWidget hButtonSpacer = new GuiWidget();
|
||||
hButtonSpacer.HAnchor = HAnchor.ParentLeftRight;
|
||||
hButtonSpacer.HAnchor = HAnchor.Stretch;
|
||||
|
||||
buttonRow.AddChild(savePresetsButton);
|
||||
buttonRow.AddChild(hButtonSpacer);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ namespace MatterHackers.MatterControl
|
|||
topToBottom.Padding = new BorderDouble(3, 0, 3, 5);
|
||||
|
||||
FlowLayoutWidget headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight);
|
||||
headerRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
headerRow.HAnchor = HAnchor.Stretch;
|
||||
headerRow.Margin = new BorderDouble(0, 3, 0, 0);
|
||||
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
|
||||
|
||||
|
|
@ -131,8 +131,8 @@ namespace MatterHackers.MatterControl
|
|||
string editMacroLabelFull = string.Format("{0}:", editMacroLabel);
|
||||
TextWidget elementHeader = new TextWidget(editMacroLabelFull, pointSize: 14);
|
||||
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
elementHeader.HAnchor = HAnchor.ParentLeftRight;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
elementHeader.HAnchor = HAnchor.Stretch;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.Bottom;
|
||||
headerRow.AddChild(elementHeader);
|
||||
}
|
||||
|
||||
|
|
@ -140,8 +140,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
FlowLayoutWidget presetsFormContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
{
|
||||
presetsFormContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
presetsFormContainer.VAnchor = VAnchor.ParentBottomTop;
|
||||
presetsFormContainer.HAnchor = HAnchor.Stretch;
|
||||
presetsFormContainer.VAnchor = VAnchor.Stretch;
|
||||
presetsFormContainer.Padding = new BorderDouble(3);
|
||||
presetsFormContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
|
||||
}
|
||||
|
|
@ -165,11 +165,11 @@ namespace MatterHackers.MatterControl
|
|||
};
|
||||
|
||||
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
|
||||
buttonRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
buttonRow.HAnchor = HAnchor.Stretch;
|
||||
buttonRow.Padding = new BorderDouble(0, 3);
|
||||
|
||||
GuiWidget hButtonSpacer = new GuiWidget();
|
||||
hButtonSpacer.HAnchor = HAnchor.ParentLeftRight;
|
||||
hButtonSpacer.HAnchor = HAnchor.Stretch;
|
||||
|
||||
buttonRow.AddChild(addMacroButton);
|
||||
buttonRow.AddChild(hButtonSpacer);
|
||||
|
|
@ -190,27 +190,27 @@ namespace MatterHackers.MatterControl
|
|||
string macroCommandLabelTxtFull = string.Format("{0}:", macroCommandLabelTxt);
|
||||
TextWidget macroCommandLabel = new TextWidget(macroCommandLabelTxtFull, 0, 0, 12);
|
||||
macroCommandLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
macroCommandLabel.HAnchor = HAnchor.ParentLeftRight;
|
||||
macroCommandLabel.HAnchor = HAnchor.Stretch;
|
||||
macroCommandLabel.Margin = new BorderDouble(0, 0, 0, 1);
|
||||
|
||||
macroCommandInput = new MHTextEditWidget(windowController.ActiveMacro.GCode, pixelHeight: 120, multiLine: true, typeFace: ApplicationController.MonoSpacedTypeFace);
|
||||
macroCommandInput.DrawFromHintedCache();
|
||||
macroCommandInput.HAnchor = HAnchor.ParentLeftRight;
|
||||
macroCommandInput.VAnchor = VAnchor.ParentBottomTop;
|
||||
macroCommandInput.ActualTextEditWidget.VAnchor = VAnchor.ParentBottomTop;
|
||||
macroCommandInput.HAnchor = HAnchor.Stretch;
|
||||
macroCommandInput.VAnchor = VAnchor.Stretch;
|
||||
macroCommandInput.ActualTextEditWidget.VAnchor = VAnchor.Stretch;
|
||||
|
||||
string shouldBeGCodeLabel = "This should be in 'G-Code'".Localize();
|
||||
string shouldBeGCodeLabelFull = string.Format("{0}.", shouldBeGCodeLabel);
|
||||
macroCommandError = new TextWidget(shouldBeGCodeLabelFull, 0, 0, 10);
|
||||
macroCommandError.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
macroCommandError.HAnchor = HAnchor.ParentLeftRight;
|
||||
macroCommandError.HAnchor = HAnchor.Stretch;
|
||||
macroCommandError.Margin = elementMargin;
|
||||
|
||||
container.AddChild(macroCommandLabel);
|
||||
container.AddChild(macroCommandInput);
|
||||
container.AddChild(macroCommandError);
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.VAnchor = VAnchor.ParentBottomTop;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
container.VAnchor = VAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
@ -223,23 +223,23 @@ namespace MatterHackers.MatterControl
|
|||
string macroNameLabelTxtFull = string.Format("{0}:", "Macro Name".Localize());
|
||||
TextWidget macroNameLabel = new TextWidget(macroNameLabelTxtFull, 0, 0, 12);
|
||||
macroNameLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
macroNameLabel.HAnchor = HAnchor.ParentLeftRight;
|
||||
macroNameLabel.HAnchor = HAnchor.Stretch;
|
||||
macroNameLabel.Margin = new BorderDouble(0, 0, 0, 1);
|
||||
|
||||
macroNameInput = new MHTextEditWidget(GCodeMacro.FixMacroName(windowController.ActiveMacro.Name));
|
||||
macroNameInput.HAnchor = HAnchor.ParentLeftRight;
|
||||
macroNameInput.HAnchor = HAnchor.Stretch;
|
||||
|
||||
string giveMacroANameLabel = "Give the macro a name".Localize();
|
||||
string giveMacroANameLabelFull = string.Format("{0}.", giveMacroANameLabel);
|
||||
macroNameError = new TextWidget(giveMacroANameLabelFull, 0, 0, 10);
|
||||
macroNameError.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
macroNameError.HAnchor = HAnchor.ParentLeftRight;
|
||||
macroNameError.HAnchor = HAnchor.Stretch;
|
||||
macroNameError.Margin = elementMargin;
|
||||
|
||||
container.AddChild(macroNameLabel);
|
||||
container.AddChild(macroNameInput);
|
||||
container.AddChild(macroNameError);
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
@ -252,13 +252,13 @@ namespace MatterHackers.MatterControl
|
|||
showInActionMenu = new CheckBox("Show In Action Menu".Localize())
|
||||
{
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = new BorderDouble(0, 0, 0, 1),
|
||||
Checked = windowController.ActiveMacro.ActionGroup,
|
||||
};
|
||||
|
||||
container.AddChild(showInActionMenu);
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ namespace MatterHackers.MatterControl
|
|||
topToBottom.Padding = new BorderDouble(3, 0, 3, 5);
|
||||
|
||||
FlowLayoutWidget headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight);
|
||||
headerRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
headerRow.HAnchor = HAnchor.Stretch;
|
||||
headerRow.Margin = new BorderDouble(0, 3, 0, 0);
|
||||
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
|
||||
|
||||
|
|
@ -338,8 +338,8 @@ namespace MatterHackers.MatterControl
|
|||
string macroPresetsLabelFull = string.Format("{0}:", macroPresetsLabel);
|
||||
TextWidget elementHeader = new TextWidget(macroPresetsLabelFull, pointSize: 14);
|
||||
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
elementHeader.HAnchor = HAnchor.ParentLeftRight;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
elementHeader.HAnchor = HAnchor.Stretch;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.Bottom;
|
||||
headerRow.AddChild(elementHeader);
|
||||
}
|
||||
|
||||
|
|
@ -347,8 +347,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
FlowLayoutWidget presetsFormContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
{
|
||||
presetsFormContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
presetsFormContainer.VAnchor = VAnchor.ParentBottomTop;
|
||||
presetsFormContainer.HAnchor = HAnchor.Stretch;
|
||||
presetsFormContainer.VAnchor = VAnchor.Stretch;
|
||||
presetsFormContainer.Padding = new BorderDouble(3);
|
||||
presetsFormContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
|
||||
}
|
||||
|
|
@ -361,7 +361,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
FlowLayoutWidget macroRow = new FlowLayoutWidget();
|
||||
macroRow.Margin = new BorderDouble(3, 0, 3, 3);
|
||||
macroRow.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
macroRow.HAnchor = Agg.UI.HAnchor.Stretch;
|
||||
macroRow.Padding = new BorderDouble(3);
|
||||
macroRow.BackgroundColor = RGBA_Bytes.White;
|
||||
|
||||
|
|
@ -414,11 +414,11 @@ namespace MatterHackers.MatterControl
|
|||
};
|
||||
|
||||
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
|
||||
buttonRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
buttonRow.HAnchor = HAnchor.Stretch;
|
||||
buttonRow.Padding = new BorderDouble(0, 3);
|
||||
|
||||
GuiWidget hButtonSpacer = new GuiWidget();
|
||||
hButtonSpacer.HAnchor = HAnchor.ParentLeftRight;
|
||||
hButtonSpacer.HAnchor = HAnchor.Stretch;
|
||||
|
||||
buttonRow.AddChild(addMacroButton);
|
||||
buttonRow.AddChild(hButtonSpacer);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl
|
|||
topToBottom.Padding = new BorderDouble(3, 0, 3, 5);
|
||||
|
||||
FlowLayoutWidget headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight);
|
||||
headerRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
headerRow.HAnchor = HAnchor.Stretch;
|
||||
headerRow.Margin = new BorderDouble(0, 3, 0, 0);
|
||||
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
|
||||
|
||||
|
|
@ -66,8 +66,8 @@ namespace MatterHackers.MatterControl
|
|||
string movementSpeedsLabel = LocalizedString.Get("Movement Speeds Presets".Localize());
|
||||
TextWidget elementHeader = new TextWidget(string.Format("{0}:", movementSpeedsLabel), pointSize: 14);
|
||||
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
elementHeader.HAnchor = HAnchor.ParentLeftRight;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
elementHeader.HAnchor = HAnchor.Stretch;
|
||||
elementHeader.VAnchor = Agg.UI.VAnchor.Bottom;
|
||||
|
||||
headerRow.AddChild(elementHeader);
|
||||
}
|
||||
|
|
@ -77,8 +77,8 @@ namespace MatterHackers.MatterControl
|
|||
FlowLayoutWidget presetsFormContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
//ListBox printerListContainer = new ListBox();
|
||||
{
|
||||
presetsFormContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
presetsFormContainer.VAnchor = VAnchor.ParentBottomTop;
|
||||
presetsFormContainer.HAnchor = HAnchor.Stretch;
|
||||
presetsFormContainer.VAnchor = VAnchor.Stretch;
|
||||
presetsFormContainer.Padding = new BorderDouble(3);
|
||||
presetsFormContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
|
||||
}
|
||||
|
|
@ -90,15 +90,15 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
TextWidget tempTypeLabel = new TextWidget(windowTitle, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 10);
|
||||
tempTypeLabel.Margin = new BorderDouble(3);
|
||||
tempTypeLabel.HAnchor = HAnchor.ParentLeft;
|
||||
tempTypeLabel.HAnchor = HAnchor.Left;
|
||||
presetsFormContainer.AddChild(tempTypeLabel);
|
||||
|
||||
FlowLayoutWidget leftRightLabels = new FlowLayoutWidget();
|
||||
leftRightLabels.Padding = new BorderDouble(3, 6);
|
||||
leftRightLabels.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
|
||||
leftRightLabels.HAnchor |= Agg.UI.HAnchor.Stretch;
|
||||
|
||||
GuiWidget hLabelSpacer = new GuiWidget();
|
||||
hLabelSpacer.HAnchor = HAnchor.ParentLeftRight;
|
||||
hLabelSpacer.HAnchor = HAnchor.Stretch;
|
||||
|
||||
GuiWidget tempLabelContainer = new GuiWidget();
|
||||
tempLabelContainer.Width = 76;
|
||||
|
|
@ -106,8 +106,8 @@ namespace MatterHackers.MatterControl
|
|||
tempLabelContainer.Margin = new BorderDouble(3, 0);
|
||||
|
||||
TextWidget tempLabel = new TextWidget("mm/s".Localize(), textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 10);
|
||||
tempLabel.HAnchor = HAnchor.ParentLeft;
|
||||
tempLabel.VAnchor = VAnchor.ParentCenter;
|
||||
tempLabel.HAnchor = HAnchor.Left;
|
||||
tempLabel.VAnchor = VAnchor.Center;
|
||||
|
||||
tempLabelContainer.AddChild(tempLabel);
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
FlowLayoutWidget leftRightEdit = new FlowLayoutWidget();
|
||||
leftRightEdit.Padding = new BorderDouble(3);
|
||||
leftRightEdit.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
|
||||
leftRightEdit.HAnchor |= Agg.UI.HAnchor.Stretch;
|
||||
TextWidget axisLabel;
|
||||
if (settingsArray[i].StartsWith("e"))
|
||||
{
|
||||
|
|
@ -134,7 +134,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
axisLabel = new TextWidget(string.Format("{0} {1}", "Axis".Localize(), settingsArray[i].ToUpper()), textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
}
|
||||
axisLabel.VAnchor = VAnchor.ParentCenter;
|
||||
axisLabel.VAnchor = VAnchor.Center;
|
||||
leftRightEdit.AddChild(axisLabel);
|
||||
|
||||
leftRightEdit.AddChild(new HorizontalSpacer());
|
||||
|
|
@ -167,11 +167,11 @@ namespace MatterHackers.MatterControl
|
|||
};
|
||||
|
||||
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
|
||||
buttonRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
buttonRow.HAnchor = HAnchor.Stretch;
|
||||
buttonRow.Padding = new BorderDouble(0, 3);
|
||||
|
||||
GuiWidget hButtonSpacer = new GuiWidget();
|
||||
hButtonSpacer.HAnchor = HAnchor.ParentLeftRight;
|
||||
hButtonSpacer.HAnchor = HAnchor.Stretch;
|
||||
|
||||
buttonRow.AddChild(savePresetsButton);
|
||||
buttonRow.AddChild(hButtonSpacer);
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public ManualPrinterControlsDesktop()
|
||||
{
|
||||
ScrollArea.HAnchor |= HAnchor.ParentLeftRight;
|
||||
ScrollArea.HAnchor |= HAnchor.Stretch;
|
||||
AnchorAll();
|
||||
AutoScroll = true;
|
||||
|
||||
HAnchor = HAnchor.Max_FitToChildren_ParentWidth;
|
||||
VAnchor = VAnchor.ParentBottomTop;
|
||||
HAnchor = HAnchor.MaxFitOrStretch;
|
||||
VAnchor = VAnchor.Stretch;
|
||||
|
||||
var theme = ApplicationController.Instance.Theme;
|
||||
|
||||
|
|
@ -95,8 +95,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
var controlsTopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||
{
|
||||
HAnchor = HAnchor.Max_FitToChildren_ParentWidth,
|
||||
VAnchor = VAnchor.FitToChildren,
|
||||
HAnchor = HAnchor.MaxFitOrStretch,
|
||||
VAnchor = VAnchor.Fit,
|
||||
Name = "ManualPrinterControls.ControlsContainer",
|
||||
Margin = new BorderDouble(0)
|
||||
};
|
||||
|
|
@ -119,7 +119,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
var linearPanel = new FlowLayoutWidget()
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeftRight
|
||||
HAnchor = HAnchor.Stretch
|
||||
};
|
||||
controlsTopToBottomLayout.AddChild(linearPanel);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
{
|
||||
this.Selectable = true;
|
||||
this.Margin = new BorderDouble(3, 0, 3, 0);
|
||||
this.VAnchor = VAnchor.ParentBottomTop;
|
||||
this.VAnchor = VAnchor.Stretch;
|
||||
this.MouseEnter += new EventHandler(onMouse_Enter);
|
||||
this.MouseLeave += new EventHandler(onMouse_Leave);
|
||||
this.Cursor = Cursors.Hand;
|
||||
|
|
@ -206,8 +206,8 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
this.padding = padding;
|
||||
|
||||
TextWidget buttonText = new TextWidget(label, textHeight);
|
||||
buttonText.VAnchor = VAnchor.ParentCenter;
|
||||
buttonText.HAnchor = HAnchor.ParentCenter;
|
||||
buttonText.VAnchor = VAnchor.Center;
|
||||
buttonText.HAnchor = HAnchor.Center;
|
||||
buttonText.TextColor = textColor;
|
||||
|
||||
//this.AnchorAll();
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
{
|
||||
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
container.Margin = new BorderDouble(0);
|
||||
container.VAnchor = VAnchor.ParentBottomTop;
|
||||
container.VAnchor = VAnchor.Stretch;
|
||||
BorderDouble elementMargin = new BorderDouble(top: 3);
|
||||
|
||||
string baudRateLabelText = "Baud Rate".Localize();
|
||||
|
|
@ -49,14 +49,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
TextWidget baudRateLabel = new TextWidget(baudRateLabelTextFull, 0, 0, 12);
|
||||
baudRateLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
baudRateLabel.Margin = new BorderDouble(0, 0, 0, 10);
|
||||
baudRateLabel.HAnchor = HAnchor.ParentLeftRight;
|
||||
baudRateLabel.HAnchor = HAnchor.Stretch;
|
||||
|
||||
baudRateWidget = GetBaudRateWidget();
|
||||
baudRateWidget.HAnchor = HAnchor.ParentLeftRight;
|
||||
baudRateWidget.HAnchor = HAnchor.Stretch;
|
||||
|
||||
FlowLayoutWidget baudRateMessageContainer = new FlowLayoutWidget();
|
||||
baudRateMessageContainer.Margin = elementMargin;
|
||||
baudRateMessageContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
baudRateMessageContainer.HAnchor = HAnchor.Stretch;
|
||||
|
||||
printerBaudRateError = new TextWidget("Select the baud rate.".Localize(), 0, 0, 10);
|
||||
printerBaudRateError.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
|
|
@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
|
||||
printerBaudRateHelpLink = linkButtonFactory.Generate("What's this?".Localize());
|
||||
printerBaudRateHelpLink.Margin = new BorderDouble(left: 5);
|
||||
printerBaudRateHelpLink.VAnchor = VAnchor.ParentBottom;
|
||||
printerBaudRateHelpLink.VAnchor = VAnchor.Bottom;
|
||||
printerBaudRateHelpLink.Click += printerBaudRateHelp_Click;
|
||||
|
||||
printerBaudRateHelpMessage = new TextWidget("The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000.".Localize(), 0, 0, 10);
|
||||
|
|
@ -80,7 +80,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
container.AddChild(baudRateMessageContainer);
|
||||
container.AddChild(printerBaudRateHelpMessage);
|
||||
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
//flag the 'other' option if it is not and prefill the rate.
|
||||
otherBaudRateInput = new MHTextEditWidget("");
|
||||
otherBaudRateInput.Visible = false;
|
||||
otherBaudRateInput.HAnchor = HAnchor.ParentLeftRight;
|
||||
otherBaudRateInput.HAnchor = HAnchor.Stretch;
|
||||
|
||||
string currentBaudRate = ActiveSliceSettings.Instance.GetValue(SettingsKey.baud_rate);
|
||||
if (currentBaudRate != null)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
{
|
||||
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
container.Margin = new BorderDouble(0);
|
||||
container.VAnchor = VAnchor.ParentBottomTop;
|
||||
container.VAnchor = VAnchor.Stretch;
|
||||
BorderDouble elementMargin = new BorderDouble(top: 3);
|
||||
|
||||
string serialPortLabel = "Serial Port".Localize();
|
||||
|
|
@ -74,14 +74,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
TextWidget comPortLabel = new TextWidget(serialPortLabelFull, 0, 0, 12);
|
||||
comPortLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
comPortLabel.Margin = new BorderDouble(0, 0, 0, 10);
|
||||
comPortLabel.HAnchor = HAnchor.ParentLeftRight;
|
||||
comPortLabel.HAnchor = HAnchor.Stretch;
|
||||
|
||||
FlowLayoutWidget serialPortContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
CreateSerialPortControls(serialPortContainer, null);
|
||||
|
||||
FlowLayoutWidget comPortMessageContainer = new FlowLayoutWidget();
|
||||
comPortMessageContainer.Margin = elementMargin;
|
||||
comPortMessageContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
comPortMessageContainer.HAnchor = HAnchor.Stretch;
|
||||
|
||||
printerComPortError = new TextWidget("Currently available serial ports.".Localize(), 0, 0, 10);
|
||||
printerComPortError.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
|
|
@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
|
||||
printerComPortHelpLink = linkButtonFactory.Generate("What's this?".Localize());
|
||||
printerComPortHelpLink.Margin = new BorderDouble(left: 5);
|
||||
printerComPortHelpLink.VAnchor = VAnchor.ParentBottom;
|
||||
printerComPortHelpLink.VAnchor = VAnchor.Bottom;
|
||||
printerComPortHelpLink.Click += (s, e) => printerComPortHelpMessage.Visible = !printerComPortHelpMessage.Visible;
|
||||
|
||||
printerComPortHelpMessage = new TextWidget("The 'Serial Port' section lists all available serial\nports on your device. Changing which USB port the printer\nis connected to may change the associated serial port.\n\nTip: If you are uncertain, unplug/plug in your printer\nand hit refresh. The new port that appears should be\nyour printer.".Localize(), 0, 0, 10);
|
||||
|
|
@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
container.AddChild(comPortMessageContainer);
|
||||
container.AddChild(printerComPortHelpMessage);
|
||||
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
{
|
||||
SerialPortIndexRadioButton comPortOption = new SerialPortIndexRadioButton(portName, portName)
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeft,
|
||||
HAnchor = HAnchor.Left,
|
||||
Margin = new BorderDouble(3, 3, 5, 3),
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
Checked = isActivePrinterPort
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
public FlowLayoutWidget createPrinterConnectionMessageContainer()
|
||||
{
|
||||
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
container.VAnchor = VAnchor.ParentBottomTop;
|
||||
container.VAnchor = VAnchor.Stretch;
|
||||
container.Margin = new BorderDouble(5);
|
||||
BorderDouble elementMargin = new BorderDouble(top: 5);
|
||||
|
||||
TextWidget printerMessageOne = new TextWidget("MatterControl will now attempt to auto-detect printer.".Localize(), 0, 0, 10);
|
||||
printerMessageOne.Margin = new BorderDouble(0, 10, 0, 5);
|
||||
printerMessageOne.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerMessageOne.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerMessageOne.HAnchor = HAnchor.Stretch;
|
||||
printerMessageOne.Margin = elementMargin;
|
||||
|
||||
string printerMessageTwoTxt = "Disconnect printer".Localize();
|
||||
|
|
@ -44,7 +44,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
string printerMessageTwoTxtFull = string.Format("1.) {0} ({1}).", printerMessageTwoTxt, printerMessageTwoTxtEnd);
|
||||
TextWidget printerMessageTwo = new TextWidget(printerMessageTwoTxtFull, 0, 0, 12);
|
||||
printerMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerMessageTwo.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerMessageTwo.HAnchor = HAnchor.Stretch;
|
||||
printerMessageTwo.Margin = elementMargin;
|
||||
|
||||
string printerMessageThreeTxt = "Press".Localize();
|
||||
|
|
@ -52,17 +52,17 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
string printerMessageThreeFull = string.Format("2.) {0} '{1}'.", printerMessageThreeTxt, printerMessageThreeTxtEnd);
|
||||
TextWidget printerMessageThree = new TextWidget(printerMessageThreeFull, 0, 0, 12);
|
||||
printerMessageThree.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerMessageThree.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerMessageThree.HAnchor = HAnchor.Stretch;
|
||||
printerMessageThree.Margin = elementMargin;
|
||||
|
||||
GuiWidget vSpacer = new GuiWidget();
|
||||
vSpacer.VAnchor = VAnchor.ParentBottomTop;
|
||||
vSpacer.VAnchor = VAnchor.Stretch;
|
||||
|
||||
string setupManualConfigurationOrSkipConnectionText = LocalizedString.Get(("You can also"));
|
||||
string setupManualConfigurationOrSkipConnectionTextFull = String.Format("{0}:", setupManualConfigurationOrSkipConnectionText);
|
||||
TextWidget setupManualConfigurationOrSkipConnectionWidget = new TextWidget(setupManualConfigurationOrSkipConnectionTextFull, 0, 0, 10);
|
||||
setupManualConfigurationOrSkipConnectionWidget.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
setupManualConfigurationOrSkipConnectionWidget.HAnchor = HAnchor.ParentLeftRight;
|
||||
setupManualConfigurationOrSkipConnectionWidget.HAnchor = HAnchor.Stretch;
|
||||
setupManualConfigurationOrSkipConnectionWidget.Margin = elementMargin;
|
||||
|
||||
Button manualLink = linkButtonFactory.Generate("Manually Configure Connection".Localize());
|
||||
|
|
@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
string printerMessageFourText = "or".Localize();
|
||||
TextWidget printerMessageFour = new TextWidget(printerMessageFourText, 0, 0, 10);
|
||||
printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerMessageFour.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerMessageFour.HAnchor = HAnchor.Stretch;
|
||||
printerMessageFour.Margin = elementMargin;
|
||||
|
||||
Button skipConnectionLink = linkButtonFactory.Generate("Skip Connection Setup".Localize());
|
||||
|
|
@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
container.AddChild(printerMessageFour);
|
||||
container.AddChild(skipConnectionLink);
|
||||
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
public FlowLayoutWidget createPrinterConnectionMessageContainer()
|
||||
{
|
||||
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
container.VAnchor = VAnchor.ParentBottomTop;
|
||||
container.VAnchor = VAnchor.Stretch;
|
||||
container.Margin = new BorderDouble(5);
|
||||
BorderDouble elementMargin = new BorderDouble(top: 5);
|
||||
|
||||
|
|
@ -60,14 +60,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
TextWidget printerMessageOne = new TextWidget(printerMessageOneText, 0, 0, 10);
|
||||
printerMessageOne.Margin = new BorderDouble(0, 10, 0, 5);
|
||||
printerMessageOne.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerMessageOne.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerMessageOne.HAnchor = HAnchor.Stretch;
|
||||
printerMessageOne.Margin = elementMargin;
|
||||
|
||||
string printerMessageFourBeg = "Connect printer and power on".Localize();
|
||||
string printerMessageFourFull = string.Format("1.) {0}.", printerMessageFourBeg);
|
||||
TextWidget printerMessageFour = new TextWidget(printerMessageFourFull, 0, 0, 12);
|
||||
printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerMessageFour.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerMessageFour.HAnchor = HAnchor.Stretch;
|
||||
printerMessageFour.Margin = elementMargin;
|
||||
|
||||
string printerMessageFiveTxtBeg = "Press".Localize();
|
||||
|
|
@ -75,11 +75,11 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
string printerMessageFiveTxtFull = string.Format("2.) {0} '{1}'.", printerMessageFiveTxtBeg, printerMessageFiveTxtEnd);
|
||||
TextWidget printerMessageFive = new TextWidget(printerMessageFiveTxtFull, 0, 0, 12);
|
||||
printerMessageFive.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerMessageFive.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerMessageFive.HAnchor = HAnchor.Stretch;
|
||||
printerMessageFive.Margin = elementMargin;
|
||||
|
||||
GuiWidget vSpacer = new GuiWidget();
|
||||
vSpacer.VAnchor = VAnchor.ParentBottomTop;
|
||||
vSpacer.VAnchor = VAnchor.Stretch;
|
||||
|
||||
Button manualLink = linkButtonFactory.Generate("Manual Configuration".Localize());
|
||||
manualLink.Margin = new BorderDouble(0, 5);
|
||||
|
|
@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
printerErrorMessage = new TextWidget("", 0, 0, 10);
|
||||
printerErrorMessage.AutoExpandBoundsToText = true;
|
||||
printerErrorMessage.TextColor = RGBA_Bytes.Red;
|
||||
printerErrorMessage.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerErrorMessage.HAnchor = HAnchor.Stretch;
|
||||
printerErrorMessage.Margin = elementMargin;
|
||||
|
||||
container.AddChild(printerMessageOne);
|
||||
|
|
@ -97,7 +97,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
container.AddChild(vSpacer);
|
||||
container.AddChild(manualLink);
|
||||
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,18 +61,18 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
|
||||
printerDriverMessage = new TextWidget("This printer requires a driver for communication.".Localize(), 0, 0, 10);
|
||||
printerDriverMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerDriverMessage.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerDriverMessage.HAnchor = HAnchor.Stretch;
|
||||
printerDriverMessage.Margin = elementMargin;
|
||||
|
||||
TextWidget printerDriverMessageTwo = new TextWidget("Driver located. Would you like to install?".Localize(), 0, 0, 10);
|
||||
printerDriverMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
printerDriverMessageTwo.HAnchor = HAnchor.ParentLeftRight;
|
||||
printerDriverMessageTwo.HAnchor = HAnchor.Stretch;
|
||||
printerDriverMessageTwo.Margin = elementMargin;
|
||||
|
||||
container.AddChild(printerDriverMessage);
|
||||
container.AddChild(printerDriverMessageTwo);
|
||||
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
{
|
||||
printerManufacturerSelector = new BoundDropList(string.Format("- {0} -", "Select Make".Localize()), maxHeight: 200)
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = elementMargin,
|
||||
Name = "Select Make",
|
||||
ListSource = OemSettings.Instance.AllOems,
|
||||
|
|
@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
printerModelSelector = new BoundDropList(string.Format("- {0} -", "Select Model".Localize()), maxHeight: 200)
|
||||
{
|
||||
Name = "Select Model",
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = elementMargin,
|
||||
TabStop = true
|
||||
};
|
||||
|
|
@ -126,20 +126,20 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
TextWidget printerNameLabel = new TextWidget("Name".Localize() + ":", 0, 0, 12)
|
||||
{
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = new BorderDouble(0, 4, 0, 1)
|
||||
};
|
||||
|
||||
printerNameInput = new MHTextEditWidget("")
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
};
|
||||
printerNameInput.KeyPressed += (s, e) => this.usingDefaultName = false;
|
||||
|
||||
printerNameError = new TextWidget("", 0, 0, 10)
|
||||
{
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = new BorderDouble(top: 3)
|
||||
};
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
container.AddChild(printerNameLabel);
|
||||
container.AddChild(printerNameInput);
|
||||
container.AddChild(printerNameError);
|
||||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.HAnchor = HAnchor.Stretch;
|
||||
|
||||
return container;
|
||||
}
|
||||
|
|
@ -158,14 +158,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
var sectionLabel = new TextWidget(labelText, 0, 0, 12)
|
||||
{
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = elementMargin
|
||||
};
|
||||
|
||||
var validationTextWidget = new TextWidget(validationMessage, 0, 0, 10)
|
||||
{
|
||||
TextColor = ActiveTheme.Instance.SecondaryAccentColor,
|
||||
HAnchor = HAnchor.ParentLeftRight,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
Margin = elementMargin
|
||||
};
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
var container = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||
{
|
||||
Margin = new BorderDouble(0, 5),
|
||||
HAnchor = HAnchor.ParentLeftRight
|
||||
HAnchor = HAnchor.Stretch
|
||||
};
|
||||
|
||||
container.AddChild(sectionLabel);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
|||
{
|
||||
contentRow.AddChild(new TextWidget("• " + v1)
|
||||
{
|
||||
HAnchor = HAnchor.ParentLeft,
|
||||
HAnchor = HAnchor.Left,
|
||||
TextColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
Margin = new Agg.BorderDouble(0, 0, 0, 10),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -67,19 +67,19 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
{
|
||||
FlowLayoutWidget manualEntryTopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
manualEntryTopToBottomLayout.VAnchor |= Agg.UI.VAnchor.ParentTop;
|
||||
manualEntryTopToBottomLayout.VAnchor |= Agg.UI.VAnchor.Top;
|
||||
manualEntryTopToBottomLayout.Padding = new BorderDouble(top: 8);
|
||||
|
||||
{
|
||||
FlowLayoutWidget topBarControls = new FlowLayoutWidget(FlowDirection.LeftToRight);
|
||||
topBarControls.HAnchor |= HAnchor.ParentLeft;
|
||||
topBarControls.HAnchor |= HAnchor.Left;
|
||||
|
||||
{
|
||||
filterOutput = new CheckBox("Filter Output".Localize())
|
||||
{
|
||||
Margin = new BorderDouble(5, 5, 5, 2),
|
||||
TextColor = this.textColor,
|
||||
VAnchor = Agg.UI.VAnchor.ParentBottom,
|
||||
VAnchor = Agg.UI.VAnchor.Bottom,
|
||||
};
|
||||
filterOutput.CheckedStateChanged += (object sender, EventArgs e) =>
|
||||
{
|
||||
|
|
@ -103,7 +103,7 @@ namespace MatterHackers.MatterControl
|
|||
autoUppercase.Margin = new BorderDouble(5, 5, 5, 2);
|
||||
autoUppercase.Checked = UserSettings.Instance.Fields.GetBool(TerminalAutoUppercaseKey, true);
|
||||
autoUppercase.TextColor = this.textColor;
|
||||
autoUppercase.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
autoUppercase.VAnchor = Agg.UI.VAnchor.Bottom;
|
||||
topBarControls.AddChild(autoUppercase);
|
||||
autoUppercase.CheckedStateChanged += (sender, e) =>
|
||||
{
|
||||
|
|
@ -122,8 +122,8 @@ namespace MatterHackers.MatterControl
|
|||
Debug.WriteLine(PrinterConnection.Instance.TerminalLog.PrinterLines);
|
||||
textScrollWidget.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
|
||||
textScrollWidget.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
textScrollWidget.HAnchor = HAnchor.ParentLeftRight;
|
||||
textScrollWidget.VAnchor = VAnchor.ParentBottomTop;
|
||||
textScrollWidget.HAnchor = HAnchor.Stretch;
|
||||
textScrollWidget.VAnchor = VAnchor.Stretch;
|
||||
textScrollWidget.Margin = new BorderDouble(0, 5);
|
||||
textScrollWidget.Padding = new BorderDouble(3, 0);
|
||||
|
||||
|
|
@ -137,13 +137,13 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
FlowLayoutWidget manualEntryLayout = new FlowLayoutWidget(FlowDirection.LeftToRight);
|
||||
manualEntryLayout.BackgroundColor = this.backgroundColor;
|
||||
manualEntryLayout.HAnchor = HAnchor.ParentLeftRight;
|
||||
manualEntryLayout.HAnchor = HAnchor.Stretch;
|
||||
{
|
||||
manualCommandTextEdit = new MHTextEditWidget("", typeFace: ApplicationController.MonoSpacedTypeFace);
|
||||
//manualCommandTextEdit.BackgroundColor = RGBA_Bytes.White;
|
||||
manualCommandTextEdit.Margin = new BorderDouble(right: 3);
|
||||
manualCommandTextEdit.HAnchor = HAnchor.ParentLeftRight;
|
||||
manualCommandTextEdit.VAnchor = VAnchor.ParentBottom;
|
||||
manualCommandTextEdit.HAnchor = HAnchor.Stretch;
|
||||
manualCommandTextEdit.VAnchor = VAnchor.Bottom;
|
||||
manualCommandTextEdit.ActualTextEditWidget.EnterPressed += manualCommandTextEdit_EnterPressed;
|
||||
manualCommandTextEdit.ActualTextEditWidget.KeyDown += manualCommandTextEdit_KeyDown;
|
||||
manualEntryLayout.AddChild(manualCommandTextEdit);
|
||||
|
|
@ -175,7 +175,7 @@ namespace MatterHackers.MatterControl
|
|||
sendCommand.Click += sendManualCommandToPrinter_Click;
|
||||
|
||||
FlowLayoutWidget bottomRowContainer = new FlowLayoutWidget();
|
||||
bottomRowContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
bottomRowContainer.HAnchor = Agg.UI.HAnchor.Stretch;
|
||||
bottomRowContainer.Margin = new BorderDouble(0, 3);
|
||||
|
||||
bottomRowContainer.AddChild(sendCommand);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
this.textScrollWidget = textScrollWidget;
|
||||
Margin = new BorderDouble(0, 5);
|
||||
VAnchor = Agg.UI.VAnchor.ParentBottomTop;
|
||||
VAnchor = Agg.UI.VAnchor.Stretch;
|
||||
BackgroundColor = RGBA_Bytes.LightGray;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
FlowLayoutWidget allControlsTopToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
|
||||
allControlsTopToBottom.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
|
||||
allControlsTopToBottom.HAnchor |= Agg.UI.HAnchor.Stretch;
|
||||
|
||||
{
|
||||
FlowLayoutWidget allControlsLeftToRight = new FlowLayoutWidget();
|
||||
|
|
@ -83,7 +83,7 @@ namespace MatterHackers.MatterControl
|
|||
xYZControls.AddChild(xyGrid);
|
||||
|
||||
FlowLayoutWidget zButtons = CreateZButtons(XYZColors.zColor, buttonSeparationDistance, out zPlusControl, out zMinusControl);
|
||||
zButtons.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
zButtons.VAnchor = Agg.UI.VAnchor.Bottom;
|
||||
xYZControls.AddChild(zButtons);
|
||||
xYZWithDistance.AddChild(xYZControls);
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ namespace MatterHackers.MatterControl
|
|||
// add in some movement radio buttons
|
||||
FlowLayoutWidget setMoveDistanceControl = new FlowLayoutWidget();
|
||||
TextWidget buttonsLabel = new TextWidget("Distance:", textColor: RGBA_Bytes.White);
|
||||
buttonsLabel.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
buttonsLabel.VAnchor = Agg.UI.VAnchor.Center;
|
||||
//setMoveDistanceControl.AddChild(buttonsLabel);
|
||||
|
||||
{
|
||||
|
|
@ -102,40 +102,40 @@ namespace MatterHackers.MatterControl
|
|||
var radioList = new ObservableCollection<GuiWidget>();
|
||||
|
||||
movePointZeroTwoMmButton = buttonFactory.GenerateRadioButton("0.02");
|
||||
movePointZeroTwoMmButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
movePointZeroTwoMmButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
movePointZeroTwoMmButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetXYZMoveAmount(.02); };
|
||||
movePointZeroTwoMmButton.SiblingRadioButtonList = radioList;
|
||||
moveRadioButtons.AddChild(movePointZeroTwoMmButton);
|
||||
|
||||
RadioButton pointOneButton = buttonFactory.GenerateRadioButton("0.1");
|
||||
pointOneButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
pointOneButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
pointOneButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetXYZMoveAmount(.1); };
|
||||
pointOneButton.SiblingRadioButtonList = radioList;
|
||||
moveRadioButtons.AddChild(pointOneButton);
|
||||
|
||||
moveOneMmButton = buttonFactory.GenerateRadioButton("1");
|
||||
moveOneMmButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
moveOneMmButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
moveOneMmButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetXYZMoveAmount(1); };
|
||||
moveOneMmButton.SiblingRadioButtonList = radioList;
|
||||
moveRadioButtons.AddChild(moveOneMmButton);
|
||||
|
||||
tooBigForBabyStepping = new DisableableWidget()
|
||||
{
|
||||
VAnchor = VAnchor.FitToChildren,
|
||||
HAnchor = HAnchor.FitToChildren
|
||||
VAnchor = VAnchor.Fit,
|
||||
HAnchor = HAnchor.Fit
|
||||
};
|
||||
|
||||
var tooBigFlowLayout = new FlowLayoutWidget();
|
||||
tooBigForBabyStepping.AddChild(tooBigFlowLayout);
|
||||
|
||||
tenButton = buttonFactory.GenerateRadioButton("10");
|
||||
tenButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
tenButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
tenButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetXYZMoveAmount(10); };
|
||||
tenButton.SiblingRadioButtonList = radioList;
|
||||
tooBigFlowLayout.AddChild(tenButton);
|
||||
|
||||
oneHundredButton = buttonFactory.GenerateRadioButton("100");
|
||||
oneHundredButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
oneHundredButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
oneHundredButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetXYZMoveAmount(100); };
|
||||
oneHundredButton.SiblingRadioButtonList = radioList;
|
||||
tooBigFlowLayout.AddChild(oneHundredButton);
|
||||
|
|
@ -149,12 +149,12 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
TextWidget mmLabel = new TextWidget("mm", textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 8);
|
||||
mmLabel.Margin = new BorderDouble(left: 10);
|
||||
mmLabel.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
mmLabel.VAnchor = Agg.UI.VAnchor.Center;
|
||||
|
||||
tooBigFlowLayout.AddChild(mmLabel);
|
||||
}
|
||||
|
||||
setMoveDistanceControl.HAnchor = Agg.UI.HAnchor.ParentLeft;
|
||||
setMoveDistanceControl.HAnchor = Agg.UI.HAnchor.Left;
|
||||
xYZWithDistance.AddChild(setMoveDistanceControl);
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ namespace MatterHackers.MatterControl
|
|||
allControlsLeftToRight.AddChild(GetHotkeyControlContainer());
|
||||
#endif
|
||||
GuiWidget barBetweenZAndE = new GuiWidget(2, 2);
|
||||
barBetweenZAndE.VAnchor = Agg.UI.VAnchor.ParentBottomTop;
|
||||
barBetweenZAndE.VAnchor = Agg.UI.VAnchor.Stretch;
|
||||
barBetweenZAndE.BackgroundColor = RGBA_Bytes.White;
|
||||
barBetweenZAndE.Margin = new BorderDouble(distanceBetweenControls, 5);
|
||||
allControlsLeftToRight.AddChild(barBetweenZAndE);
|
||||
|
|
@ -173,8 +173,8 @@ namespace MatterHackers.MatterControl
|
|||
disableableEButtons = new DisableableWidget()
|
||||
{
|
||||
Name = "disableableEButtons",
|
||||
HAnchor = HAnchor.FitToChildren,
|
||||
VAnchor = VAnchor.FitToChildren | VAnchor.ParentTop,
|
||||
HAnchor = HAnchor.Fit,
|
||||
VAnchor = VAnchor.Fit | VAnchor.Top,
|
||||
};
|
||||
disableableEButtons.AddChild(eButtons);
|
||||
|
||||
|
|
@ -183,8 +183,8 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
|
||||
this.AddChild(allControlsTopToBottom);
|
||||
this.HAnchor = HAnchor.FitToChildren;
|
||||
this.VAnchor = VAnchor.FitToChildren;
|
||||
this.HAnchor = HAnchor.Fit;
|
||||
this.VAnchor = VAnchor.Fit;
|
||||
|
||||
Margin = new BorderDouble(3);
|
||||
|
||||
|
|
@ -258,8 +258,8 @@ namespace MatterHackers.MatterControl
|
|||
private FlowLayoutWidget GetHotkeyControlContainer()
|
||||
{
|
||||
FlowLayoutWidget keyFocusedContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
keyFocusedContainer.HAnchor = HAnchor.FitToChildren;
|
||||
keyFocusedContainer.VAnchor = VAnchor.ParentBottomTop;
|
||||
keyFocusedContainer.HAnchor = HAnchor.Fit;
|
||||
keyFocusedContainer.VAnchor = VAnchor.Stretch;
|
||||
keyFocusedContainer.ToolTipText = "Enable cursor keys for movement".Localize();
|
||||
keyFocusedContainer.Margin = new BorderDouble(left: 10);
|
||||
|
||||
|
|
@ -272,8 +272,8 @@ namespace MatterHackers.MatterControl
|
|||
keyboardImage = new ImageWidget(image)
|
||||
{
|
||||
BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor,
|
||||
VAnchor = VAnchor.ParentCenter,
|
||||
HAnchor = HAnchor.ParentCenter,
|
||||
VAnchor = VAnchor.Center,
|
||||
HAnchor = HAnchor.Center,
|
||||
Margin = new BorderDouble(5),
|
||||
Visible = false,
|
||||
};
|
||||
|
|
@ -432,12 +432,12 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
TextWidget eMinusControlLabel = new TextWidget("Retract".Localize(), pointSize: 11);
|
||||
eMinusControlLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
eMinusControlLabel.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
eMinusControlLabel.VAnchor = Agg.UI.VAnchor.Center;
|
||||
eMinusButtonAndText.AddChild(eMinusControlLabel);
|
||||
eButtons.AddChild(eMinusButtonAndText);
|
||||
|
||||
eMinusButtonAndText.HAnchor = HAnchor.FitToChildren;
|
||||
eMinusButtonAndText.VAnchor = VAnchor.FitToChildren;
|
||||
eMinusButtonAndText.HAnchor = HAnchor.Fit;
|
||||
eMinusButtonAndText.VAnchor = VAnchor.Fit;
|
||||
|
||||
FlowLayoutWidget buttonSpacerContainer = new FlowLayoutWidget();
|
||||
for (int i = 0; i < extruderCount; i++)
|
||||
|
|
@ -452,8 +452,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
eButtons.AddChild(buttonSpacerContainer);
|
||||
|
||||
buttonSpacerContainer.HAnchor = HAnchor.FitToChildren;
|
||||
buttonSpacerContainer.VAnchor = VAnchor.FitToChildren;
|
||||
buttonSpacerContainer.HAnchor = HAnchor.Fit;
|
||||
buttonSpacerContainer.VAnchor = VAnchor.Fit;
|
||||
|
||||
FlowLayoutWidget ePlusButtonAndText = new FlowLayoutWidget();
|
||||
if (extruderCount == 1)
|
||||
|
|
@ -478,11 +478,11 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
TextWidget ePlusControlLabel = new TextWidget("Extrude".Localize(), pointSize: 11);
|
||||
ePlusControlLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
ePlusControlLabel.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
ePlusControlLabel.VAnchor = Agg.UI.VAnchor.Center;
|
||||
ePlusButtonAndText.AddChild(ePlusControlLabel);
|
||||
eButtons.AddChild(ePlusButtonAndText);
|
||||
ePlusButtonAndText.HAnchor = HAnchor.FitToChildren;
|
||||
ePlusButtonAndText.VAnchor = VAnchor.FitToChildren;
|
||||
ePlusButtonAndText.HAnchor = HAnchor.Fit;
|
||||
ePlusButtonAndText.VAnchor = VAnchor.Fit;
|
||||
}
|
||||
|
||||
eButtons.AddChild(new GuiWidget(10, 6));
|
||||
|
|
@ -490,7 +490,7 @@ namespace MatterHackers.MatterControl
|
|||
// add in some movement radio buttons
|
||||
FlowLayoutWidget setMoveDistanceControl = new FlowLayoutWidget();
|
||||
TextWidget buttonsLabel = new TextWidget("Distance:", textColor: RGBA_Bytes.White);
|
||||
buttonsLabel.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
buttonsLabel.VAnchor = Agg.UI.VAnchor.Center;
|
||||
//setMoveDistanceControl.AddChild(buttonsLabel);
|
||||
|
||||
{
|
||||
|
|
@ -498,15 +498,15 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
var moveRadioButtons = new FlowLayoutWidget();
|
||||
RadioButton oneButton = buttonFactory.GenerateRadioButton("1");
|
||||
oneButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
oneButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
oneButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetEMoveAmount(1); };
|
||||
moveRadioButtons.AddChild(oneButton);
|
||||
RadioButton tenButton = buttonFactory.GenerateRadioButton("10");
|
||||
tenButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
tenButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
tenButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetEMoveAmount(10); };
|
||||
moveRadioButtons.AddChild(tenButton);
|
||||
RadioButton oneHundredButton = buttonFactory.GenerateRadioButton("100");
|
||||
oneHundredButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
oneHundredButton.VAnchor = Agg.UI.VAnchor.Center;
|
||||
oneHundredButton.CheckedStateChanged += (sender, e) => { if (((RadioButton)sender).Checked) SetEMoveAmount(100); };
|
||||
moveRadioButtons.AddChild(oneHundredButton);
|
||||
tenButton.Checked = true;
|
||||
|
|
@ -515,14 +515,14 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
|
||||
var mmLabel = new TextWidget("mm", textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 8);
|
||||
mmLabel.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
mmLabel.VAnchor = Agg.UI.VAnchor.Center;
|
||||
mmLabel.Margin = new BorderDouble(left: 10);
|
||||
setMoveDistanceControl.AddChild(mmLabel);
|
||||
setMoveDistanceControl.HAnchor = Agg.UI.HAnchor.ParentLeft;
|
||||
setMoveDistanceControl.HAnchor = Agg.UI.HAnchor.Left;
|
||||
eButtons.AddChild(setMoveDistanceControl);
|
||||
|
||||
eButtons.HAnchor = HAnchor.FitToChildren;
|
||||
eButtons.VAnchor = VAnchor.FitToChildren | VAnchor.ParentBottom;
|
||||
eButtons.HAnchor = HAnchor.Fit;
|
||||
eButtons.VAnchor = VAnchor.Fit | VAnchor.Bottom;
|
||||
|
||||
return eButtons;
|
||||
}
|
||||
|
|
@ -530,8 +530,8 @@ namespace MatterHackers.MatterControl
|
|||
private static MoveButton CreateMoveButton(string label, PrinterConnection.Axis axis, double moveSpeed, bool levelingButtons, MoveButtonFactory buttonFactory)
|
||||
{
|
||||
var button = buttonFactory.GenerateMoveButton(label, axis, moveSpeed);
|
||||
button.VAnchor = VAnchor.AbsolutePosition;
|
||||
button.HAnchor = HAnchor.AbsolutePosition;
|
||||
button.VAnchor = VAnchor.Absolute;
|
||||
button.HAnchor = HAnchor.Absolute;
|
||||
button.Height = (levelingButtons ? 45 : 40) * GuiWidget.DeviceScale;
|
||||
button.Width = (levelingButtons ? 90 : 40) * GuiWidget.DeviceScale;
|
||||
|
||||
|
|
@ -561,7 +561,7 @@ namespace MatterHackers.MatterControl
|
|||
zButtons.AddChild(zPlusControl);
|
||||
|
||||
GuiWidget spacer = new GuiWidget(2, buttonSeparationDistance);
|
||||
spacer.HAnchor = Agg.UI.HAnchor.ParentCenter;
|
||||
spacer.HAnchor = Agg.UI.HAnchor.Center;
|
||||
spacer.BackgroundColor = XYZColors.zColor;
|
||||
zButtons.AddChild(spacer);
|
||||
|
||||
|
|
@ -580,15 +580,15 @@ namespace MatterHackers.MatterControl
|
|||
FlowLayoutWidget xButtons = new FlowLayoutWidget();
|
||||
{
|
||||
moveButtonFactory.Colors.Fill.Normal = XYZColors.xColor;
|
||||
xButtons.HAnchor |= Agg.UI.HAnchor.ParentCenter;
|
||||
xButtons.VAnchor |= Agg.UI.VAnchor.ParentCenter;
|
||||
xButtons.HAnchor |= Agg.UI.HAnchor.Center;
|
||||
xButtons.VAnchor |= Agg.UI.VAnchor.Center;
|
||||
|
||||
xMinusControl = CreateMoveButton("X-", PrinterConnection.Axis.X, MovementControls.XSpeed, false, moveButtonFactory);
|
||||
xMinusControl.ToolTipText = "Move X negative".Localize();
|
||||
xButtons.AddChild(xMinusControl);
|
||||
|
||||
GuiWidget spacer = new GuiWidget(xMinusControl.Width + buttonSeparationDistance * 2, 2);
|
||||
spacer.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
spacer.VAnchor = Agg.UI.VAnchor.Center;
|
||||
spacer.BackgroundColor = XYZColors.xColor;
|
||||
xButtons.AddChild(spacer);
|
||||
|
||||
|
|
@ -601,14 +601,14 @@ namespace MatterHackers.MatterControl
|
|||
FlowLayoutWidget yButtons = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
{
|
||||
moveButtonFactory.Colors.Fill.Normal = XYZColors.yColor;
|
||||
yButtons.HAnchor |= Agg.UI.HAnchor.ParentCenter;
|
||||
yButtons.VAnchor |= Agg.UI.VAnchor.ParentCenter;
|
||||
yButtons.HAnchor |= Agg.UI.HAnchor.Center;
|
||||
yButtons.VAnchor |= Agg.UI.VAnchor.Center;
|
||||
yPlusControl = CreateMoveButton("Y+", PrinterConnection.Axis.Y, MovementControls.YSpeed, false, moveButtonFactory);
|
||||
yPlusControl.ToolTipText = "Move Y positive".Localize();
|
||||
yButtons.AddChild(yPlusControl);
|
||||
|
||||
GuiWidget spacer = new GuiWidget(2, buttonSeparationDistance);
|
||||
spacer.HAnchor = Agg.UI.HAnchor.ParentCenter;
|
||||
spacer.HAnchor = Agg.UI.HAnchor.Center;
|
||||
spacer.BackgroundColor = XYZColors.yColor;
|
||||
yButtons.AddChild(spacer);
|
||||
|
||||
|
|
@ -618,9 +618,9 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
xyGrid.AddChild(yButtons);
|
||||
}
|
||||
xyGrid.HAnchor = HAnchor.FitToChildren;
|
||||
xyGrid.VAnchor = VAnchor.FitToChildren;
|
||||
xyGrid.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
xyGrid.HAnchor = HAnchor.Fit;
|
||||
xyGrid.VAnchor = VAnchor.Fit;
|
||||
xyGrid.VAnchor = Agg.UI.VAnchor.Bottom;
|
||||
xyGrid.Margin = new BorderDouble(0, 5, distanceBetweenControls, 5);
|
||||
return xyGrid;
|
||||
}
|
||||
|
|
@ -704,8 +704,8 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
TextWidget textWidget = new TextWidget(label, pointSize: fontSize)
|
||||
{
|
||||
VAnchor = VAnchor.ParentCenter,
|
||||
HAnchor = HAnchor.ParentCenter,
|
||||
VAnchor = VAnchor.Center,
|
||||
HAnchor = HAnchor.Center,
|
||||
TextColor = textColor,
|
||||
Padding = new BorderDouble(3, 0)
|
||||
};
|
||||
|
|
@ -820,8 +820,8 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
);
|
||||
|
||||
buttonViewStates.HAnchor = HAnchor.ParentLeftRight;
|
||||
buttonViewStates.VAnchor = VAnchor.ParentBottomTop;
|
||||
buttonViewStates.HAnchor = HAnchor.Stretch;
|
||||
buttonViewStates.VAnchor = VAnchor.Stretch;
|
||||
|
||||
return buttonViewStates;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue