aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFloppyDiskDrive <[email protected]>2017-09-12 19:27:23 -0500
committerFloppyDiskDrive <[email protected]>2017-09-12 19:27:23 -0500
commit20421d5f51523a20db4e10f7c70eefb932552710 (patch)
tree7cd5b04d0724831935def9199b3152b8eca6dc66
parentcb10dfe5c2004580f480f3e84c445fe7877be79b (diff)
parentc11ba68e8f319acc62b72259235a04b12892bffa (diff)
downloadhistacom2-20421d5f51523a20db4e10f7c70eefb932552710.tar.gz
histacom2-20421d5f51523a20db4e10f7c70eefb932552710.tar.bz2
histacom2-20421d5f51523a20db4e10f7c70eefb932552710.zip
Merge remote-tracking branch 'refs/remotes/Histacom2-Devs/master'
-rw-r--r--Histacom2.Engine/Histacom2.Engine.csproj3
-rw-r--r--Histacom2.Engine/Theme.cs10
-rw-r--r--Histacom2.Engine/UI/ClassicTextbox.cs54
3 files changed, 67 insertions, 0 deletions
diff --git a/Histacom2.Engine/Histacom2.Engine.csproj b/Histacom2.Engine/Histacom2.Engine.csproj
index 9b186d8..e8b62bc 100644
--- a/Histacom2.Engine/Histacom2.Engine.csproj
+++ b/Histacom2.Engine/Histacom2.Engine.csproj
@@ -94,6 +94,9 @@
<Compile Include="UI\ClassicButton.cs">
<SubType>Component</SubType>
</Compile>
+ <Compile Include="UI\ClassicTextbox.cs">
+ <SubType>Component</SubType>
+ </Compile>
<Compile Include="UI\IProgressBar.cs">
<SubType>Component</SubType>
</Compile>
diff --git a/Histacom2.Engine/Theme.cs b/Histacom2.Engine/Theme.cs
index 5b5ae50..8385062 100644
--- a/Histacom2.Engine/Theme.cs
+++ b/Histacom2.Engine/Theme.cs
@@ -24,6 +24,8 @@ namespace Histacom2.Engine
public Font buttonFont { get; set; }
+ public Color windowColor { get; set; }
+
public Color activeTitleBarColor { get; set; }
public Color activeTitleTextColor { get; set; }
public Color inactiveTitleBarColor { get; set; }
@@ -52,6 +54,8 @@ namespace Histacom2.Engine
buttonFont = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+ windowColor = Color.White;
+
activeTitleBarColor = Color.Navy;
activeTitleTextColor = Color.White;
inactiveTitleBarColor = Color.Gray;
@@ -80,6 +84,8 @@ namespace Histacom2.Engine
buttonFont = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+ windowColor = Color.White;
+
activeTitleBarColor = Color.Navy;
activeTitleTextColor = Color.White;
inactiveTitleBarColor = Color.Gray;
@@ -108,6 +114,8 @@ namespace Histacom2.Engine
buttonFont = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold);
+ windowColor = Color.FromArgb(184, 184, 184);
+
activeTitleBarColor = Color.Teal;
activeTitleTextColor = Color.White;
inactiveTitleBarColor = Color.FromArgb(72, 72, 72);
@@ -132,6 +140,8 @@ namespace Histacom2.Engine
buttonFont = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold);
+ windowColor = Color.White;
+
activeTitleBarColor = Color.FromArgb(224, 0, 0);
activeTitleTextColor = Color.White;
inactiveTitleBarColor = Color.FromArgb(96, 168, 128);
diff --git a/Histacom2.Engine/UI/ClassicTextbox.cs b/Histacom2.Engine/UI/ClassicTextbox.cs
new file mode 100644
index 0000000..e38af16
--- /dev/null
+++ b/Histacom2.Engine/UI/ClassicTextbox.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+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)
+ {
+ base.OnPaint(e);
+
+ var textboxcolor = Color.Silver;
+ if (SaveSystem.currentTheme != null) textboxcolor = SaveSystem.currentTheme.windowColor;
+
+ if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+ else BackColor = Color.White;
+
+ 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);
+ g.DrawLine(new Pen(_darkBack), 0, 0, 0, Height - 2);
+ g.DrawLine(Pens.Black, 1, 1, Width - 3, 1);
+ g.DrawLine(Pens.Black, 1, 1, 1, Height - 3);
+ g.DrawLine(new Pen(textboxcolor), 1, Height - 2, Width - 2, Height - 2);
+ g.DrawLine(new Pen(textboxcolor), Width - 2, Height - 2, Width - 2, 1);
+ }
+ }
+}