aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine/UI/ClassicButton.cs
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-09-23 12:23:10 -0400
committerlempamo <[email protected]>2017-09-23 12:23:10 -0400
commit1ee3e00f8f0ee879fce4edf7d1ba9889335bc826 (patch)
treeb446c4d9856ad463c11d087da4355efbf5630da7 /Histacom2.Engine/UI/ClassicButton.cs
parent245a7c360bf2b6a6892abd32d3693847103d1132 (diff)
downloadhistacom2-1ee3e00f8f0ee879fce4edf7d1ba9889335bc826.tar.gz
histacom2-1ee3e00f8f0ee879fce4edf7d1ba9889335bc826.tar.bz2
histacom2-1ee3e00f8f0ee879fce4edf7d1ba9889335bc826.zip
EULA Pane & Disabled buttons
Diffstat (limited to 'Histacom2.Engine/UI/ClassicButton.cs')
-rw-r--r--Histacom2.Engine/UI/ClassicButton.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Histacom2.Engine/UI/ClassicButton.cs b/Histacom2.Engine/UI/ClassicButton.cs
index 29b3a3b..4ccdbe6 100644
--- a/Histacom2.Engine/UI/ClassicButton.cs
+++ b/Histacom2.Engine/UI/ClassicButton.cs
@@ -63,16 +63,17 @@ namespace Histacom2.Engine.UI
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
+ sf.LineAlignment = StringAlignment.Center;
sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
- if (_pressing)
+ if (_pressing && Enabled)
{
g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width, Height));
g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width - 1, Height - 1));
g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2));
g.FillRectangle(new SolidBrush(BackColor), new Rectangle(2, 2, Width - 3, Height - 3));
- g.DrawString(Text, Font, new SolidBrush(ForeColor), ((Width / 2) + 1) + Padding.Left, (Height / 2) - (g.MeasureString(Text, Font).Height / 2) + 2, sf);
+ g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(2, 2, Width - 3, Height - 3), sf);
}
else
{
@@ -81,7 +82,8 @@ namespace Histacom2.Engine.UI
g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2));
g.FillRectangle(new SolidBrush(BackColor), new Rectangle(1, 1, Width - 3, Height - 3));
- g.DrawString(Text, Font, new SolidBrush(ForeColor), (Width / 2) + Padding.Left, (Height / 2) - (g.MeasureString(Text, Font).Height / 2) + 1, sf);
+ if (Enabled) g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(1, 1, Width - 3, Height - 3), sf);
+ else g.DrawString(Text, Font, new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 3, Height - 3), sf);
}
}