aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-11-04 09:50:43 +0000
committerAlex-TIMEHACK <[email protected]>2017-11-04 09:50:43 +0000
commitf933ce9b841a5f302066336877f86119de034eb4 (patch)
tree50e23551bae5ade3a263d9c1c054fb326a7ab5a6 /Histacom2.Engine
parent6ab1468786f1e865e9ff408d32149f9c9620d844 (diff)
parent382f0167714bbcad00ab710fe7dcfa05eaeb88ac (diff)
downloadhistacom2-f933ce9b841a5f302066336877f86119de034eb4.tar.gz
histacom2-f933ce9b841a5f302066336877f86119de034eb4.tar.bz2
histacom2-f933ce9b841a5f302066336877f86119de034eb4.zip
Updated my fork!
Conflicts: Histacom2/TitleScreen.Designer.cs Histacom2/TitleScreen.cs
Diffstat (limited to 'Histacom2.Engine')
-rw-r--r--Histacom2.Engine/Histacom2.Engine.csproj4
-rw-r--r--Histacom2.Engine/Paintbrush.cs5
-rw-r--r--Histacom2.Engine/Properties/Resources.Designer.cs20
-rw-r--r--Histacom2.Engine/Properties/Resources.resx20
-rw-r--r--Histacom2.Engine/Resources/WinXP/Window/WinXP_CloseHover.pngbin0 -> 1140 bytes
-rw-r--r--Histacom2.Engine/Resources/WinXP/Window/WinXP_ClosePress.pngbin0 -> 984 bytes
-rw-r--r--Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.pngbin241 -> 1452 bytes
-rw-r--r--Histacom2.Engine/SaveSystem.cs14
-rw-r--r--Histacom2.Engine/Template/AboutBox95.Designer.cs5
-rw-r--r--Histacom2.Engine/Template/AboutBox95.cs4
-rw-r--r--Histacom2.Engine/Template/WinClassic.Designer.cs19
-rw-r--r--Histacom2.Engine/Template/WinClassic.cs70
-rw-r--r--Histacom2.Engine/Template/WinClassic.resx48
-rw-r--r--Histacom2.Engine/Template/WinXP.Designer.cs42
-rw-r--r--Histacom2.Engine/Template/WinXP.cs16
-rw-r--r--Histacom2.Engine/UI/ClassicButton.cs2
-rw-r--r--Histacom2.Engine/UI/ClassicLabel.cs4
-rw-r--r--Histacom2.Engine/UI/ClassicStartMenuItem.cs15
-rw-r--r--Histacom2.Engine/WindowManager.cs47
19 files changed, 218 insertions, 117 deletions
diff --git a/Histacom2.Engine/Histacom2.Engine.csproj b/Histacom2.Engine/Histacom2.Engine.csproj
index 46d7427..1d36223 100644
--- a/Histacom2.Engine/Histacom2.Engine.csproj
+++ b/Histacom2.Engine/Histacom2.Engine.csproj
@@ -20,7 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <PlatformTarget>x86</PlatformTarget>
+ <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -255,6 +255,8 @@
<Content Include="Resources\Win95PlusTravelWallpaper.jpg" />
<Content Include="Resources\WinXP\Window\WinXP_Bottom.png" />
<Content Include="Resources\WinXP\Window\WinXP_Close.png" />
+ <None Include="Resources\WinXP\Window\WinXP_CloseHover.png" />
+ <None Include="Resources\WinXP\Window\WinXP_ClosePress.png" />
<Content Include="Resources\WinXP\Window\WinXP_LBCorner.png" />
<Content Include="Resources\WinXP\Window\WinXP_LeftSide.png" />
<Content Include="Resources\WinXP\Window\WinXP_Max.png" />
diff --git a/Histacom2.Engine/Paintbrush.cs b/Histacom2.Engine/Paintbrush.cs
index cab493a..923d836 100644
--- a/Histacom2.Engine/Paintbrush.cs
+++ b/Histacom2.Engine/Paintbrush.cs
@@ -46,6 +46,11 @@ namespace Histacom2.Engine
e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2);
}
+ /// <summary>
+ /// Get a color lighter than the input color.
+ /// </summary>
+ /// <param name="basecolor">The color to lighten.</param>
+ /// <returns></returns>
public static Color GetLightFromColor(Color basecolor)
{
if (basecolor == Color.Silver) return Color.White;
diff --git a/Histacom2.Engine/Properties/Resources.Designer.cs b/Histacom2.Engine/Properties/Resources.Designer.cs
index e8bf38e..fc8232a 100644
--- a/Histacom2.Engine/Properties/Resources.Designer.cs
+++ b/Histacom2.Engine/Properties/Resources.Designer.cs
@@ -1173,6 +1173,26 @@ namespace Histacom2.Engine.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
+ public static System.Drawing.Bitmap WinXP_CloseHover {
+ get {
+ object obj = ResourceManager.GetObject("WinXP_CloseHover", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// </summary>
+ public static System.Drawing.Bitmap WinXP_ClosePress {
+ get {
+ object obj = ResourceManager.GetObject("WinXP_ClosePress", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// </summary>
public static System.Drawing.Bitmap WinXP_LeftSide {
get {
object obj = ResourceManager.GetObject("WinXP_LeftSide", resourceCulture);
diff --git a/Histacom2.Engine/Properties/Resources.resx b/Histacom2.Engine/Properties/Resources.resx
index b2a1def..f8e7c10 100644
--- a/Histacom2.Engine/Properties/Resources.resx
+++ b/Histacom2.Engine/Properties/Resources.resx
@@ -119,25 +119,25 @@
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="WinClassicBottomLeft" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\resources\winclassic\window\bottomleft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ <value>..\Resources\WinClassic\Window\BottomLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WinClassicBottomRight" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\resources\winclassic\window\bottomright.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ <value>..\Resources\WinClassic\Window\BottomRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WinClassicBottomSide" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\resources\winclassic\window\bottomside.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ <value>..\Resources\WinClassic\Window\BottomSide.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WinClassicLeftSide" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\resources\winclassic\window\leftside.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ <value>..\Resources\WinClassic\Window\LeftSide.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LeviWindows" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\resources\winclassic\window\leviwindows.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>..\Resources\WinClassic\Window\LeviWindows.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="LeviWindows1" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\resources\winclassic\window\leviwindows.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>..\Resources\WinClassic\Window\LeviWindows.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="nullIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\resources\winclassic\window\nullicon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ <value>..\Resources\WinClassic\Window\nullicon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WinClassicRightSide" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\winclassic\window\rightside.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@@ -502,4 +502,10 @@
<data name="Win95PlusTravelWallpaper" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\win95plustravelwallpaper.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
+ <data name="WinXP_CloseHover" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\WinXP\Window\WinXP_CloseHover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="WinXP_ClosePress" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\WinXP\Window\WinXP_ClosePress.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
</root> \ No newline at end of file
diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_CloseHover.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_CloseHover.png
new file mode 100644
index 0000000..74c1638
--- /dev/null
+++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_CloseHover.png
Binary files differ
diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_ClosePress.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_ClosePress.png
new file mode 100644
index 0000000..80536ae
--- /dev/null
+++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_ClosePress.png
Binary files differ
diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.png
index b251673..4ed8242 100644
--- a/Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.png
+++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.png
Binary files differ
diff --git a/Histacom2.Engine/SaveSystem.cs b/Histacom2.Engine/SaveSystem.cs
index fcc6606..0975a2b 100644
--- a/Histacom2.Engine/SaveSystem.cs
+++ b/Histacom2.Engine/SaveSystem.cs
@@ -352,6 +352,15 @@ namespace Histacom2.Engine
break;
}
}
+ CurrentSave.BytesLeft = 916455424;
+ string toWrite = JsonConvert.SerializeObject(fsfi, Formatting.Indented);
+
+ File.WriteAllText(Path.Combine(ProfileProgramsDirectory, "_data.info"), toWrite);
+
+ fsfi = JsonConvert.DeserializeObject<FileSystemFolderInfo>(File.ReadAllText(Path.Combine(ProfileWindowsDirectory, "_data.info")));
+
+ Directory.Delete(Path.Combine(ProfileWindowsDirectory, "Desktop"), true);
+ SaveDirectoryInfo(ProfileWindowsDirectory, "Desktop", true, "Desktop", true);
}
}
@@ -810,7 +819,12 @@ namespace Histacom2.Engine
[Order]
public Theme customTheme { get; set; }
+
+ [Order]
public bool FTime98 { get; set; }
+
+ [Order]
+ public bool[] installed95 { get; set; } = new bool[7]; // 0: WC98, 1: FTP, 2: SR, 3: EB, 4: SKNDWS, 5: TD0.1, 6: GTN
}
public class FileSystemFolderInfo
diff --git a/Histacom2.Engine/Template/AboutBox95.Designer.cs b/Histacom2.Engine/Template/AboutBox95.Designer.cs
index 8ad5dea..c6877f6 100644
--- a/Histacom2.Engine/Template/AboutBox95.Designer.cs
+++ b/Histacom2.Engine/Template/AboutBox95.Designer.cs
@@ -100,7 +100,12 @@
//
// classicButton1
//
+ this.classicButton1.AdaptBackColorWithTheme = true;
+ this.classicButton1.AdaptFontWithTheme = true;
+ this.classicButton1.AdaptForeColorWithTheme = true;
this.classicButton1.BackColor = System.Drawing.Color.Silver;
+ this.classicButton1.DialogResult = System.Windows.Forms.DialogResult.None;
+ this.classicButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.classicButton1.ForeColor = System.Drawing.Color.Black;
this.classicButton1.Location = new System.Drawing.Point(251, 223);
this.classicButton1.Name = "classicButton1";
diff --git a/Histacom2.Engine/Template/AboutBox95.cs b/Histacom2.Engine/Template/AboutBox95.cs
index a97ab1c..188cf80 100644
--- a/Histacom2.Engine/Template/AboutBox95.cs
+++ b/Histacom2.Engine/Template/AboutBox95.cs
@@ -9,6 +9,10 @@ namespace Histacom2.Engine.Template
{
InitializeComponent();
this.textBox2.Text = "This product is licensed to:\r\n" + Environment.UserName + "\r\n";
+ textBox1.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+ textBox2.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+ textBox3.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
+ textBox4.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
}
private void classicButton1_Click(object sender, EventArgs e)
diff --git a/Histacom2.Engine/Template/WinClassic.Designer.cs b/Histacom2.Engine/Template/WinClassic.Designer.cs
index f788517..8b9497f 100644
--- a/Histacom2.Engine/Template/WinClassic.Designer.cs
+++ b/Histacom2.Engine/Template/WinClassic.Designer.cs
@@ -31,6 +31,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinClassic));
this.program = new System.Windows.Forms.Panel();
this.programContent = new System.Windows.Forms.Panel();
+ this.panel1 = new System.Windows.Forms.Panel();
this.programtopbar = new System.Windows.Forms.Panel();
this.programIcon = new System.Windows.Forms.PictureBox();
this.maximizebutton = new System.Windows.Forms.PictureBox();
@@ -45,7 +46,6 @@
this.bottom = new System.Windows.Forms.Panel();
this.right = new System.Windows.Forms.Panel();
this.top = new System.Windows.Forms.Panel();
- this.panel1 = new System.Windows.Forms.Panel();
this.program.SuspendLayout();
this.programtopbar.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit();
@@ -83,6 +83,14 @@
this.programContent.TabIndex = 9;
this.programContent.ControlAdded += new System.Windows.Forms.ControlEventHandler(this.programContent_ControlAdded);
//
+ // panel1
+ //
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(4, 22);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(292, 1);
+ this.panel1.TabIndex = 0;
+ //
// programtopbar
//
this.programtopbar.BackColor = System.Drawing.Color.Navy;
@@ -130,6 +138,7 @@
this.minimizebutton.Size = new System.Drawing.Size(16, 14);
this.minimizebutton.TabIndex = 5;
this.minimizebutton.TabStop = false;
+ this.minimizebutton.Click += new System.EventHandler(this.minimizebutton_Click);
//
// Title
//
@@ -267,14 +276,6 @@
this.top.MouseMove += new System.Windows.Forms.MouseEventHandler(this.top_MouseMove);
this.top.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp);
//
- // panel1
- //
- this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
- this.panel1.Location = new System.Drawing.Point(4, 22);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(292, 1);
- this.panel1.TabIndex = 0;
- //
// WinClassic
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs
index 68cba3d..c911af3 100644
--- a/Histacom2.Engine/Template/WinClassic.cs
+++ b/Histacom2.Engine/Template/WinClassic.cs
@@ -88,8 +88,11 @@ namespace Histacom2.Engine.Template
{
var toDraw = resizer.ToDraw;
if (resizable) {
- if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
- if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
}
resizer.ToDraw = toDraw;
}
@@ -100,8 +103,11 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) toDraw.Y = this.Location.Y;
- if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y;
+ if (resizable)
+ {
+ toDraw.Y = this.Location.Y;
+ toDraw.Height = MousePosition.Y - this.Location.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -111,8 +117,13 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
- if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y;
+ if (resizable)
+ {
+ if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8)
+ toDraw.Width = MousePosition.X - this.Location.X;
+ toDraw.Height = MousePosition.Y - this.Location.Y;
+ }
+
resizer.ToDraw = toDraw;
}
}
@@ -122,9 +133,15 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X);
- if (resizable) toDraw.Height = Cursor.Position.Y - this.Location.Y;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
+ if (resizable)
+ {
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
+ toDraw.Height = Cursor.Position.Y - this.Location.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -134,10 +151,16 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
- if (resizable) toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
+ toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -147,8 +170,11 @@ namespace Histacom2.Engine.Template
if(e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -158,9 +184,12 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
- if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
+ toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -301,6 +330,11 @@ namespace Histacom2.Engine.Template
gfx.DrawLine(new Pen(_darkBack), 0, 2, 2, 2);
}
+ private void minimizebutton_Click(object sender, EventArgs e)
+ {
+ Hide();
+ }
+
public Size prevSize;
public Point prevPoint;
private void maximizebutton_Click(object sender, EventArgs e)
diff --git a/Histacom2.Engine/Template/WinClassic.resx b/Histacom2.Engine/Template/WinClassic.resx
index a3848f8..ea30fa1 100644
--- a/Histacom2.Engine/Template/WinClassic.resx
+++ b/Histacom2.Engine/Template/WinClassic.resx
@@ -118,6 +118,30 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="maximizebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+ wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA+SURBVChTY/hP
+ CmAAAiB1nzjQ0NCA0HDgwAEQBwcAygIBNTRAJNDAqAY0DbgAdg0EAUIDkEUkAGkgDTAwAACYPGiagsMD
+ PwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="minimizebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+ wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA5SURBVChTY/hP
+ CmAAAiB1nzjQ0NCA0HCACDCqASqGF2DRAOKjAog4BFBDA36A0ABkEQlAGkgDDAwAKPmlWmNluNoAAAAA
+ SUVORK5CYII=
+</value>
+ </data>
+ <data name="closebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+ wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAABcSURBVChTrY/R
+ DcAgCERvdEbrJh2lPU+SYkINRt+PSN6J4FkBhMddw8y+wFUgCbQ70OtO7OQTJLgRa/L7JWmOt8RsB8mD
+ TQ5NkFbeQcLwauzMdkjZCLAq0gJrAC8niIXaIK89FAAAAABJRU5ErkJggg==
+</value>
+ </data>
<data name="toprightcorner.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -174,28 +198,4 @@
/DTD////wfTh46cBUSgJ/bC/izUAAAAASUVORK5CYII=
</value>
</data>
- <data name="maximizebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA+SURBVChTY/hP
- CmAAAiB1nzjQ0NCA0HDgwAEQBwcAygIBNTRAJNDAqAY0DbgAdg0EAUIDkEUkAGkgDTAwAACYPGiagsMD
- PwAAAABJRU5ErkJggg==
-</value>
- </data>
- <data name="minimizebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA5SURBVChTY/hP
- CmAAAiB1nzjQ0NCA0HCACDCqASqGF2DRAOKjAog4BFBDA36A0ABkEQlAGkgDDAwAKPmlWmNluNoAAAAA
- SUVORK5CYII=
-</value>
- </data>
- <data name="closebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAABcSURBVChTrY/R
- DcAgCERvdEbrJh2lPU+SYkINRt+PSN6J4FkBhMddw8y+wFUgCbQ70OtO7OQTJLgRa/L7JWmOt8RsB8mD
- TQ5NkFbeQcLwauzMdkjZCLAq0gJrAC8niIXaIK89FAAAAABJRU5ErkJggg==
-</value>
- </data>
</root> \ No newline at end of file
diff --git a/Histacom2.Engine/Template/WinXP.Designer.cs b/Histacom2.Engine/Template/WinXP.Designer.cs
index 0d1e060..3e1da44 100644
--- a/Histacom2.Engine/Template/WinXP.Designer.cs
+++ b/Histacom2.Engine/Template/WinXP.Designer.cs
@@ -30,8 +30,8 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinXP));
this.program = new System.Windows.Forms.Panel();
- this.flowLayoutPanel1 = new System.Windows.Forms.Panel();
this.bottomleftcorner = new System.Windows.Forms.Panel();
+ this.flowLayoutPanel1 = new System.Windows.Forms.Panel();
this.toprightcorner = new System.Windows.Forms.Panel();
this.bottomrightcorner = new System.Windows.Forms.Panel();
this.topleftcorner = new System.Windows.Forms.Panel();
@@ -55,8 +55,8 @@
// program
//
this.program.BackColor = System.Drawing.Color.OldLace;
- this.program.Controls.Add(this.flowLayoutPanel1);
this.program.Controls.Add(this.bottomleftcorner);
+ this.program.Controls.Add(this.flowLayoutPanel1);
this.program.Controls.Add(this.toprightcorner);
this.program.Controls.Add(this.bottomrightcorner);
this.program.Controls.Add(this.topleftcorner);
@@ -70,23 +70,24 @@
this.program.Size = new System.Drawing.Size(300, 300);
this.program.TabIndex = 10;
//
- // flowLayoutPanel1
- //
- this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 30);
- this.flowLayoutPanel1.Name = "flowLayoutPanel1";
- this.flowLayoutPanel1.Size = new System.Drawing.Size(292, 266);
- this.flowLayoutPanel1.TabIndex = 11;
- //
// bottomleftcorner
//
this.bottomleftcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.bottomleftcorner.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_BottomLeft;
+ this.bottomleftcorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.bottomleftcorner.Location = new System.Drawing.Point(0, 296);
this.bottomleftcorner.Name = "bottomleftcorner";
- this.bottomleftcorner.Size = new System.Drawing.Size(5, 4);
+ this.bottomleftcorner.Size = new System.Drawing.Size(4, 4);
this.bottomleftcorner.TabIndex = 10;
//
+ // flowLayoutPanel1
+ //
+ this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 30);
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(292, 266);
+ this.flowLayoutPanel1.TabIndex = 11;
+ //
// toprightcorner
//
this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -120,6 +121,7 @@
// bottom
//
this.bottom.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_Bottom;
+ this.bottom.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.bottom.Cursor = System.Windows.Forms.Cursors.SizeNS;
this.bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.bottom.Location = new System.Drawing.Point(4, 296);
@@ -131,6 +133,7 @@
//
this.top.BackColor = System.Drawing.Color.Transparent;
this.top.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_TopBar;
+ this.top.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.top.Controls.Add(this.programIcon);
this.top.Controls.Add(this.maximizebutton);
this.top.Controls.Add(this.minimizebutton);
@@ -178,11 +181,11 @@
//
this.programname.AutoSize = true;
this.programname.BackColor = System.Drawing.Color.Transparent;
- this.programname.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.programname.Font = new System.Drawing.Font("Trebuchet MS", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.programname.ForeColor = System.Drawing.Color.White;
- this.programname.Location = new System.Drawing.Point(25, 8);
+ this.programname.Location = new System.Drawing.Point(25, 6);
this.programname.Name = "programname";
- this.programname.Size = new System.Drawing.Size(99, 13);
+ this.programname.Size = new System.Drawing.Size(110, 18);
this.programname.TabIndex = 3;
this.programname.Text = "Application Title";
this.programname.MouseDown += new System.Windows.Forms.MouseEventHandler(this.top_MouseDown);
@@ -197,6 +200,9 @@
this.closebutton.TabIndex = 4;
this.closebutton.TabStop = false;
this.closebutton.Click += new System.EventHandler(this.closebutton_Click);
+ this.closebutton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.closebutton_MouseDown);
+ this.closebutton.MouseEnter += new System.EventHandler(this.closebutton_MouseEnter);
+ this.closebutton.MouseLeave += new System.EventHandler(this.closebutton_MouseLeave);
//
// right
//
@@ -221,11 +227,13 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.Color.Magenta;
this.ClientSize = new System.Drawing.Size(300, 300);
this.Controls.Add(this.program);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "WinXP";
this.Text = "WinXP";
+ this.TransparencyKey = System.Drawing.Color.Magenta;
this.Load += new System.EventHandler(this.WinXP_Load);
this.program.ResumeLayout(false);
this.top.ResumeLayout(false);
@@ -247,13 +255,13 @@
internal System.Windows.Forms.Panel topleftcorner;
internal System.Windows.Forms.Panel bottom;
internal System.Windows.Forms.Panel top;
- internal System.Windows.Forms.PictureBox maximizebutton;
- internal System.Windows.Forms.PictureBox minimizebutton;
internal System.Windows.Forms.Label programname;
- internal System.Windows.Forms.PictureBox closebutton;
internal System.Windows.Forms.Panel right;
internal System.Windows.Forms.Panel left;
public System.Windows.Forms.PictureBox programIcon;
public System.Windows.Forms.Panel flowLayoutPanel1;
+ public System.Windows.Forms.PictureBox maximizebutton;
+ public System.Windows.Forms.PictureBox minimizebutton;
+ public System.Windows.Forms.PictureBox closebutton;
}
} \ No newline at end of file
diff --git a/Histacom2.Engine/Template/WinXP.cs b/Histacom2.Engine/Template/WinXP.cs
index 2f51c1c..d572fe8 100644
--- a/Histacom2.Engine/Template/WinXP.cs
+++ b/Histacom2.Engine/Template/WinXP.cs
@@ -17,6 +17,7 @@ namespace Histacom2.Engine.Template
public WinXP()
{
InitializeComponent();
+ SetStyle(ControlStyles.SupportsTransparentBackColor, true);
DoubleBuffered = true;
}
@@ -44,6 +45,21 @@ namespace Histacom2.Engine.Template
HTBOTTOMLEFT = 16,
HTBOTTOMRIGHT = 17;
+ private void closebutton_MouseDown(object sender, MouseEventArgs e)
+ {
+ closebutton.BackgroundImage = Properties.Resources.WinXP_ClosePress;
+ }
+
+ private void closebutton_MouseLeave(object sender, EventArgs e)
+ {
+ closebutton.BackgroundImage = Properties.Resources.WinXP_Close;
+ }
+
+ private void closebutton_MouseEnter(object sender, EventArgs e)
+ {
+ closebutton.BackgroundImage = Properties.Resources.WinXP_CloseHover;
+ }
+
private void closebutton_Click(object sender, EventArgs e)
{
if (!closeDisabled) this.Close();
diff --git a/Histacom2.Engine/UI/ClassicButton.cs b/Histacom2.Engine/UI/ClassicButton.cs
index 4ccdbe6..683b71b 100644
--- a/Histacom2.Engine/UI/ClassicButton.cs
+++ b/Histacom2.Engine/UI/ClassicButton.cs
@@ -94,7 +94,7 @@ namespace Histacom2.Engine.UI
public void PerformClick()
{
- this.OnClick(new EventArgs());
+ OnClick(EventArgs.Empty);
}
}
}
diff --git a/Histacom2.Engine/UI/ClassicLabel.cs b/Histacom2.Engine/UI/ClassicLabel.cs
index eba8dc6..60bd9b7 100644
--- a/Histacom2.Engine/UI/ClassicLabel.cs
+++ b/Histacom2.Engine/UI/ClassicLabel.cs
@@ -25,9 +25,11 @@ namespace Histacom2.Engine.UI
base.OnPaint(e);
var gfx = e.Graphics;
if (BackColor != Color.Transparent) gfx.Clear(BackColor);
+ StringFormat sf = new StringFormat();
+ sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
- gfx.DrawString(Text, Font, new SolidBrush(ForeColor), ClientRectangle);
+ gfx.DrawString(Text, Font, new SolidBrush(ForeColor), ClientRectangle, sf);
Height = (int)gfx.MeasureString(Text, Font, ClientRectangle.Width).Height;
}
diff --git a/Histacom2.Engine/UI/ClassicStartMenuItem.cs b/Histacom2.Engine/UI/ClassicStartMenuItem.cs
index dcb8361..5e3a3a7 100644
--- a/Histacom2.Engine/UI/ClassicStartMenuItem.cs
+++ b/Histacom2.Engine/UI/ClassicStartMenuItem.cs
@@ -56,22 +56,23 @@ namespace Histacom2.Engine.UI
{
if (BackgroundImageLayout == ImageLayout.Stretch) e.Graphics.DrawImage(BackgroundImage, new Rectangle(0, 0, Width, Height + 9));
}
-
- if (Selected)
+ int imgWidth = 0;
+ if (Image != null)
+ {
+ if (Selected)
{
if (SaveSystem.currentTheme != null && DoBackColorAdapt) e.Graphics.FillRectangle(new SolidBrush(SaveSystem.currentTheme.selectedBackColor), new Rectangle(0, 0, Width, Image.Height));
else e.Graphics.FillRectangle(Brushes.Navy, new Rectangle(0, 0, Width, Image.Height));
}
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
+
+ e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); imgWidth = Image.Width; }
+ //if (Image != null) if (Height != Image.Height) if (layout == ClassicStartMenuItemLayout.CloseTitleWithLightSubtitle && Height != Image.Height + 8) { Height = Image.Height; }
StringFormat sf = new StringFormat();
sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
- int imgWidth = 0;
- if (Image != null) { e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); imgWidth = Image.Width; }
- //if (Image != null) if (Height != Image.Height) if (layout == ClassicStartMenuItemLayout.CloseTitleWithLightSubtitle && Height != Image.Height + 8) { Height = Image.Height; }
-
if (!Selected) {
switch (layout) {
case ClassicStartMenuItemLayout.DistancedTitle:
@@ -133,7 +134,7 @@ namespace Histacom2.Engine.UI
{
DistancedTitle,
CloseTitle,
- CloseTitleWithTwoLines,
+ //CloseTitleWithTwoLines,
CloseTitleWithLightSubtitle
}
}
diff --git a/Histacom2.Engine/WindowManager.cs b/Histacom2.Engine/WindowManager.cs
index 04de392..03fe91b 100644
--- a/Histacom2.Engine/WindowManager.cs
+++ b/Histacom2.Engine/WindowManager.cs
@@ -10,38 +10,21 @@ namespace Histacom2.Engine
{
public static System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection();
+ /// <summary>
+ /// Creates and returns a WinClassic window.
+ /// </summary>
+ /// <param name="content">The UserControl to put inside the window.</param>
+ /// <param name="title">The name of the window.</param>
+ /// <param name="icon">The window's icon. If set to null, then the title moves over to compensate.</param>
+ /// <param name="MaxButton">Whether or not the maximize button is shown.</param>
+ /// <param name="MinButton">Whether or not the minimize button is shown.</param>
+ /// <param name="ShowApplicationAsDialog">Whether or not to interrupt all other processes while this window is open.</param>
+ /// <param name="resize">Whether or not this window is resizable.</param>
+ /// <returns></returns>
public WinClassic Init(UserControl content, string title, Image icon, bool MaxButton, bool MinButton, bool ShowApplicationAsDialog = false, bool resize = true)
{
- WinClassic app = null;
- // Setup Window
- switch (SaveSystem.CurrentSave.CurrentOS)
- {
- case "95":
- {
- app = new WinClassic();
- break;
- }
- case "98":
- {
- app = new WinClassic();
- break;
- }
- case "ME":
- {
- app = new WinClassic();
- break;
- }
- case "2000":
- {
- app = new WinClassic();
- break;
- }
- default:
- {
- app = new WinClassic();
- break;
- }
- }
+ WinClassic app = new WinClassic();
+
app.Text = title;
app.Title.Text = title;
app.Width = content.Width + 8;
@@ -128,8 +111,8 @@ namespace Histacom2.Engine
if (icon == null)
{
app.programIcon.Hide();
- app.programIcon.Image = Engine.Properties.Resources.nullIcon;
- app.programname.Location = new Point(2, 1);
+ app.programIcon.Image = Properties.Resources.nullIcon;
+ app.programname.Location = new Point(3, 6);
}
else app.programIcon.Image = icon;