aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine
diff options
context:
space:
mode:
authorFloppyDiskDrive <[email protected]>2017-09-13 19:07:23 -0500
committerFloppyDiskDrive <[email protected]>2017-09-13 19:07:23 -0500
commitefc8583dad8c9b22172cdb74e156df4803cfeadd (patch)
tree23cbe04f662e649d3fe28bf7c120d826ae51788f /Histacom2.Engine
parent282cdbca58ef7b4c3decaa942ad20333e3c15cfd (diff)
parentca482366718339b0684f64980dc67587222b4850 (diff)
downloadhistacom2-efc8583dad8c9b22172cdb74e156df4803cfeadd.tar.gz
histacom2-efc8583dad8c9b22172cdb74e156df4803cfeadd.tar.bz2
histacom2-efc8583dad8c9b22172cdb74e156df4803cfeadd.zip
Merge remote-tracking branch 'refs/remotes/Histacom2-Devs/master'
Diffstat (limited to 'Histacom2.Engine')
-rw-r--r--Histacom2.Engine/Histacom2.Engine.csproj5
-rw-r--r--Histacom2.Engine/Theme.cs15
-rw-r--r--Histacom2.Engine/UI/ClassicButton.cs22
-rw-r--r--Histacom2.Engine/UI/ClassicStartMenuItem.cs57
-rw-r--r--Histacom2.Engine/UI/IProgressBar.cs2
5 files changed, 93 insertions, 8 deletions
diff --git a/Histacom2.Engine/Histacom2.Engine.csproj b/Histacom2.Engine/Histacom2.Engine.csproj
index 69a1b02..889c071 100644
--- a/Histacom2.Engine/Histacom2.Engine.csproj
+++ b/Histacom2.Engine/Histacom2.Engine.csproj
@@ -15,7 +15,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>true</Optimize>
+ <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -97,6 +97,9 @@
<Compile Include="UI\ClassicLabel.cs">
<SubType>Component</SubType>
</Compile>
+ <Compile Include="UI\ClassicStartMenuItem.cs">
+ <SubType>Component</SubType>
+ </Compile>
<Compile Include="UI\ClassicTextbox.cs">
<SubType>Component</SubType>
</Compile>
diff --git a/Histacom2.Engine/Theme.cs b/Histacom2.Engine/Theme.cs
index 8385062..2d4633f 100644
--- a/Histacom2.Engine/Theme.cs
+++ b/Histacom2.Engine/Theme.cs
@@ -31,6 +31,9 @@ namespace Histacom2.Engine
public Color inactiveTitleBarColor { get; set; }
public Color inactiveTitleTextColor { get; set; }
+ public Color selectedBackColor { get; set; }
+ public Color selectedTextColor { get; set; }
+
public Image defaultWallpaper { get; set; }
public string themeName { get; set; }
@@ -61,6 +64,9 @@ namespace Histacom2.Engine
inactiveTitleBarColor = Color.Gray;
inactiveTitleTextColor = Color.Silver;
+ selectedBackColor = Color.Navy;
+ selectedTextColor = Color.White;
+
defaultWallpaper = null;
themeName = "default95";
}
@@ -91,6 +97,9 @@ namespace Histacom2.Engine
inactiveTitleBarColor = Color.Gray;
inactiveTitleTextColor = Color.Silver;
+ selectedBackColor = Color.Navy;
+ selectedTextColor = Color.White;
+
defaultWallpaper = null;
themeName = "default98";
}
@@ -121,6 +130,9 @@ namespace Histacom2.Engine
inactiveTitleBarColor = Color.FromArgb(72, 72, 72);
inactiveTitleTextColor = Color.Gray;
+ selectedBackColor = Color.Teal;
+ selectedTextColor = Color.White;
+
defaultWallpaper = Properties.Resources.Win95PlusDangerousCreaturesWallpaper;
themeName = "dangeranimals";
}
@@ -147,6 +159,9 @@ namespace Histacom2.Engine
inactiveTitleBarColor = Color.FromArgb(96, 168, 128);
inactiveTitleTextColor = Color.FromArgb(216, 224, 216);
+ selectedBackColor = Color.FromArgb(248, 255, 160);
+ selectedTextColor = Color.Black;
+
defaultWallpaper = Properties.Resources.Win95PlusInsideComputerWallpaper;
themeName = "insidepc";
}
diff --git a/Histacom2.Engine/UI/ClassicButton.cs b/Histacom2.Engine/UI/ClassicButton.cs
index 1a77964..9b1db72 100644
--- a/Histacom2.Engine/UI/ClassicButton.cs
+++ b/Histacom2.Engine/UI/ClassicButton.cs
@@ -28,19 +28,17 @@ namespace Histacom2.Engine.UI
}
}
+ public bool AdaptForeColorWithTheme = true;
+ public bool AdaptFontWithTheme = true;
+
public ClassicButton() : base()
{
+
if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor;
else BackColor = Color.Silver;
_lightBack = ControlPaint.Light(BackColor, 50);
_darkBack = ControlPaint.Dark(BackColor, 50);
- if (SaveSystem.currentTheme != null) ForeColor = SaveSystem.currentTheme.threeDObjectsTextColor;
- else ForeColor = Color.Black;
-
- if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
- else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
-
MouseDown += (s, e) => { _pressing = true; Invalidate(); };
MouseUp += (s, e) => { _pressing = false; Invalidate(); };
Invalidate();
@@ -53,6 +51,18 @@ namespace Histacom2.Engine.UI
if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor;
else BackColor = Color.Silver;
+ if (AdaptForeColorWithTheme)
+ {
+ if (SaveSystem.currentTheme != null) ForeColor = SaveSystem.currentTheme.threeDObjectsTextColor;
+ else ForeColor = Color.Black;
+ }
+
+ if (AdaptFontWithTheme)
+ {
+ if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
+ else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+ }
+
_lightBack = Paintbrush.GetLightFromColor(BackColor);
_darkBack = Paintbrush.GetDarkFromColor(BackColor);
diff --git a/Histacom2.Engine/UI/ClassicStartMenuItem.cs b/Histacom2.Engine/UI/ClassicStartMenuItem.cs
new file mode 100644
index 0000000..49aecd9
--- /dev/null
+++ b/Histacom2.Engine/UI/ClassicStartMenuItem.cs
@@ -0,0 +1,57 @@
+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 ClassicStartMenuItem : ToolStripMenuItem
+ {
+ public ClassicStartMenuItem()
+ {
+
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);
+ if (SaveSystem.currentTheme != null) e.Graphics.Clear(SaveSystem.currentTheme.threeDObjectsColor);
+ else e.Graphics.Clear(BackColor);
+ if (Selected)
+ {
+ if (SaveSystem.currentTheme != null) e.Graphics.Clear(SaveSystem.currentTheme.selectedBackColor);
+ else e.Graphics.Clear(Color.Navy);
+ }
+
+ e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
+
+ StringFormat sf = new StringFormat();
+ sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
+
+ e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0);
+ if (!Selected) {
+ e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), Brushes.Black, 38, 11, sf);
+
+ if (DropDownItems.Count > 0)
+ {
+ e.Graphics.DrawPolygon(Pens.Black, new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) });
+ e.Graphics.FillPolygon(Brushes.Black, new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) });
+ }
+ } else
+ {
+ if (SaveSystem.currentTheme != null)
+ {
+ e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), new SolidBrush(SaveSystem.currentTheme.selectedTextColor), 38, 11, sf);
+ if (DropDownItems.Count > 0)
+ {
+ e.Graphics.DrawPolygon(new Pen(SaveSystem.currentTheme.selectedTextColor), new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) });
+ e.Graphics.FillPolygon(new SolidBrush(SaveSystem.currentTheme.selectedTextColor), new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) });
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Histacom2.Engine/UI/IProgressBar.cs b/Histacom2.Engine/UI/IProgressBar.cs
index 071da18..2cd916d 100644
--- a/Histacom2.Engine/UI/IProgressBar.cs
+++ b/Histacom2.Engine/UI/IProgressBar.cs
@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
-namespace Histacom2.UI
+namespace Histacom2.Engine.UI
{
public class ProgressBar : Control
{