diff options
| author | Jacob Palecki <[email protected]> | 2020-09-01 23:36:52 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-01 23:36:52 -0700 |
| commit | bf747ca2439a371ef74e21a49c1e8bc880d4d3e2 (patch) | |
| tree | 6265bea551877d84803d731cec7cd0b3b3d823ac /grapher/Models | |
| parent | Second half - the parts in place (diff) | |
| download | rawaccel-bf747ca2439a371ef74e21a49c1e8bc880d4d3e2.tar.xz rawaccel-bf747ca2439a371ef74e21a49c1e8bc880d4d3e2.zip | |
Small fixes, correctly align labels and boxes
Diffstat (limited to 'grapher/Models')
| -rw-r--r-- | grapher/Models/AccelGUIFactory.cs | 31 | ||||
| -rw-r--r-- | grapher/Models/Options/AccelOptionSet.cs | 4 | ||||
| -rw-r--r-- | grapher/Models/Options/Option.cs | 18 |
3 files changed, 40 insertions, 13 deletions
diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index a75207b..3c2a773 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -114,14 +114,18 @@ namespace grapher.Models form, 0, rotationLabel, + 0, new ActiveValueLabel(rotationActiveLabel, activeValueTitle), "Rotation"); + var optionSetYLeft = rotation.Left + rotation.Width; + var weightX = new Option( weightBoxX, form, 1, weightLabelX, + 0, new ActiveValueLabel(weightActiveXLabel, activeValueTitle), "Weight"); @@ -130,6 +134,7 @@ namespace grapher.Models form, 1, weightLabelY, + optionSetYLeft, new ActiveValueLabel(weightActiveYLabel, activeValueTitle), "Weight"); @@ -138,6 +143,7 @@ namespace grapher.Models form, 0, capLabelX, + 0, new ActiveValueLabel(capActiveXLabel, activeValueTitle), "Cap"); @@ -146,6 +152,7 @@ namespace grapher.Models form, 0, capLabelY, + optionSetYLeft, new ActiveValueLabel(capActiveYLabel, activeValueTitle), "Cap"); @@ -154,6 +161,7 @@ namespace grapher.Models form, 0, offsetLabelX, + 0, new ActiveValueLabel(offsetActiveLabelX, activeValueTitle), "Offset"); @@ -162,6 +170,7 @@ namespace grapher.Models form, 0, offsetLabelY, + optionSetYLeft, new ActiveValueLabel(offsetActiveLabelY, activeValueTitle), "Offset"); @@ -169,32 +178,38 @@ namespace grapher.Models var accelerationX = new Option( new Field(accelerationBoxX, form, 0), constantOneLabelX, - new ActiveValueLabel(accelerationActiveLabelX, activeValueTitle)); + new ActiveValueLabel(accelerationActiveLabelX, activeValueTitle), + 0); var accelerationY = new Option( new Field(accelerationBoxY, form, 0), constantOneLabelY, - new ActiveValueLabel(accelerationActiveLabelY, activeValueTitle)); + new ActiveValueLabel(accelerationActiveLabelY, activeValueTitle), + optionSetYLeft); var limitOrExponentX = new Option( new Field(limitBoxX, form, 2), constantTwoLabelX, - new ActiveValueLabel(limitExpActiveLabelX, activeValueTitle)); + new ActiveValueLabel(limitExpActiveLabelX, activeValueTitle), + 0); var limitOrExponentY = new Option( new Field(limitBoxY, form, 2), constantTwoLabelY, - new ActiveValueLabel(limitExpActiveLabelY, activeValueTitle)); + new ActiveValueLabel(limitExpActiveLabelY, activeValueTitle), + optionSetYLeft); var midpointX = new Option( new Field(midpointBoxX, form, 0), constantThreeLabelX, - new ActiveValueLabel(midpointActiveLabelX, activeValueTitle)); + new ActiveValueLabel(midpointActiveLabelX, activeValueTitle), + 0); var midpointY = new Option( new Field(midpointBoxY, form, 0), constantThreeLabelY, - new ActiveValueLabel(midpointActiveLabelY, activeValueTitle)); + new ActiveValueLabel(midpointActiveLabelY, activeValueTitle), + optionSetYLeft); var accelerationOptionsX = new AccelTypeOptions( accelTypeDropX, @@ -236,16 +251,18 @@ namespace grapher.Models var optionsSetX = new AccelOptionSet( optionSetXTitle, + rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsX, accelerationX, capOptionsX, weightX, offsetX, limitOrExponentX, - midpointX); + midpointX); ; var optionsSetY = new AccelOptionSet( optionSetYTitle, + rotationBox.Top + rotationBox.Height + Constants.OptionVerticalSeperation, accelerationOptionsY, accelerationY, capOptionsY, diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 2d15ad6..e2f2bf7 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -12,6 +12,7 @@ namespace grapher.Models.Options { public AccelOptionSet( Label titleLabel, + int topAnchor, AccelTypeOptions accelTypeOptions, Option acceleration, CapOptions cap, @@ -21,6 +22,7 @@ namespace grapher.Models.Options Option midpoint) { TitleLabel = titleLabel; + TopAnchor = topAnchor; AccelTypeOptions = accelTypeOptions; Acceleration = acceleration; Cap = cap; @@ -158,7 +160,7 @@ namespace grapher.Models.Options private void SetOptionsTop(int top) { AccelTypeOptions.Top = top; - Acceleration.Top = AccelTypeOptions.Top+ AccelTypeOptions.Height + Constants.OptionVerticalSeperation; + Acceleration.Top = AccelTypeOptions.Top + AccelTypeOptions.Height + Constants.OptionVerticalSeperation; Cap.SnapTo(Acceleration); Weight.SnapTo(Cap); Offset.SnapTo(Weight); 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) |