Making an editor for vector4

This commit is contained in:
LarsBrubaker 2021-03-02 07:33:23 -08:00
parent 5131b7356b
commit 55c150d1c2
4 changed files with 74 additions and 9 deletions

View file

@ -44,7 +44,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
private ThemeConfig theme;
protected char[] labels = new[] { 'X', 'Y', 'Z', 'W' };
public char[] Labels { get; set; } = new[] { 'X', 'Y', 'Z', 'W' };
public Vector4Field(ThemeConfig theme)
{
@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
double.TryParse(xyzValueStrings[0], out double currentXValue);
xEditWidget = new MHNumberEdit(currentXValue, theme, labels[0] /* X */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
xEditWidget = new MHNumberEdit(currentXValue, theme, Labels[0] /* X */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
{
ToolTipText = this.HelpText,
TabIndex = tabIndex,
@ -98,7 +98,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
double.TryParse(xyzValueStrings[1], out double currentYValue);
yEditWidget = new MHNumberEdit(currentYValue, theme, labels[1] /* Y */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
yEditWidget = new MHNumberEdit(currentYValue, theme, Labels[1] /* Y */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
{
ToolTipText = this.HelpText,
TabIndex = tabIndex + 1,
@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
double.TryParse(xyzValueStrings[2], out double currentZValue);
zEditWidget = new MHNumberEdit(currentZValue, theme, labels[2] /* Z */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
zEditWidget = new MHNumberEdit(currentZValue, theme, Labels[2] /* Z */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
{
ToolTipText = this.HelpText,
TabIndex = tabIndex + 1,
@ -142,7 +142,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
double.TryParse(xyzValueStrings[3], out double currentWValue);
wEditWidget = new MHNumberEdit(currentZValue, theme, labels[3] /* W */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
wEditWidget = new MHNumberEdit(currentZValue, theme, Labels[3] /* W */, allowNegatives: true, allowDecimals: true, pixelWidth: VectorXYZWEditWidth, tabIndex: tabIndex)
{
ToolTipText = this.HelpText,
TabIndex = tabIndex + 1,