diff options
| author | Jacob Palecki <[email protected]> | 2020-08-20 12:51:33 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-08-20 12:51:33 -0700 |
| commit | fe17d04e571d180e663c7014e803ce790693f4b1 (patch) | |
| tree | c2e026ab79b73d3e48cc71aebde90b095771587c /grapher/Models/Options/ActiveValueLabelXY.cs | |
| parent | Add empty active labels for all options (diff) | |
| download | rawaccel-fe17d04e571d180e663c7014e803ce790693f4b1.tar.xz rawaccel-fe17d04e571d180e663c7014e803ce790693f4b1.zip | |
Display active values
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabelXY.cs')
| -rw-r--r-- | grapher/Models/Options/ActiveValueLabelXY.cs | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/grapher/Models/Options/ActiveValueLabelXY.cs b/grapher/Models/Options/ActiveValueLabelXY.cs new file mode 100644 index 0000000..b3b580f --- /dev/null +++ b/grapher/Models/Options/ActiveValueLabelXY.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher.Models.Options +{ + public class ActiveValueLabelXY + { + public const int ActiveLabelXYSeparation = 4; + + public ActiveValueLabelXY( + ActiveValueLabel x, + ActiveValueLabel y) + { + X = x; + Y = y; + Combined = false; + SetCombined(); + } + + public ActiveValueLabel X { get; } + + public ActiveValueLabel Y { get; } + + public bool Combined { get; private set; } + + public void SetValues(double x, double y) + { + X.SetValue(x); + Y.SetValue(y); + + if (x == y) + { + SetCombined(); + } + else + { + SetSeparate(); + } + } + + public void SetCombined() + { + if (!Combined) + { + Y.Hide(); + } + + Combined = true; + } + + public void SetSeparate() + { + if (Combined) + { + Y.Show(); + } + + Combined = false; + } + } +} |