WIP ClassicTextbox

This commit is contained in:
lempamo 2017-09-08 11:03:22 -04:00
parent 584789ed8a
commit 60af0b389d
3 changed files with 57 additions and 0 deletions

View file

@ -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>

View file

@ -24,6 +24,8 @@ public class Theme
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 @@ public Default95Theme()
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 @@ public Default98Theme()
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 @@ public DangerousCreaturesTheme()
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 @@ public InsideComputerTheme()
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);

View file

@ -0,0 +1,44 @@
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 ClassicTextbox() : base()
{
}
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);
var g = e.Graphics;
g.Clear(BackColor);
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);
}
}
}