aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine/UI
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-09-09 19:16:44 -0400
committerlempamo <[email protected]>2017-09-09 19:16:44 -0400
commitc11ba68e8f319acc62b72259235a04b12892bffa (patch)
tree78f73a4055d97f90eb58c45d9f2301bafcb47972 /Histacom2.Engine/UI
parent60af0b389dfd98f05278f3259485d1d2349d2012 (diff)
downloadhistacom2-c11ba68e8f319acc62b72259235a04b12892bffa.tar.gz
histacom2-c11ba68e8f319acc62b72259235a04b12892bffa.tar.bz2
histacom2-c11ba68e8f319acc62b72259235a04b12892bffa.zip
finished the look of the textbox, but it doesnt work
Diffstat (limited to 'Histacom2.Engine/UI')
-rw-r--r--Histacom2.Engine/UI/ClassicTextbox.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/Histacom2.Engine/UI/ClassicTextbox.cs b/Histacom2.Engine/UI/ClassicTextbox.cs
index efe85a4..e38af16 100644
--- a/Histacom2.Engine/UI/ClassicTextbox.cs
+++ b/Histacom2.Engine/UI/ClassicTextbox.cs
@@ -10,9 +10,12 @@ namespace Histacom2.Engine.UI
{
public class ClassicTextbox : Control
{
+ public bool UseSystemPasswordChar { get; set; }
+
public ClassicTextbox() : base()
{
-
+ if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
+ else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
}
protected override void OnPaint(PaintEventArgs e)
@@ -28,9 +31,16 @@ namespace Histacom2.Engine.UI
var _lightBack = Paintbrush.GetLightFromColor(textboxcolor);
var _darkBack = Paintbrush.GetDarkFromColor(textboxcolor);
+ if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
+ else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+
var g = e.Graphics;
g.Clear(BackColor);
+ g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
+ if (UseSystemPasswordChar) g.DrawString(new string('●', Text.Length), Font, Brushes.Black, 3, 3);
+ else g.DrawString(Text, Font, Brushes.Black, 3, 3);
+
g.DrawLine(new Pen(_darkBack), 0, 0, Width - 2, 0);
g.DrawLine(new Pen(_lightBack), Width - 1, 0, Width - 1, Height - 1);
g.DrawLine(new Pen(_lightBack), 0, Height - 1, Width - 1, Height - 1);