summaryrefslogtreecommitdiff
path: root/grapher/Models/Options/ActiveValueLabel.cs
diff options
context:
space:
mode:
authorJacobPalecki <[email protected]>2020-09-08 16:00:05 -0700
committerGitHub <[email protected]>2020-09-08 16:00:05 -0700
commite5461fa84e65d78823d0022339fa2d8864f7e63c (patch)
treeb486ef524c93bfeb29a86403114b6805bf9decf1 /grapher/Models/Options/ActiveValueLabel.cs
parentMerge pull request #19 from JacobPalecki/gainOffset (diff)
parentSave show last mouse value (diff)
downloadrawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.tar.xz
rawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.zip
Merge pull request #20 from JacobPalecki/GUI
GUI: Add By Component & Anisotropy; Remove Logarithm and Sigmoid; Delete Console; Some Refactoring
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabel.cs')
-rw-r--r--grapher/Models/Options/ActiveValueLabel.cs71
1 files changed, 59 insertions, 12 deletions
diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs
index 138775a..18a4400 100644
--- a/grapher/Models/Options/ActiveValueLabel.cs
+++ b/grapher/Models/Options/ActiveValueLabel.cs
@@ -1,34 +1,42 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Drawing;
using System.Windows.Forms;
namespace grapher.Models.Options
{
public class ActiveValueLabel
{
- public const string DefaultFormatString = "0.######";
- public static readonly Color ActiveValueFontColor = Color.FromArgb(255, 65, 65, 65);
+ #region Constants
+
+
+ #endregion Constants
+
+ #region Fields
private string _prefix;
private string _value;
+ #endregion Fields
+
+ #region Constructors
+
public ActiveValueLabel(Label valueLabel, Label centeringLabel)
{
ValueLabel = valueLabel;
- ValueLabel.ForeColor = ActiveValueFontColor;
- Left = centeringLabel.Left;
- Width = centeringLabel.Width;
ValueLabel.AutoSize = false;
ValueLabel.TextAlign = ContentAlignment.MiddleCenter;
+ ValueLabel.ForeColor = Constants.ActiveValueFontColor;
- FormatString = DefaultFormatString;
+ CenteringLabel = centeringLabel;
+ Align();
+
+ FormatString = Constants.DefaultActiveValueFormatString;
Prefix = string.Empty;
}
+ #endregion Constructors
+
+ #region Properties
+
public Label ValueLabel { get; }
public string FormatString { get; set; }
@@ -79,6 +87,37 @@ namespace grapher.Models.Options
}
}
+ public int Top
+ {
+ get
+ {
+ return ValueLabel.Top;
+ }
+ set
+ {
+ ValueLabel.Top = value;
+ }
+ }
+
+ public int Height
+ {
+ get
+ {
+ return ValueLabel.Height;
+ }
+
+ set
+ {
+ ValueLabel.Height = value;
+ }
+ }
+
+ public Label CenteringLabel { get; }
+
+ #endregion Properties
+
+ #region Methods
+
public void Hide()
{
ValueLabel.Hide();
@@ -103,5 +142,13 @@ namespace grapher.Models.Options
{
ValueLabel.Text = string.IsNullOrWhiteSpace(Prefix) ? Value: $"{Prefix}: {Value}";
}
+
+ public void Align()
+ {
+ Left = CenteringLabel.Left;
+ Width = CenteringLabel.Width;
+ }
+
+ #endregion Methods
}
}