From d948065a830dafe526e38868f23a4ca4a6ba63e4 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sun, 4 Apr 2021 23:31:14 -0700 Subject: Add textoption for lut text display --- grapher/Models/Options/TextOption.cs | 95 ++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 grapher/Models/Options/TextOption.cs (limited to 'grapher/Models/Options/TextOption.cs') diff --git a/grapher/Models/Options/TextOption.cs b/grapher/Models/Options/TextOption.cs new file mode 100644 index 0000000..bbdedca --- /dev/null +++ b/grapher/Models/Options/TextOption.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher.Models.Options +{ + public class TextOption : OptionBase + { + #region Constructors + + public TextOption(Label label) + { + Label = label; + } + + #endregion Constructors + + #region Properties + + private Label Label { get; } + + public override bool Visible + { + get + { + return Label.Visible; + } + } + + public override int Top + { + get + { + return Label.Top; + } + set + { + Label.Top = value; + } + } + + public override int Height + { + get + { + return Label.Height; + } + } + + public override int Width + { + get + { + return Label.Width; + } + set + { + Label.Width = value; + } + } + + public override int Left + { + get + { + return Label.Left; + } + set + { + Label.Left = value; + } + } + + public override void Hide() + { + Label.Hide(); + } + + public override void Show(string Name) + { + Label.Show(); + Label.Text = Name; + } + + public override void AlignActiveValues() + { + // Nothing to do here + } + + #endregion Properties + } +} -- cgit v1.2.3 From db593584edb93b053396259db4c4acbeee0ee9e6 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 5 Apr 2021 22:41:16 -0700 Subject: LUT GUI fixes --- grapher/Models/Options/TextOption.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'grapher/Models/Options/TextOption.cs') diff --git a/grapher/Models/Options/TextOption.cs b/grapher/Models/Options/TextOption.cs index bbdedca..292b805 100644 --- a/grapher/Models/Options/TextOption.cs +++ b/grapher/Models/Options/TextOption.cs @@ -14,6 +14,9 @@ namespace grapher.Models.Options public TextOption(Label label) { Label = label; + Label.AutoSize = false; + Label.Width = 150; + Label.Height = 100; } #endregion Constructors -- cgit v1.2.3 From 0af5b1d23be9ecfb0134c957197cfd8f838b7998 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sun, 25 Apr 2021 21:57:25 -0700 Subject: Fixed layout issues for LUT --- grapher/Models/Options/TextOption.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'grapher/Models/Options/TextOption.cs') diff --git a/grapher/Models/Options/TextOption.cs b/grapher/Models/Options/TextOption.cs index 292b805..3c6f378 100644 --- a/grapher/Models/Options/TextOption.cs +++ b/grapher/Models/Options/TextOption.cs @@ -29,7 +29,7 @@ namespace grapher.Models.Options { get { - return Label.Visible; + return Label.Visible || ShouldShow; } } @@ -77,15 +77,22 @@ namespace grapher.Models.Options } } + private bool ShouldShow + { + get; set; + } + public override void Hide() { Label.Hide(); + ShouldShow = false; } public override void Show(string Name) { Label.Show(); Label.Text = Name; + ShouldShow = true; } public override void AlignActiveValues() -- cgit v1.2.3 From ac0a6eb86c8d783c21cb246d688a221913b15789 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 1 Jul 2021 19:13:12 -0700 Subject: Mostly working --- grapher/Models/Options/TextOption.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'grapher/Models/Options/TextOption.cs') diff --git a/grapher/Models/Options/TextOption.cs b/grapher/Models/Options/TextOption.cs index 3c6f378..83a72df 100644 --- a/grapher/Models/Options/TextOption.cs +++ b/grapher/Models/Options/TextOption.cs @@ -14,9 +14,7 @@ namespace grapher.Models.Options public TextOption(Label label) { Label = label; - Label.AutoSize = false; - Label.Width = 150; - Label.Height = 100; + Label.AutoSize = true; } #endregion Constructors @@ -61,7 +59,7 @@ namespace grapher.Models.Options } set { - Label.Width = value; + Label.MaximumSize = new System.Drawing.Size(value, 0); } } -- cgit v1.2.3 From 308eed9ce9ed48984323e6512546a2ffeb195b14 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 1 Jul 2021 22:32:55 -0700 Subject: LUT Panel formatting --- grapher/Models/Options/TextOption.cs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'grapher/Models/Options/TextOption.cs') diff --git a/grapher/Models/Options/TextOption.cs b/grapher/Models/Options/TextOption.cs index 83a72df..1f8034d 100644 --- a/grapher/Models/Options/TextOption.cs +++ b/grapher/Models/Options/TextOption.cs @@ -9,6 +9,13 @@ namespace grapher.Models.Options { public class TextOption : OptionBase { + #region Constants + + public const string LUTLayoutExpandedText = "This mode is for experts only. Format: x1,y1;x2,y2;...xn,yn;"; + public const string LUTLayoutShortenedText = "Experts only."; + + #endregion Constants + #region Constructors public TextOption(Label label) @@ -23,6 +30,10 @@ namespace grapher.Models.Options private Label Label { get; } + private string ExpandedText { get; set; } + + private string ShortenedText { get; set; } + public override bool Visible { get @@ -89,10 +100,25 @@ namespace grapher.Models.Options public override void Show(string Name) { Label.Show(); - Label.Text = Name; ShouldShow = true; } + public void Expand() + { + Label.Text = ExpandedText; + } + + public void Shorten() + { + Label.Text = ShortenedText; + } + + public void SetText(string expandedText, string shortenedText) + { + ExpandedText = expandedText; + ShortenedText = shortenedText; + } + public override void AlignActiveValues() { // Nothing to do here -- cgit v1.2.3