diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-09-23 17:25:22 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-09-23 17:25:22 +0100 |
| commit | 350e749bb9eab16efe753f9b8fd703b52a97f808 (patch) | |
| tree | 9c90ec1a8148d66d9ff8605710a992e5e14a6b7e /Histacom2.Engine | |
| parent | 84ef033af262343febc3f84471233e18bc6b502e (diff) | |
| parent | 1ee3e00f8f0ee879fce4edf7d1ba9889335bc826 (diff) | |
| download | histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.gz histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.bz2 histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.zip | |
Merge branch 'master' of https://github.com/Histacom2-Devs/Histacom2
Diffstat (limited to 'Histacom2.Engine')
37 files changed, 1347 insertions, 428 deletions
diff --git a/Histacom2.Engine/BSODCreator.cs b/Histacom2.Engine/BSODCreator.cs index fb693a9..0e1ebf1 100644 --- a/Histacom2.Engine/BSODCreator.cs +++ b/Histacom2.Engine/BSODCreator.cs @@ -17,6 +17,7 @@ namespace Histacom2.Engine Testing, WimpEnding, PiracyEnding, + Generic } public Win9XBSOD throw9XBSOD(bool except, BSODCauses type) @@ -44,6 +45,9 @@ namespace Histacom2.Engine bsod.label1.BackColor = System.Drawing.Color.Silver; bsod.label1.ForeColor = System.Drawing.Color.Black; break; + case BSODCauses.Generic: + + break; default: break; } diff --git a/Histacom2.Engine/Histacom2.Engine.csproj b/Histacom2.Engine/Histacom2.Engine.csproj index 361672e..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> @@ -84,12 +84,24 @@ <Compile Include="Template\WinClassic.Designer.cs"> <DependentUpon>WinClassic.cs</DependentUpon> </Compile> + <Compile Include="Template\WinXP.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Template\WinXP.Designer.cs"> + <DependentUpon>WinXP.cs</DependentUpon> + </Compile> <Compile Include="Theme.cs" /> <Compile Include="UI\ClassicButton.cs"> - <SubType>UserControl</SubType> + <SubType>Component</SubType> </Compile> - <Compile Include="UI\ClassicButton.Designer.cs"> - <DependentUpon>ClassicButton.cs</DependentUpon> + <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> <Compile Include="UI\IProgressBar.cs"> <SubType>Component</SubType> @@ -123,13 +135,25 @@ <EmbeddedResource Include="Template\WinClassic.resx"> <DependentUpon>WinClassic.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="UI\ClassicButton.resx"> - <DependentUpon>ClassicButton.cs</DependentUpon> + <EmbeddedResource Include="Template\WinXP.resx"> + <DependentUpon>WinXP.cs</DependentUpon> </EmbeddedResource> </ItemGroup> <ItemGroup> <Content Include="Resources\chord.wav" /> <Content Include="Resources\Icon128x.ico" /> + <Content Include="Resources\WinXP\Window\WinXP_Bottom.png" /> + <Content Include="Resources\WinXP\Window\WinXP_Close.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" /> + <Content Include="Resources\WinXP\Window\WinXP_Min.png" /> + <Content Include="Resources\WinXP\Window\WinXP_RBCorner.png" /> + <Content Include="Resources\WinXP\Window\WinXP_Restore.png" /> + <Content Include="Resources\WinXP\Window\WinXP_RightSide.png" /> + <Content Include="Resources\WinXP\Window\WinXP_TLCorner.png" /> + <Content Include="Resources\WinXP\Window\WinXP_TopBar.png" /> + <Content Include="Resources\WinXP\Window\WinXP_TRCorner.png" /> <None Include="Resources\WinAboutSeparator95.png" /> <None Include="Resources\Win95PlusDangerousCreaturesStart.WAV" /> <None Include="Resources\Win95Start.wav" /> diff --git a/Histacom2.Engine/Paintbrush.cs b/Histacom2.Engine/Paintbrush.cs index 320b80d..ff715d2 100644 --- a/Histacom2.Engine/Paintbrush.cs +++ b/Histacom2.Engine/Paintbrush.cs @@ -45,5 +45,23 @@ namespace Histacom2.Engine // Draw the line. e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2); } + + public static Color GetLightFromColor(Color basecolor) + { + if (basecolor == Color.Silver) return Color.White; + if (basecolor == Color.Green) return Color.FromArgb(64, 255, 64); + if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(184, 184, 184); + if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(218, 223, 218); + return ControlPaint.Light(basecolor, 70); + } + + public static Color GetDarkFromColor(Color basecolor) + { + if (basecolor == Color.Silver) return Color.Gray; + if (basecolor == Color.Green) return Color.FromArgb(0, 83, 0); + if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(72, 72, 72); + if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(95, 153, 95); + return ControlPaint.Dark(basecolor, 70); + } } } diff --git a/Histacom2.Engine/Properties/Resources.Designer.cs b/Histacom2.Engine/Properties/Resources.Designer.cs index 7a4cdf6..949a91c 100644 --- a/Histacom2.Engine/Properties/Resources.Designer.cs +++ b/Histacom2.Engine/Properties/Resources.Designer.cs @@ -61,36 +61,6 @@ namespace Histacom2.Engine.Properties { } /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> - public static System.Drawing.Bitmap BottomLeft { - get { - object obj = ResourceManager.GetObject("BottomLeft", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> - public static System.Drawing.Bitmap BottomRight { - get { - object obj = ResourceManager.GetObject("BottomRight", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> - public static System.Drawing.Bitmap BottomSide { - get { - object obj = ResourceManager.GetObject("BottomSide", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// </summary> public static System.IO.UnmanagedMemoryStream CHORD { @@ -100,16 +70,6 @@ namespace Histacom2.Engine.Properties { } /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> - public static System.Drawing.Bitmap LeftSide { - get { - object obj = ResourceManager.GetObject("LeftSide", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> /// Looks up a localized resource of type System.Byte[]. /// </summary> public static byte[] LeviWindows { @@ -142,46 +102,6 @@ namespace Histacom2.Engine.Properties { /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> - public static System.Drawing.Bitmap RightSide { - get { - object obj = ResourceManager.GetObject("RightSide", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> - public static System.Drawing.Bitmap TopLeft { - get { - object obj = ResourceManager.GetObject("TopLeft", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> - public static System.Drawing.Bitmap TopRight { - get { - object obj = ResourceManager.GetObject("TopRight", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> - public static System.Drawing.Bitmap TopSide { - get { - object obj = ResourceManager.GetObject("TopSide", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// <summary> - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// </summary> public static System.Drawing.Bitmap Win95Error { get { object obj = ResourceManager.GetObject("Win95Error", resourceCulture); @@ -369,6 +289,36 @@ namespace Histacom2.Engine.Properties { /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> + public static System.Drawing.Bitmap WinClassicBottomLeft { + get { + object obj = ResourceManager.GetObject("WinClassicBottomLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinClassicBottomRight { + get { + object obj = ResourceManager.GetObject("WinClassicBottomRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinClassicBottomSide { + get { + object obj = ResourceManager.GetObject("WinClassicBottomSide", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> public static System.Drawing.Bitmap WinClassicClose { get { object obj = ResourceManager.GetObject("WinClassicClose", resourceCulture); @@ -379,6 +329,16 @@ namespace Histacom2.Engine.Properties { /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> + public static System.Drawing.Bitmap WinClassicLeftSide { + get { + object obj = ResourceManager.GetObject("WinClassicLeftSide", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> public static System.Drawing.Bitmap WinClassicMax { get { object obj = ResourceManager.GetObject("WinClassicMax", resourceCulture); @@ -407,6 +367,46 @@ namespace Histacom2.Engine.Properties { } /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinClassicRightSide { + get { + object obj = ResourceManager.GetObject("WinClassicRightSide", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinClassicTopLeft { + get { + object obj = ResourceManager.GetObject("WinClassicTopLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinClassicTopRight { + get { + object obj = ResourceManager.GetObject("WinClassicTopRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinClassicTopSide { + get { + object obj = ResourceManager.GetObject("WinClassicTopSide", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> /// Looks up a localized resource of type System.Byte[]. /// </summary> public static byte[] windows_command_prompt { @@ -415,5 +415,125 @@ namespace Histacom2.Engine.Properties { return ((byte[])(obj)); } } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_Bottom { + get { + object obj = ResourceManager.GetObject("WinXP_Bottom", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_BottomLeft { + get { + object obj = ResourceManager.GetObject("WinXP_BottomLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_BottomRight { + get { + object obj = ResourceManager.GetObject("WinXP_BottomRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_Close { + get { + object obj = ResourceManager.GetObject("WinXP_Close", 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); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_Max { + get { + object obj = ResourceManager.GetObject("WinXP_Max", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_Min { + get { + object obj = ResourceManager.GetObject("WinXP_Min", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_Restore { + get { + object obj = ResourceManager.GetObject("WinXP_Restore", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_RightSide { + get { + object obj = ResourceManager.GetObject("WinXP_RightSide", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_TopBar { + get { + object obj = ResourceManager.GetObject("WinXP_TopBar", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_TopLeft { + get { + object obj = ResourceManager.GetObject("WinXP_TopLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + public static System.Drawing.Bitmap WinXP_TopRight { + get { + object obj = ResourceManager.GetObject("WinXP_TopRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Histacom2.Engine/Properties/Resources.resx b/Histacom2.Engine/Properties/Resources.resx index 94b3988..a6faf66 100644 --- a/Histacom2.Engine/Properties/Resources.resx +++ b/Histacom2.Engine/Properties/Resources.resx @@ -118,16 +118,16 @@ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> - <data name="BottomLeft" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <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> </data> - <data name="BottomRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <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> </data> - <data name="BottomSide" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <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> </data> - <data name="LeftSide" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <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> </data> <data name="LeviWindows" type="System.Resources.ResXFileRef, System.Windows.Forms"> @@ -139,16 +139,16 @@ <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> </data> - <data name="RightSide" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <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> </data> - <data name="TopLeft" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <data name="WinClassicTopLeft" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\resources\winclassic\window\topleft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> - <data name="TopRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <data name="WinClassicTopRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\resources\winclassic\window\topright.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> - <data name="TopSide" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <data name="WinClassicTopSide" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\resources\winclassic\window\topside.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> <data name="WinClassicClose" type="System.Resources.ResXFileRef, System.Windows.Forms"> @@ -229,4 +229,40 @@ <data name="Win95PlusInsideComputerAsterisk" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\Win95PlusInsideComputerAsterisk.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> + <data name="WinXP_Bottom" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_bottom.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_BottomLeft" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_lbcorner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_BottomRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_rbcorner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_Close" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_LeftSide" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_leftside.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_Max" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_max.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_Min" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_min.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_Restore" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_restore.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_RightSide" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_rightside.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_TopBar" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_topbar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_TopLeft" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_tlcorner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="WinXP_TopRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\winxp\window\winxp_trcorner.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_Bottom.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Bottom.png Binary files differnew file mode 100644 index 0000000..2025b77 --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Bottom.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_Close.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Close.png Binary files differnew file mode 100644 index 0000000..173ac3e --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Close.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_LBCorner.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_LBCorner.png Binary files differnew file mode 100644 index 0000000..136a49b --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_LBCorner.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_LeftSide.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_LeftSide.png Binary files differnew file mode 100644 index 0000000..85aca4d --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_LeftSide.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_Max.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Max.png Binary files differnew file mode 100644 index 0000000..c470eff --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Max.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_Min.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Min.png Binary files differnew file mode 100644 index 0000000..a7ec34f --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Min.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_RBCorner.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_RBCorner.png Binary files differnew file mode 100644 index 0000000..e546966 --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_RBCorner.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_Restore.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Restore.png Binary files differnew file mode 100644 index 0000000..304401f --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_Restore.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_RightSide.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_RightSide.png Binary files differnew file mode 100644 index 0000000..a7a6d4a --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_RightSide.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_TLCorner.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TLCorner.png Binary files differnew file mode 100644 index 0000000..79730ff --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TLCorner.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_TRCorner.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TRCorner.png Binary files differnew file mode 100644 index 0000000..603c164 --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TRCorner.png diff --git a/Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.png b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.png Binary files differnew file mode 100644 index 0000000..b251673 --- /dev/null +++ b/Histacom2.Engine/Resources/WinXP/Window/WinXP_TopBar.png diff --git a/Histacom2.Engine/SaveSystem.cs b/Histacom2.Engine/SaveSystem.cs index b8c619e..79333bd 100644 --- a/Histacom2.Engine/SaveSystem.cs +++ b/Histacom2.Engine/SaveSystem.cs @@ -171,13 +171,13 @@ namespace Histacom2.Engine SaveDirectoryInfo(ProfileMyComputerDirectory, "Program Files", true, "Program Files", true); SaveDirectoryInfo(ProfileProgramsDirectory, "Accessories", false, "Accessories", true); SaveDirectoryInfo(ProfileProgramsDirectory, "Internet Explorer", true, "Internet Explorer", true); - SaveDirectoryInfo(ProfileProgramsDirectory, "The Microsoft Network", true, "The Microsoft Network", true); + if (CurrentSave.CurrentOS == "95") SaveDirectoryInfo(ProfileProgramsDirectory, "The Microsoft Network", true, "The Microsoft Network", true); SaveDirectoryInfo(ProfileMyComputerDirectory, "Windows", true, "Windows", true); CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories"), "wordpad.exe", "wordpad", 16, 183296); CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "ie20.exe", "ie", 8, 512); CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "lnfinst.exe", "iebrokeninstaller", 8, 512); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), "msnver.txt", "5900", 12, 4); + if (CurrentSave.CurrentOS == "95") CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), "msnver.txt", "5900", 12, 4); CreateWindowsDirectory(); } @@ -322,7 +322,7 @@ namespace Histacom2.Engine public static void UpgradeFileSystem(string newOS) { - if (newOS == "98" || newOS == "2000" || newOS == "ME") + if (newOS == "98") { // We are upgrading from the old WinClassic file System to the new WinClassic filesystem! // All the above OSes share basically the same file layout! @@ -336,10 +336,11 @@ namespace Histacom2.Engine // There is no "The Microsoft Network" folder! if (Directory.Exists(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"))) Directory.Delete(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), true); + if (Directory.Exists(Path.Combine(ProfileProgramsDirectory, "12padams"))) Directory.Delete(Path.Combine(ProfileProgramsDirectory, "12padams"), true); FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject<FileSystemFolderInfo>(File.ReadAllText(Path.Combine(ProfileProgramsDirectory, "_data.info"))); foreach (THDirInfo dir in fsfi.SubDirs) { - if (dir.Name == "The Microsoft Network") + if (dir.Name == "The Microsoft Network" || dir.Name == "12padams") { fsfi.SubDirs.Remove(dir); break; diff --git a/Histacom2.Engine/Template/AboutBox95.Designer.cs b/Histacom2.Engine/Template/AboutBox95.Designer.cs index 359ef3f..8ad5dea 100644 --- a/Histacom2.Engine/Template/AboutBox95.Designer.cs +++ b/Histacom2.Engine/Template/AboutBox95.Designer.cs @@ -30,11 +30,11 @@ { this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.textBox1 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); this.textBox2 = new System.Windows.Forms.TextBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.textBox3 = new System.Windows.Forms.Label(); this.textBox4 = new System.Windows.Forms.Label(); + this.classicButton1 = new Histacom2.Engine.UI.ClassicButton(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.SuspendLayout(); @@ -59,17 +59,6 @@ this.textBox1.TabIndex = 4; this.textBox1.Text = "@SOFTWARENAME\r\nWindows 95\r\nCopyright © 1981-1995 Microsoft Corp."; // - // button1 - // - this.button1.FlatAppearance.BorderColor = System.Drawing.Color.Silver; - this.button1.Location = new System.Drawing.Point(251, 223); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 0; - this.button1.Text = "OK"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // // textBox2 // this.textBox2.BackColor = System.Drawing.Color.Silver; @@ -109,16 +98,27 @@ this.textBox4.TabIndex = 0; this.textBox4.Text = "System Resources: 97% Free"; // + // classicButton1 + // + this.classicButton1.BackColor = System.Drawing.Color.Silver; + this.classicButton1.ForeColor = System.Drawing.Color.Black; + this.classicButton1.Location = new System.Drawing.Point(251, 223); + this.classicButton1.Name = "classicButton1"; + this.classicButton1.Size = new System.Drawing.Size(75, 23); + this.classicButton1.TabIndex = 6; + this.classicButton1.Text = "OK"; + this.classicButton1.Click += new System.EventHandler(this.classicButton1_Click); + // // AboutBox95 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Silver; + this.Controls.Add(this.classicButton1); this.Controls.Add(this.textBox4); this.Controls.Add(this.textBox3); this.Controls.Add(this.pictureBox2); this.Controls.Add(this.textBox2); - this.Controls.Add(this.button1); this.Controls.Add(this.textBox1); this.Controls.Add(this.pictureBox1); this.Name = "AboutBox95"; @@ -135,10 +135,10 @@ internal System.Windows.Forms.PictureBox pictureBox1; internal System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Button button1; internal System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.Label textBox3; private System.Windows.Forms.Label textBox4; + private UI.ClassicButton classicButton1; } } diff --git a/Histacom2.Engine/Template/AboutBox95.cs b/Histacom2.Engine/Template/AboutBox95.cs index 1accc56..a97ab1c 100644 --- a/Histacom2.Engine/Template/AboutBox95.cs +++ b/Histacom2.Engine/Template/AboutBox95.cs @@ -11,9 +11,9 @@ namespace Histacom2.Engine.Template this.textBox2.Text = "This product is licensed to:\r\n" + Environment.UserName + "\r\n"; } - private void button1_Click(object sender, EventArgs e) + private void classicButton1_Click(object sender, EventArgs e) { - this.ParentForm.Close(); + ParentForm.Close(); } } } diff --git a/Histacom2.Engine/Template/Infobox95.Designer.cs b/Histacom2.Engine/Template/Infobox95.Designer.cs index 0bccf85..7bb6869 100644 --- a/Histacom2.Engine/Template/Infobox95.Designer.cs +++ b/Histacom2.Engine/Template/Infobox95.Designer.cs @@ -29,12 +29,12 @@ private void InitializeComponent() { this.programContent = new System.Windows.Forms.Panel(); - this.button1 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.panel1 = new System.Windows.Forms.Panel(); this.infoText = new System.Windows.Forms.Label(); - this.button2 = new System.Windows.Forms.Button(); + this.button1 = new Histacom2.Engine.UI.ClassicButton(); + this.button3 = new Histacom2.Engine.UI.ClassicButton(); + this.button2 = new Histacom2.Engine.UI.ClassicButton(); this.programContent.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.panel1.SuspendLayout(); @@ -54,34 +54,7 @@ this.programContent.Size = new System.Drawing.Size(413, 118); this.programContent.TabIndex = 10; this.programContent.Tag = "gnoreFormOnTaskbar"; - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.button1.Location = new System.Drawing.Point(150, 84); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(80, 23); - this.button1.TabIndex = 5; - this.button1.Text = "Yes"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button3 - // - this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.button3.Location = new System.Drawing.Point(323, 84); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(80, 23); - this.button3.TabIndex = 4; - this.button3.Text = "Cancel"; - this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click); + this.programContent.Paint += new System.Windows.Forms.PaintEventHandler(this.programContent_Paint); // // pictureBox1 // @@ -111,18 +84,43 @@ this.infoText.TabIndex = 0; this.infoText.Text = "label1"; // + // button1 + // + this.button1.BackColor = System.Drawing.Color.Silver; + this.button1.ForeColor = System.Drawing.Color.Black; + this.button1.Location = new System.Drawing.Point(150, 84); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(80, 23); + this.button1.TabIndex = 6; + this.button1.Text = "Yes"; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button3 + // + this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.button3.BackColor = System.Drawing.Color.Silver; + this.button3.ForeColor = System.Drawing.Color.Black; + this.button3.Location = new System.Drawing.Point(323, 84); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(80, 23); + this.button3.TabIndex = 4; + this.button3.Text = "Cancel"; + this.button3.Click += new System.EventHandler(this.button3_Click); + // // button2 // this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.button2.Location = new System.Drawing.Point(236, 84); + this.button2.BackColor = System.Drawing.Color.Silver; + this.button2.ForeColor = System.Drawing.Color.Black; + this.button2.Location = new System.Drawing.Point(237, 84); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(80, 23); this.button2.TabIndex = 1; this.button2.Text = "No"; - this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // Infobox95 @@ -145,8 +143,8 @@ private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Panel panel1; public System.Windows.Forms.Label infoText; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button3; - private System.Windows.Forms.Button button1; + private UI.ClassicButton button1; + private UI.ClassicButton button2; + private UI.ClassicButton button3; } }
\ No newline at end of file diff --git a/Histacom2.Engine/Template/Infobox95.cs b/Histacom2.Engine/Template/Infobox95.cs index f0ed0db..6408177 100644 --- a/Histacom2.Engine/Template/Infobox95.cs +++ b/Histacom2.Engine/Template/Infobox95.cs @@ -13,9 +13,8 @@ namespace Histacom2.Engine.Template public Infobox95(InfoboxType type, InfoboxButtons btns) { InitializeComponent(); - button1.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); - button2.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); - button3.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); + this.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + this.programContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor; switch (type) { @@ -23,21 +22,26 @@ namespace Histacom2.Engine.Template pictureBox1.Image = Properties.Resources.Win95Info; SoundPlayer spa = new SoundPlayer(SaveSystem.currentTheme.asteriskSound); spa.Play(); + spa.Stream.Position = 0; + break; case InfoboxType.Question: pictureBox1.Image = Properties.Resources.Win95Question; SoundPlayer spq = new SoundPlayer(SaveSystem.currentTheme.questionSound); spq.Play(); + spq.Stream.Position = 0; break; case InfoboxType.Warning: pictureBox1.Image = Properties.Resources.Win95Warning; SoundPlayer spw = new SoundPlayer(SaveSystem.currentTheme.exclamationSound); spw.Play(); + spw.Stream.Position = 0; break; case InfoboxType.Error: pictureBox1.Image = Properties.Resources.Win95Error; SoundPlayer spe = new SoundPlayer(SaveSystem.currentTheme.critStopSound); spe.Play(); + spe.Stream.Position = 0; break; } @@ -66,6 +70,12 @@ namespace Histacom2.Engine.Template { if (btnStatus == 0) this.ParentForm.Close(); } + + private void programContent_Paint(object sender, PaintEventArgs e) + { + this.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + this.programContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + } } public enum InfoboxType diff --git a/Histacom2.Engine/Template/WinClassic.Designer.cs b/Histacom2.Engine/Template/WinClassic.Designer.cs index 593cfd6..8463041 100644 --- a/Histacom2.Engine/Template/WinClassic.Designer.cs +++ b/Histacom2.Engine/Template/WinClassic.Designer.cs @@ -45,6 +45,7 @@ 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(); @@ -57,6 +58,7 @@ // this.program.BackColor = System.Drawing.Color.Silver; this.program.Controls.Add(this.programContent); + this.program.Controls.Add(this.panel1); this.program.Controls.Add(this.programtopbar); this.program.Controls.Add(this.toprightcorner); this.program.Controls.Add(this.bottomrightcorner); @@ -75,10 +77,11 @@ // programContent // this.programContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.programContent.Location = new System.Drawing.Point(4, 22); + this.programContent.Location = new System.Drawing.Point(4, 23); this.programContent.Name = "programContent"; - this.programContent.Size = new System.Drawing.Size(292, 274); + this.programContent.Size = new System.Drawing.Size(292, 273); this.programContent.TabIndex = 9; + this.programContent.ControlAdded += new System.Windows.Forms.ControlEventHandler(this.programContent_ControlAdded); // // programtopbar // @@ -160,6 +163,7 @@ this.toprightcorner.Name = "toprightcorner"; this.toprightcorner.Size = new System.Drawing.Size(4, 4); this.toprightcorner.TabIndex = 6; + this.toprightcorner.Paint += new System.Windows.Forms.PaintEventHandler(this.toprightcorner_Paint); this.toprightcorner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); this.toprightcorner.MouseMove += new System.Windows.Forms.MouseEventHandler(this.toprightcorner_MouseMove); this.toprightcorner.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); @@ -173,6 +177,7 @@ this.bottomrightcorner.Name = "bottomrightcorner"; this.bottomrightcorner.Size = new System.Drawing.Size(4, 4); this.bottomrightcorner.TabIndex = 4; + this.bottomrightcorner.Paint += new System.Windows.Forms.PaintEventHandler(this.bottomrightcorner_Paint); this.bottomrightcorner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); this.bottomrightcorner.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bottomrightcorner_MouseMove); this.bottomrightcorner.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); @@ -186,6 +191,7 @@ this.bottomleftcorner.Name = "bottomleftcorner"; this.bottomleftcorner.Size = new System.Drawing.Size(4, 4); this.bottomleftcorner.TabIndex = 2; + this.bottomleftcorner.Paint += new System.Windows.Forms.PaintEventHandler(this.bottomleftcorner_Paint); this.bottomleftcorner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); this.bottomleftcorner.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bottomleftcorner_MouseMove); this.bottomleftcorner.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); @@ -198,6 +204,7 @@ this.topleftcorner.Name = "topleftcorner"; this.topleftcorner.Size = new System.Drawing.Size(4, 4); this.topleftcorner.TabIndex = 1; + this.topleftcorner.Paint += new System.Windows.Forms.PaintEventHandler(this.topleftcorner_Paint); this.topleftcorner.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); this.topleftcorner.MouseMove += new System.Windows.Forms.MouseEventHandler(this.topleftcorner_MouseMove); this.topleftcorner.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); @@ -211,6 +218,7 @@ this.left.Name = "left"; this.left.Size = new System.Drawing.Size(4, 292); this.left.TabIndex = 3; + this.left.Paint += new System.Windows.Forms.PaintEventHandler(this.left_Paint); this.left.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); this.left.MouseMove += new System.Windows.Forms.MouseEventHandler(this.left_MouseMove); this.left.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); @@ -225,6 +233,7 @@ this.bottom.Name = "bottom"; this.bottom.Size = new System.Drawing.Size(296, 4); this.bottom.TabIndex = 5; + this.bottom.Paint += new System.Windows.Forms.PaintEventHandler(this.bottom_Paint); this.bottom.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); this.bottom.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bottom_MouseMove); this.bottom.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); @@ -238,6 +247,7 @@ this.right.Name = "right"; this.right.Size = new System.Drawing.Size(4, 296); this.right.TabIndex = 7; + this.right.Paint += new System.Windows.Forms.PaintEventHandler(this.right_Paint); this.right.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); this.right.MouseMove += new System.Windows.Forms.MouseEventHandler(this.right_MouseMove); this.right.MouseUp += new System.Windows.Forms.MouseEventHandler(this.border_MouseUp); @@ -252,10 +262,19 @@ this.top.Name = "top"; this.top.Size = new System.Drawing.Size(300, 4); this.top.TabIndex = 8; + this.top.Paint += new System.Windows.Forms.PaintEventHandler(this.top_Paint); this.top.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown); 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); @@ -298,5 +317,6 @@ public System.Windows.Forms.PictureBox maximizebutton; public System.Windows.Forms.PictureBox minimizebutton; public System.Windows.Forms.PictureBox programIcon; + private System.Windows.Forms.Panel panel1; } }
\ No newline at end of file diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index 23ea562..25cbfaa 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -11,10 +11,12 @@ namespace Histacom2.Engine.Template { InitializeComponent(); DoubleBuffered = true; + programContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor; } public Font fnt; public ResizeOverlay resizer = new ResizeOverlay(); + public UserControl progContent; public bool resizable = true; public bool closeDisabled = false; @@ -75,7 +77,7 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Width = MousePosition.X - this.Location.X; + if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X; resizer.ToDraw = toDraw; } } @@ -85,8 +87,10 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (resizable) toDraw.X = Cursor.Position.X; + 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; + } resizer.ToDraw = toDraw; } } @@ -107,7 +111,7 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Width = MousePosition.X - this.Location.X; + 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; resizer.ToDraw = toDraw; } @@ -118,9 +122,9 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Width = ((toDraw.Width + toDraw.Location.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); if (resizable) toDraw.Height = Cursor.Position.Y - this.Location.Y; - if (resizable) toDraw.X = Cursor.Position.X; + if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X; resizer.ToDraw = toDraw; } } @@ -130,8 +134,8 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X); - if (resizable) toDraw.X = Cursor.Position.X; + 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; resizer.ToDraw = toDraw; @@ -154,7 +158,7 @@ namespace Histacom2.Engine.Template if (e.Button == MouseButtons.Left) { var toDraw = resizer.ToDraw; - if (resizable) toDraw.Width = MousePosition.X - this.Location.X; + 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; resizer.ToDraw = toDraw; @@ -205,10 +209,112 @@ namespace Histacom2.Engine.Template WinClassic_Activated(null, null); } + public bool max = false; + private void bottom_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _darkBack = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(Pens.Black, 0, 3, bottom.Width, 3); + gfx.DrawLine(new Pen(_darkBack), 0, 2, bottom.Width, 2); + } + + private void bottomleftcorner_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor); + var _darkBack = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(Pens.Black, 0, 3, 3, 3); + gfx.DrawLine(new Pen(_darkBack), 1, 2, 3, 2); + gfx.DrawLine(new Pen(_lightBack), 1, 0, 1, 1); + } + + private void left_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(new Pen(_lightBack), 1, 0, 1, left.Height); + } + + private void programContent_ControlAdded(object sender, ControlEventArgs e) + { + e.Control.BackColor = SaveSystem.currentTheme.threeDObjectsColor; + e.Control.Invalidate(); + } + + private void topleftcorner_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(new Pen(_lightBack), 1, 3, 1, 1); + gfx.DrawLine(new Pen(_lightBack), 1, 1, 3, 1); + } + + private void top_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(new Pen(_lightBack), 0, 1, top.Width, 1); + } + + private void toprightcorner_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _lightBack = Paintbrush.GetLightFromColor(SaveSystem.currentTheme.threeDObjectsColor); + var _darkBack = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(new Pen(_lightBack), 0, 1, 1, 1); + gfx.DrawLine(new Pen(_darkBack), 2, 1, 2, 3); + gfx.DrawLine(Pens.Black, 3, 0, 3, 3); + } + + private void right_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _darkBack = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(Pens.Black, 3, 0, 3, bottom.Width); + gfx.DrawLine(new Pen(_darkBack), 2, 0, 2, bottom.Width); + } + + private void bottomrightcorner_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + gfx.Clear(SaveSystem.currentTheme.threeDObjectsColor); + + var _darkBack = Paintbrush.GetDarkFromColor(SaveSystem.currentTheme.threeDObjectsColor); + + gfx.DrawLine(Pens.Black, 3, 0, 3, 3); + gfx.DrawLine(Pens.Black, 0, 3, 3, 3); + gfx.DrawLine(new Pen(_darkBack), 2, 0, 2, 2); + gfx.DrawLine(new Pen(_darkBack), 0, 2, 2, 2); + } + + public Size prevSize; + public Point prevPoint; private void maximizebutton_Click(object sender, EventArgs e) { + if (max == false) { this.right.Hide(); @@ -220,7 +326,10 @@ namespace Histacom2.Engine.Template this.topleftcorner.Hide(); this.toprightcorner.Hide(); this.Dock = DockStyle.Fill; - this.WindowState = FormWindowState.Maximized; + prevSize = this.Size; + prevPoint = this.Location; + this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height - 28); + this.Location = new Point(0, 0); max = true; maximizebutton.Image = Engine.Properties.Resources.WinClassicRestore; } @@ -235,11 +344,12 @@ namespace Histacom2.Engine.Template this.topleftcorner.Show(); this.toprightcorner.Show(); this.Dock = DockStyle.None; - this.WindowState = FormWindowState.Normal; + this.Size = prevSize; + this.Location = prevPoint; max = false; maximizebutton.Image = Engine.Properties.Resources.WinClassicMax; } - + } // The rest of this code will automatically style the buttons on the form! diff --git a/Histacom2.Engine/Template/WinClassic.resx b/Histacom2.Engine/Template/WinClassic.resx index 6876b17..a3848f8 100644 --- a/Histacom2.Engine/Template/WinClassic.resx +++ b/Histacom2.Engine/Template/WinClassic.resx @@ -121,63 +121,63 @@ <data name="toprightcorner.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAdSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAdSURBVBhXYzh8 /DQEMQDBfzBo6+oDcSDCGBwGBgAJoRsoKGRD1QAAAABJRU5ErkJggg== </value> </data> <data name="bottomrightcorner.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAdSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAdSURBVBhXYzh8 /DQQtXX1MQABCgdIQRCIgwAMDABm/hFrLt/K7gAAAABJRU5ErkJggg== </value> </data> <data name="bottomleftcorner.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAdSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAdSURBVBhXYzh8 /PT///+BJBBhcNq6+iCIAQEYGACcHRsocGQwIQAAAABJRU5ErkJggg== </value> </data> <data name="topleftcorner.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAaSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAaSURBVBhXYzh8 /DQcgTj/YQDKQZEBcY6fBgAaSCiZEc9BxAAAAABJRU5ErkJggg== </value> </data> <data name="left.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAUSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAUSURBVBhXYzh8 /PT///+B5OHjpwFB1wn9nx9JYgAAAABJRU5ErkJggg== </value> </data> <data name="bottom.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAIAAADAusJtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAVSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAVSURBVBhXYzh8 /DQYt3X1MTAwMAAAQaQGSbsObiQAAAAASUVORK5CYII= </value> </data> <data name="right.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAUSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAUSURBVBhXYzh8 /DQQtXX1MTAwAAA0WgZJrWm8iAAAAABJRU5ErkJggg== </value> </data> <data name="top.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAAEAAAAECAIAAADAusJtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAVSURBVBhXYzh8 + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAAVSURBVBhXYzh8 /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 - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA+SURBVChTY/hP + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA+SURBVChTY/hP CmAAAiB1nzjQ0NCA0HDgwAEQBwcAygIBNTRAJNDAqAY0DbgAdg0EAUIDkEUkAGkgDTAwAACYPGiagsMD PwAAAABJRU5ErkJggg== </value> @@ -185,7 +185,7 @@ <data name="minimizebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA5SURBVChTY/hP + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAAA5SURBVChTY/hP CmAAAiB1nzjQ0NCA0HCACDCqASqGF2DRAOKjAog4BFBDA36A0ABkEQlAGkgDDAwAKPmlWmNluNoAAAAA SUVORK5CYII= </value> @@ -193,7 +193,7 @@ <data name="closebutton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAIAAACpTQvdAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAABcSURBVChTrY/R + wgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAABcSURBVChTrY/R DcAgCERvdEbrJh2lPU+SYkINRt+PSN6J4FkBhMddw8y+wFUgCbQ70OtO7OQTJLgRa/L7JWmOt8RsB8mD TQ5NkFbeQcLwauzMdkjZCLAq0gJrAC8niIXaIK89FAAAAABJRU5ErkJggg== </value> diff --git a/Histacom2.Engine/Template/WinXP.Designer.cs b/Histacom2.Engine/Template/WinXP.Designer.cs new file mode 100644 index 0000000..66cb521 --- /dev/null +++ b/Histacom2.Engine/Template/WinXP.Designer.cs @@ -0,0 +1,256 @@ +namespace Histacom2.Engine.Template +{ + partial class WinXP + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinXP)); + this.program = new System.Windows.Forms.Panel(); + this.bottomleftcorner = 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(); + this.bottom = new System.Windows.Forms.Panel(); + this.top = new System.Windows.Forms.Panel(); + this.maximizebutton = new System.Windows.Forms.PictureBox(); + this.minimizebutton = new System.Windows.Forms.PictureBox(); + this.programname = new System.Windows.Forms.Label(); + this.closebutton = new System.Windows.Forms.PictureBox(); + this.right = new System.Windows.Forms.Panel(); + this.left = new System.Windows.Forms.Panel(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.programIcon = new System.Windows.Forms.PictureBox(); + this.program.SuspendLayout(); + this.top.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.closebutton)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.programIcon)).BeginInit(); + this.SuspendLayout(); + // + // 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.toprightcorner); + this.program.Controls.Add(this.bottomrightcorner); + this.program.Controls.Add(this.topleftcorner); + this.program.Controls.Add(this.bottom); + this.program.Controls.Add(this.top); + this.program.Controls.Add(this.right); + this.program.Controls.Add(this.left); + this.program.Dock = System.Windows.Forms.DockStyle.Fill; + this.program.Location = new System.Drawing.Point(0, 0); + this.program.Name = "program"; + this.program.Size = new System.Drawing.Size(300, 300); + this.program.TabIndex = 10; + // + // 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.Location = new System.Drawing.Point(0, 296); + this.bottomleftcorner.Name = "bottomleftcorner"; + this.bottomleftcorner.Size = new System.Drawing.Size(5, 4); + this.bottomleftcorner.TabIndex = 10; + // + // toprightcorner + // + this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.toprightcorner.BackColor = System.Drawing.Color.Magenta; + this.toprightcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("toprightcorner.BackgroundImage"))); + this.toprightcorner.Location = new System.Drawing.Point(294, 0); + this.toprightcorner.Name = "toprightcorner"; + this.toprightcorner.Size = new System.Drawing.Size(6, 30); + this.toprightcorner.TabIndex = 9; + // + // bottomrightcorner + // + this.bottomrightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.bottomrightcorner.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_BottomRight; + this.bottomrightcorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE; + this.bottomrightcorner.Location = new System.Drawing.Point(296, 296); + this.bottomrightcorner.Name = "bottomrightcorner"; + this.bottomrightcorner.Size = new System.Drawing.Size(4, 4); + this.bottomrightcorner.TabIndex = 4; + // + // topleftcorner + // + this.topleftcorner.BackColor = System.Drawing.Color.Magenta; + this.topleftcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("topleftcorner.BackgroundImage"))); + this.topleftcorner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.topleftcorner.Location = new System.Drawing.Point(0, 0); + this.topleftcorner.Name = "topleftcorner"; + this.topleftcorner.Size = new System.Drawing.Size(7, 30); + this.topleftcorner.TabIndex = 8; + // + // bottom + // + this.bottom.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_Bottom; + 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); + this.bottom.Name = "bottom"; + this.bottom.Size = new System.Drawing.Size(292, 4); + this.bottom.TabIndex = 3; + // + // top + // + this.top.BackColor = System.Drawing.Color.Transparent; + this.top.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_TopBar; + this.top.Controls.Add(this.programIcon); + this.top.Controls.Add(this.maximizebutton); + this.top.Controls.Add(this.minimizebutton); + this.top.Controls.Add(this.programname); + this.top.Controls.Add(this.closebutton); + this.top.Dock = System.Windows.Forms.DockStyle.Top; + this.top.Location = new System.Drawing.Point(4, 0); + this.top.Name = "top"; + this.top.Size = new System.Drawing.Size(292, 30); + this.top.TabIndex = 0; + // + // maximizebutton + // + this.maximizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.maximizebutton.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_Max; + this.maximizebutton.Location = new System.Drawing.Point(244, 5); + this.maximizebutton.Name = "maximizebutton"; + this.maximizebutton.Size = new System.Drawing.Size(21, 21); + this.maximizebutton.TabIndex = 6; + this.maximizebutton.TabStop = false; + // + // minimizebutton + // + this.minimizebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.minimizebutton.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_Min; + this.minimizebutton.Location = new System.Drawing.Point(221, 5); + this.minimizebutton.Name = "minimizebutton"; + this.minimizebutton.Size = new System.Drawing.Size(21, 21); + this.minimizebutton.TabIndex = 5; + this.minimizebutton.TabStop = false; + // + // programname + // + 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.ForeColor = System.Drawing.Color.White; + this.programname.Location = new System.Drawing.Point(25, 8); + this.programname.Name = "programname"; + this.programname.Size = new System.Drawing.Size(99, 13); + this.programname.TabIndex = 3; + this.programname.Text = "Application Title"; + // + // closebutton + // + this.closebutton.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.closebutton.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_Close; + this.closebutton.Location = new System.Drawing.Point(267, 5); + this.closebutton.Name = "closebutton"; + this.closebutton.Size = new System.Drawing.Size(21, 21); + this.closebutton.TabIndex = 4; + this.closebutton.TabStop = false; + // + // right + // + this.right.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_RightSide; + this.right.Cursor = System.Windows.Forms.Cursors.SizeWE; + this.right.Dock = System.Windows.Forms.DockStyle.Right; + this.right.Location = new System.Drawing.Point(296, 0); + this.right.Name = "right"; + this.right.Size = new System.Drawing.Size(4, 300); + this.right.TabIndex = 2; + // + // left + // + this.left.BackgroundImage = global::Histacom2.Engine.Properties.Resources.WinXP_LeftSide; + this.left.Dock = System.Windows.Forms.DockStyle.Left; + this.left.Location = new System.Drawing.Point(0, 0); + this.left.Name = "left"; + this.left.Size = new System.Drawing.Size(4, 300); + this.left.TabIndex = 1; + // + // 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; + // + // programIcon + // + this.programIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.programIcon.ErrorImage = null; + this.programIcon.InitialImage = null; + this.programIcon.Location = new System.Drawing.Point(6, 7); + this.programIcon.Name = "programIcon"; + this.programIcon.Size = new System.Drawing.Size(16, 16); + this.programIcon.TabIndex = 7; + this.programIcon.TabStop = false; + // + // WinXP + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + 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.Load += new System.EventHandler(this.WinXP_Load); + this.program.ResumeLayout(false); + this.top.ResumeLayout(false); + this.top.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.maximizebutton)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.minimizebutton)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.closebutton)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.programIcon)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + internal System.Windows.Forms.Panel program; + internal System.Windows.Forms.Panel bottomleftcorner; + internal System.Windows.Forms.Panel toprightcorner; + internal System.Windows.Forms.Panel bottomrightcorner; + 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; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + public System.Windows.Forms.PictureBox programIcon; + } +}
\ No newline at end of file diff --git a/Histacom2.Engine/Template/WinXP.cs b/Histacom2.Engine/Template/WinXP.cs new file mode 100644 index 0000000..86b222e --- /dev/null +++ b/Histacom2.Engine/Template/WinXP.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + + +namespace Histacom2.Engine.Template +{ + public partial class WinXP : Form + { + public WinXP() + { + InitializeComponent(); + } + + private void WinXP_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/Histacom2.Engine/Template/WinXP.resx b/Histacom2.Engine/Template/WinXP.resx new file mode 100644 index 0000000..94a7a5f --- /dev/null +++ b/Histacom2.Engine/Template/WinXP.resx @@ -0,0 +1,233 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <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="toprightcorner.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + 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 + rkJggg== +</value> + </data> + <data name="topleftcorner.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + 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 +</value> + </data> +</root>
\ No newline at end of file diff --git a/Histacom2.Engine/Theme.cs b/Histacom2.Engine/Theme.cs index 6c1efef..2d4633f 100644 --- a/Histacom2.Engine/Theme.cs +++ b/Histacom2.Engine/Theme.cs @@ -19,11 +19,21 @@ namespace Histacom2.Engine public Stream progErrorSound { get; set; } public Stream questionSound { get; set; } + public Color threeDObjectsColor { get; set; } + public Color threeDObjectsTextColor { get; set; } + + 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; } 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; } @@ -42,11 +52,21 @@ namespace Histacom2.Engine progErrorSound = Properties.Resources.CHORD; questionSound = Properties.Resources.CHORD; + threeDObjectsColor = Color.Silver; + threeDObjectsTextColor = Color.Black; + + buttonFont = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); + + windowColor = Color.White; + activeTitleBarColor = Color.Navy; activeTitleTextColor = Color.White; inactiveTitleBarColor = Color.Gray; inactiveTitleTextColor = Color.Silver; + selectedBackColor = Color.Navy; + selectedTextColor = Color.White; + defaultWallpaper = null; themeName = "default95"; } @@ -65,6 +85,21 @@ namespace Histacom2.Engine progErrorSound = Properties.Resources.CHORD; questionSound = Properties.Resources.CHORD; + threeDObjectsColor = Color.Silver; + threeDObjectsTextColor = Color.Black; + + buttonFont = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular); + + windowColor = Color.White; + + activeTitleBarColor = Color.Navy; + activeTitleTextColor = Color.White; + inactiveTitleBarColor = Color.Gray; + inactiveTitleTextColor = Color.Silver; + + selectedBackColor = Color.Navy; + selectedTextColor = Color.White; + defaultWallpaper = null; themeName = "default98"; } @@ -83,11 +118,21 @@ namespace Histacom2.Engine progErrorSound = Properties.Resources.Win95PlusDangerousCreaturesProgError; questionSound = Properties.Resources.Win95PlusDangerousCreaturesQuestion; + threeDObjectsColor = Color.FromArgb(112, 112, 112); + threeDObjectsTextColor = Color.Black; + + 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); inactiveTitleTextColor = Color.Gray; + selectedBackColor = Color.Teal; + selectedTextColor = Color.White; + defaultWallpaper = Properties.Resources.Win95PlusDangerousCreaturesWallpaper; themeName = "dangeranimals"; } @@ -102,11 +147,21 @@ namespace Histacom2.Engine asteriskSound = Properties.Resources.Win95PlusInsideComputerAsterisk; + threeDObjectsColor = Color.FromArgb(169, 200, 169); + threeDObjectsTextColor = Color.Black; + + 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); 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.Designer.cs b/Histacom2.Engine/UI/ClassicButton.Designer.cs deleted file mode 100644 index c76bba0..0000000 --- a/Histacom2.Engine/UI/ClassicButton.Designer.cs +++ /dev/null @@ -1,91 +0,0 @@ -namespace Histacom2.Engine.UI -{ - partial class ClassicButton - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.borderpart = new System.Windows.Forms.Panel(); - this.graystuff = new System.Windows.Forms.Panel(); - this.lessgraystuff = new System.Windows.Forms.Label(); - this.borderpart.SuspendLayout(); - this.graystuff.SuspendLayout(); - this.SuspendLayout(); - // - // borderpart - // - this.borderpart.BackColor = System.Drawing.Color.White; - this.borderpart.Controls.Add(this.graystuff); - this.borderpart.Location = new System.Drawing.Point(0, 0); - this.borderpart.Name = "borderpart"; - this.borderpart.Size = new System.Drawing.Size(99, 24); - this.borderpart.TabIndex = 0; - // - // graystuff - // - this.graystuff.BackColor = System.Drawing.Color.Gray; - this.graystuff.Controls.Add(this.lessgraystuff); - this.graystuff.Location = new System.Drawing.Point(1, 1); - this.graystuff.Name = "graystuff"; - this.graystuff.Size = new System.Drawing.Size(98, 23); - this.graystuff.TabIndex = 0; - // - // lessgraystuff - // - this.lessgraystuff.BackColor = System.Drawing.Color.Silver; - this.lessgraystuff.Location = new System.Drawing.Point(0, 0); - this.lessgraystuff.Margin = new System.Windows.Forms.Padding(0); - this.lessgraystuff.Name = "lessgraystuff"; - this.lessgraystuff.Size = new System.Drawing.Size(97, 22); - this.lessgraystuff.TabIndex = 0; - this.lessgraystuff.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.lessgraystuff.Paint += new System.Windows.Forms.PaintEventHandler(this.lessgraystuff_Paint); - // - // ClassicButton - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.Controls.Add(this.borderpart); - this.Name = "ClassicButton"; - this.Size = new System.Drawing.Size(100, 25); - this.Paint += new System.Windows.Forms.PaintEventHandler(this.ClassicButton_Paint); - this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ClassicButton_MouseDown); - this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ClassicButton_MouseUp); - this.Resize += new System.EventHandler(this.ClassicButton_Resize); - this.borderpart.ResumeLayout(false); - this.graystuff.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel borderpart; - private System.Windows.Forms.Panel graystuff; - private System.Windows.Forms.Label lessgraystuff; - } -} diff --git a/Histacom2.Engine/UI/ClassicButton.cs b/Histacom2.Engine/UI/ClassicButton.cs index 26629a8..4ccdbe6 100644 --- a/Histacom2.Engine/UI/ClassicButton.cs +++ b/Histacom2.Engine/UI/ClassicButton.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; -using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,49 +8,93 @@ using System.Windows.Forms; namespace Histacom2.Engine.UI { - public partial class ClassicButton : UserControl + public class ClassicButton : Control, IButtonControl { - public ClassicButton() - { - InitializeComponent(); - } + private Color _lightBack; + private Color _darkBack; - private void ClassicButton_SizeChanged(object sender, EventArgs e) - { + private bool _pressing = false; - } + public DialogResult DialogResult { get; set; } - private void ClassicButton_MouseDown(object sender, MouseEventArgs e) - { - this.BackColor = Color.White; - borderpart.BackColor = Color.Black; - lessgraystuff.Location = new Point(1, 1); - } + public bool AdaptBackColorWithTheme { get; set; } + public bool AdaptForeColorWithTheme { get; set; } + public bool AdaptFontWithTheme { get; set; } - private void ClassicButton_Paint(object sender, PaintEventArgs e) + public ClassicButton() : base() { - e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; - base.OnPaint(e); + AdaptBackColorWithTheme = true; + AdaptForeColorWithTheme = true; + AdaptFontWithTheme = true; + if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor; + else BackColor = Color.Silver; + _lightBack = ControlPaint.Light(BackColor, 50); + _darkBack = ControlPaint.Dark(BackColor, 50); + + MouseDown += (s, e) => { _pressing = true; Invalidate(); }; + MouseUp += (s, e) => { _pressing = false; Invalidate(); }; + Invalidate(); } - private void lessgraystuff_Paint(object sender, PaintEventArgs e) + protected override void OnPaint(PaintEventArgs e) { - e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; base.OnPaint(e); + + if (SaveSystem.currentTheme != null && AdaptBackColorWithTheme) BackColor = SaveSystem.currentTheme.threeDObjectsColor; + + 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); + + var g = e.Graphics; + g.Clear(BackColor); + + g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; + StringFormat sf = new StringFormat(); + sf.Alignment = StringAlignment.Center; + sf.LineAlignment = StringAlignment.Center; + sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show; + + if (_pressing && Enabled) + { + g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width, Height)); + g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width - 1, Height - 1)); + g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2)); + g.FillRectangle(new SolidBrush(BackColor), new Rectangle(2, 2, Width - 3, Height - 3)); + + g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(2, 2, Width - 3, Height - 3), sf); + } + else + { + g.FillRectangle(Brushes.Black, new Rectangle(0, 0, Width, Height)); + g.FillRectangle(new SolidBrush(_lightBack), new Rectangle(0, 0, Width - 1, Height - 1)); + g.FillRectangle(new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 2, Height - 2)); + g.FillRectangle(new SolidBrush(BackColor), new Rectangle(1, 1, Width - 3, Height - 3)); + + if (Enabled) g.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(1, 1, Width - 3, Height - 3), sf); + else g.DrawString(Text, Font, new SolidBrush(_darkBack), new Rectangle(1, 1, Width - 3, Height - 3), sf); + } } - private void ClassicButton_MouseUp(object sender, MouseEventArgs e) + public void NotifyDefault(bool value) { - this.BackColor = Color.Black; - borderpart.BackColor = Color.White; - lessgraystuff.Location = new Point(0, 0); + } - private void ClassicButton_Resize(object sender, EventArgs e) + public void PerformClick() { - borderpart.Size = new Size(this.Width - 1, this.Height - 1); - graystuff.Size = new Size(this.Width - 2, this.Height - 2); - lessgraystuff.Size = new Size(this.Width - 3, this.Height - 3); + this.OnClick(new EventArgs()); } } -}
\ No newline at end of file +} diff --git a/Histacom2.Engine/UI/ClassicButton.resx b/Histacom2.Engine/UI/ClassicButton.resx deleted file mode 100644 index d5494e3..0000000 --- a/Histacom2.Engine/UI/ClassicButton.resx +++ /dev/null @@ -1,123 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> -</root>
\ No newline at end of file diff --git a/Histacom2.Engine/UI/ClassicLabel.cs b/Histacom2.Engine/UI/ClassicLabel.cs new file mode 100644 index 0000000..f207eb1 --- /dev/null +++ b/Histacom2.Engine/UI/ClassicLabel.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine.UI +{ + public class ClassicLabel : Control + { + public ClassicLabel() + { + + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + var gfx = e.Graphics; + gfx.Clear(BackColor); + gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; + + gfx.DrawString(Text, Font, new SolidBrush(ForeColor), ClientRectangle); + Height = (int)gfx.MeasureString(Text, Font, ClientRectangle.Width).Height; + } + } +} 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/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); + } + } +} 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 { diff --git a/Histacom2.Engine/WindowManager.cs b/Histacom2.Engine/WindowManager.cs index 2306d5d..4f4951c 100644 --- a/Histacom2.Engine/WindowManager.cs +++ b/Histacom2.Engine/WindowManager.cs @@ -10,10 +10,43 @@ namespace Histacom2.Engine { public static System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection(); - public WinClassic StartWin95(UserControl content, string title, Image icon, bool MaxButton, bool MinButton, bool ShowApplicationAsDialog = false, bool resize = true) + public WinClassic Init(UserControl content, string title, Image icon, bool MaxButton, bool MinButton, bool ShowApplicationAsDialog = false, bool resize = true) { + WinClassic app = null; // Setup Window - WinClassic app = new WinClassic(); + 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; + } + case "XP": + { + // app = new WinXP(); + break; + } + default: + { + app = new WinClassic(); + break; + } + } app.Text = title; app.Title.Text = title; app.Width = content.Width + 8; @@ -27,6 +60,7 @@ namespace Histacom2.Engine content.Parent = app.programContent; content.BringToFront(); content.Dock = DockStyle.Fill; + app.progContent = content; // Check if icon is null if (icon == null) @@ -76,6 +110,10 @@ namespace Histacom2.Engine if (ShowApplicationAsDialog == false) { app.Show(); } else { app.ShowDialog(); } return app; } + + // A THING TM + + // A THING TM public WinClassic StartInfobox95(string title, string text, InfoboxType type, InfoboxButtons btns) { @@ -84,7 +122,7 @@ namespace Histacom2.Engine app.infoText.Text = text; app.infoText.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0))); - return StartWin95(app, title, null, false, false, resize: false); + return Init(app, title, null, false, false, resize: false); } public WinClassic StartAboutBox95(string shortname, string longname, Image appicon) @@ -94,7 +132,7 @@ namespace Histacom2.Engine uc.textBox1.Text = longname + "\r\nWindows 95\r\nCopyright © 1981-1995 Microsoft Corp."; uc.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0))); - return StartWin95(uc, "About " + shortname, null, false, false, resize: false); + return Init(uc, "About " + shortname, null, false, false, resize: false); } } } |
