diff options
| author | AShifter <[email protected]> | 2017-11-25 08:59:48 -0700 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-11-25 08:59:48 -0700 |
| commit | c81573594f509177214bbc9b64427c8aabdc30a6 (patch) | |
| tree | 0f16be1fffc1e1557adafbd1baa9ff7aa16a3381 /ShiftOS.Engine/UI/ShiftButton.cs | |
| parent | 90b1bdca5f8f2bf634a0b83ed9b623843ada5661 (diff) | |
| download | shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.gz shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.tar.bz2 shiftos-rewind-c81573594f509177214bbc9b64427c8aabdc30a6.zip | |
Add SaveSystem, FullScreen Terminal and stuff
Git had a horrible seizure and removed our repo but Alex-TIMEHACK helped
us get it back.
Diffstat (limited to 'ShiftOS.Engine/UI/ShiftButton.cs')
| -rw-r--r-- | ShiftOS.Engine/UI/ShiftButton.cs | 60 |
1 files changed, 55 insertions, 5 deletions
diff --git a/ShiftOS.Engine/UI/ShiftButton.cs b/ShiftOS.Engine/UI/ShiftButton.cs index ebf6e2b..8e4104d 100644 --- a/ShiftOS.Engine/UI/ShiftButton.cs +++ b/ShiftOS.Engine/UI/ShiftButton.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; -using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,11 +8,63 @@ using System.Windows.Forms; namespace ShiftOS.Engine.UI { - public partial class ShiftButton : UserControl + public partial class ShiftButton : Button { - public ShiftButton() + private static Font _normalFont = new Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + + private static Color _back = System.Drawing.Color.Black; + private static Color _border = System.Drawing.Color.White; + private static Color _activeBorder = System.Drawing.Color.Black; + private static Color _fore = System.Drawing.Color.Black; + private static Padding _margin = new System.Windows.Forms.Padding(0, 0, 0, 0); + private static Padding _padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + + private static Size _minSize = new System.Drawing.Size(75, 23); + + private bool _active; + + public ShiftButton(): base() + { + base.Font = _normalFont; + base.BackColor = _border; + base.ForeColor = _fore; + base.FlatAppearance.BorderColor = _back; + base.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + base.Margin = _margin; + base.Padding = _padding; + base.MinimumSize = _minSize; + } + + protected override void OnControlAdded(ControlEventArgs e) + { + base.OnControlAdded(e); + UseVisualStyleBackColor = false; + } + + protected override void OnMouseEnter(System.EventArgs e) + { + base.OnMouseEnter(e); + if (!_active) + base.FlatAppearance.BorderColor = _activeBorder; + } + + protected override void OnMouseLeave(System.EventArgs e) + { + base.OnMouseLeave(e); + if (!_active) + base.FlatAppearance.BorderColor = _border; + } + + public void SetStateActive() + { + _active = true; + base.FlatAppearance.BorderColor = _activeBorder; + } + + public void SetStateNormal() { - InitializeComponent(); + _active = false; + base.FlatAppearance.BorderColor = _border; } } } |
