summaryrefslogtreecommitdiff
path: root/grapher/Models/Options/Option.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-01 23:36:52 -0700
committerJacob Palecki <[email protected]>2020-09-01 23:36:52 -0700
commitbf747ca2439a371ef74e21a49c1e8bc880d4d3e2 (patch)
tree6265bea551877d84803d731cec7cd0b3b3d823ac /grapher/Models/Options/Option.cs
parentSecond half - the parts in place (diff)
downloadrawaccel-bf747ca2439a371ef74e21a49c1e8bc880d4d3e2.tar.xz
rawaccel-bf747ca2439a371ef74e21a49c1e8bc880d4d3e2.zip
Small fixes, correctly align labels and boxes
Diffstat (limited to 'grapher/Models/Options/Option.cs')
-rw-r--r--grapher/Models/Options/Option.cs18
1 files changed, 13 insertions, 5 deletions
diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs
index 2006dec..22b78d4 100644
--- a/grapher/Models/Options/Option.cs
+++ b/grapher/Models/Options/Option.cs
@@ -15,11 +15,17 @@ namespace grapher
public Option(
Field field,
Label label,
- ActiveValueLabel activeValueLabel)
+ ActiveValueLabel activeValueLabel,
+ int left)
{
Field = field;
Label = label;
ActiveValueLabel = activeValueLabel;
+ Left = left;
+
+ label.AutoSize = false;
+ label.Width = Field.Left - left - Constants.OptionLabelBoxSeperation;
+ label.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
}
public Option(
@@ -27,11 +33,13 @@ namespace grapher
Form containingForm,
double defaultData,
Label label,
+ int left,
ActiveValueLabel activeValueLabel)
: this(
new Field(box, containingForm, defaultData),
label,
- activeValueLabel)
+ activeValueLabel,
+ left)
{
}
@@ -40,6 +48,7 @@ namespace grapher
Form containingForm,
double defaultData,
Label label,
+ int left,
ActiveValueLabel activeValueLabel,
string startingName)
: this(
@@ -47,6 +56,7 @@ namespace grapher
containingForm,
defaultData,
label,
+ left,
activeValueLabel)
{
SetName(startingName);
@@ -89,10 +99,9 @@ namespace grapher
{
return Label.Left;
}
- set
+ private set
{
Label.Left = value;
- Field.Left = value + Label.Width + Constants.OptionLabelBoxSeperation;
}
}
public int Width
@@ -111,7 +120,6 @@ namespace grapher
{
Label.Text = name;
//Label.Left = Convert.ToInt32((Field.Box.Left / 2.0) - (Label.Width / 2.0)); //Centered
- Left = Label.Left;
}
public void SetActiveValue(double value)