diff options
| author | Jacob Palecki <[email protected]> | 2020-09-01 21:45:42 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-01 21:45:42 -0700 |
| commit | 95cc3ed0a0bf66f5535b873f245bc1c35a145478 (patch) | |
| tree | de1a9f20dee0239cf7a2204945249b497deb8f9e /grapher/Models/Options/Option.cs | |
| parent | Add X Y labels for by component (diff) | |
| download | rawaccel-95cc3ed0a0bf66f5535b873f245bc1c35a145478.tar.xz rawaccel-95cc3ed0a0bf66f5535b873f245bc1c35a145478.zip | |
intermittent commit - large commit halfway done
Diffstat (limited to 'grapher/Models/Options/Option.cs')
| -rw-r--r-- | grapher/Models/Options/Option.cs | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index c5336a6..bd2c9a1 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -62,6 +62,47 @@ namespace grapher public ActiveValueLabel ActiveValueLabel { get; } + public int Top + { + get + { + return Field.Top; + } + set + { + Field.Top = value; + Label.Top = value; + } + } + + public int Height + { + get + { + return Field.Height; + } + } + + public int Left + { + get + { + return Label.Left; + } + set + { + Label.Left = value; + Field.Left = value + Label.Width + Constants.OptionLabelBoxSeperation; + } + } + public int Width + { + get + { + return Field.Left + Field.Width - Label.Left; + } + } + #endregion Properties #region Methods @@ -70,7 +111,7 @@ namespace grapher { Label.Text = name; //Label.Left = Convert.ToInt32((Field.Box.Left / 2.0) - (Label.Width / 2.0)); //Centered - Label.Left = Convert.ToInt32(Field.Box.Left - Label.Width - 10); //Right-aligned + Left = Label.Left; } public void SetActiveValue(double value) @@ -103,6 +144,11 @@ namespace grapher Show(); } + + public void SnapTo(Option option) + { + Top = option.Top + option.Height + Constants.OptionVerticalSeperation; + } #endregion Methods } |