From 59505ed4dd131afbd18c0b3e660c8c72815ba5a2 Mon Sep 17 00:00:00 2001 From: AShifter Date: Tue, 29 Aug 2017 20:33:11 -0600 Subject: Add WinXP and MultiOS WM WM is currently working, though is in the middle of modification to work with multiple operating systems. Windows XP window template as well as resources have also been added, though window moving code has not been added yet. --- Histacom2.Engine/WindowManager.cs | 45 +++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'Histacom2.Engine/WindowManager.cs') diff --git a/Histacom2.Engine/WindowManager.cs b/Histacom2.Engine/WindowManager.cs index 2306d5d..cffb74a 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; @@ -76,6 +109,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 +121,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 +131,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); } } } -- cgit v1.2.3 From 410b793a8bd68af20521623f2c41d9608df32af4 Mon Sep 17 00:00:00 2001 From: lempamo Date: Tue, 5 Sep 2017 21:13:06 -0400 Subject: windows now change theme immediately --- Histacom2.Engine/Paintbrush.cs | 7 +++++-- Histacom2.Engine/Template/WinClassic.cs | 1 + Histacom2.Engine/Theme.cs | 5 +++++ Histacom2.Engine/WindowManager.cs | 1 + .../OS/Win95/Win95Apps/WinClassicThemePanel.cs | 24 ++++++++++++++++++++-- 5 files changed, 34 insertions(+), 4 deletions(-) (limited to 'Histacom2.Engine/WindowManager.cs') diff --git a/Histacom2.Engine/Paintbrush.cs b/Histacom2.Engine/Paintbrush.cs index ab84491..4424371 100644 --- a/Histacom2.Engine/Paintbrush.cs +++ b/Histacom2.Engine/Paintbrush.cs @@ -48,14 +48,17 @@ namespace Histacom2.Engine public static Color GetLightFromColor(Color basecolor) { + if (basecolor == Color.Silver) return Color.White; if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(184, 184, 184); - return ControlPaint.Light(basecolor, 50); + 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.FromArgb(112, 112, 112)) return Color.FromArgb(72, 72, 72); - return ControlPaint.Dark(basecolor, 50); + if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(95, 153, 95); + return ControlPaint.Dark(basecolor, 70); } } } diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index c1c7fe1..0ccbe5b 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -16,6 +16,7 @@ namespace Histacom2.Engine.Template public Font fnt; public ResizeOverlay resizer = new ResizeOverlay(); + public UserControl progContent; public bool resizable = true; public bool closeDisabled = false; diff --git a/Histacom2.Engine/Theme.cs b/Histacom2.Engine/Theme.cs index 8aa9dcf..5b5ae50 100644 --- a/Histacom2.Engine/Theme.cs +++ b/Histacom2.Engine/Theme.cs @@ -127,6 +127,11 @@ 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); + activeTitleBarColor = Color.FromArgb(224, 0, 0); activeTitleTextColor = Color.White; inactiveTitleBarColor = Color.FromArgb(96, 168, 128); diff --git a/Histacom2.Engine/WindowManager.cs b/Histacom2.Engine/WindowManager.cs index cffb74a..4f4951c 100644 --- a/Histacom2.Engine/WindowManager.cs +++ b/Histacom2.Engine/WindowManager.cs @@ -60,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) diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicThemePanel.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicThemePanel.cs index da354bf..d491eef 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicThemePanel.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicThemePanel.cs @@ -96,7 +96,17 @@ namespace Histacom2.OS.Win95.Win95Apps ((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor; } f.Invalidate(); - foreach (Control c in f.Controls) c.Invalidate(); + ((WinClassic)f).programContent.Invalidate(); + ((WinClassic)f).top.Invalidate(); + ((WinClassic)f).toprightcorner.Invalidate(); + ((WinClassic)f).right.Invalidate(); + ((WinClassic)f).bottomrightcorner.Invalidate(); + ((WinClassic)f).bottom.Invalidate(); + ((WinClassic)f).bottomleftcorner.Invalidate(); + ((WinClassic)f).left.Invalidate(); + ((WinClassic)f).topleftcorner.Invalidate(); + foreach (Control c in ((WinClassic)f).progContent.Controls) c.Invalidate(); + ((WinClassic)f).progContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor; } } } @@ -139,7 +149,17 @@ namespace Histacom2.OS.Win95.Win95Apps ((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor; } f.Invalidate(); - foreach (Control c in f.Controls) c.Invalidate(); + ((WinClassic)f).programContent.Invalidate(); + ((WinClassic)f).top.Invalidate(); + ((WinClassic)f).toprightcorner.Invalidate(); + ((WinClassic)f).right.Invalidate(); + ((WinClassic)f).bottomrightcorner.Invalidate(); + ((WinClassic)f).bottom.Invalidate(); + ((WinClassic)f).bottomleftcorner.Invalidate(); + ((WinClassic)f).left.Invalidate(); + ((WinClassic)f).topleftcorner.Invalidate(); + foreach (Control c in ((WinClassic)f).progContent.Controls) c.Invalidate(); + ((WinClassic)f).progContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor; } } ParentForm.Close(); -- cgit v1.2.3