diff options
| author | FloppyDiskDrive <[email protected]> | 2017-11-19 10:21:34 -0600 |
|---|---|---|
| committer | FloppyDiskDrive <[email protected]> | 2017-11-19 10:21:34 -0600 |
| commit | 4534ff6252d2cd442d2180b024a94db1f4379f41 (patch) | |
| tree | a5619fd34dcbcb1953b2cb6cc9c035c516dc29e4 /ShiftOS.Engine/UI/ShiftButton.cs | |
| parent | 4c4ff1e06cecac8a52ac347e029ac19f1be4e244 (diff) | |
| download | shiftos-rewind-4534ff6252d2cd442d2180b024a94db1f4379f41.tar.gz shiftos-rewind-4534ff6252d2cd442d2180b024a94db1f4379f41.tar.bz2 shiftos-rewind-4534ff6252d2cd442d2180b024a94db1f4379f41.zip | |
Added new extremely buggy ShiftButton.
Diffstat (limited to 'ShiftOS.Engine/UI/ShiftButton.cs')
| -rw-r--r-- | ShiftOS.Engine/UI/ShiftButton.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/ShiftOS.Engine/UI/ShiftButton.cs b/ShiftOS.Engine/UI/ShiftButton.cs new file mode 100644 index 0000000..a025a40 --- /dev/null +++ b/ShiftOS.Engine/UI/ShiftButton.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShiftOS.Engine.UI +{ + public partial class ShiftButton : Control, IButtonControl + { + private bool _pressing = false; + private Color _lightBack; + public ShiftButton() + { + InitializeComponent(); + } + + public DialogResult DialogResult { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public void NotifyDefault(bool value) + { + + } + + public void PerformClick() + { + this.OnClick(new EventArgs()); + } + + protected override void OnPaint(PaintEventArgs pe) + { + base.OnPaint(pe); + this.Font = new Font("Lucida Console", 9, FontStyle.Regular); + _lightBack = Color.WhiteSmoke; + var g = pe.Graphics; + g.Clear(BackColor); + g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + var sf = new StringFormat(); + + if (_pressing) + { + g.FillRectangle(new SolidBrush(Color.White), 0, 0, Width, Height); + g.DrawString(Text, Font, new SolidBrush(Color.Black), ((Width / 2) + 1), (Height / 2) + 1); + } + else + { + g.FillRectangle(new SolidBrush(Color.WhiteSmoke), 0, 0, Width, Height); + } + } + } +} |
