diff options
| -rw-r--r-- | TimeHACK.Engine/Template/WinClassic.cs | 9 | ||||
| -rw-r--r-- | TimeHACK.Engine/WindowManager.cs | 9 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.cs | 10 |
3 files changed, 16 insertions, 12 deletions
diff --git a/TimeHACK.Engine/Template/WinClassic.cs b/TimeHACK.Engine/Template/WinClassic.cs index ca55c59..ec80fcc 100644 --- a/TimeHACK.Engine/Template/WinClassic.cs +++ b/TimeHACK.Engine/Template/WinClassic.cs @@ -15,6 +15,7 @@ namespace TimeHACK.Engine.Template public Font fnt; + public bool resizable = true; public bool closeDisabled = false; public bool isActive = true; @@ -70,7 +71,7 @@ namespace TimeHACK.Engine.Template { if (e.Button == MouseButtons.Left) { - this.Size = new Size(MousePosition.X - this.Location.X, this.Size.Height); + if (resizable) this.Size = new Size(MousePosition.X - this.Location.X, this.Size.Height); } } @@ -78,15 +79,15 @@ namespace TimeHACK.Engine.Template { if (e.Button == MouseButtons.Left) { - this.Size = new Size(this.Size.Width + (this.Location.X - MousePosition.X), this.Size.Height); - this.Location = new Point(MousePosition.X, this.Location.Y); + if (resizable) this.Size = new Size(this.Size.Width + (this.Location.X - MousePosition.X), this.Size.Height); + if (resizable) this.Location = new Point(MousePosition.X, this.Location.Y); } } private void bottom_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - this.Size = new Size(this.Size.Width, MousePosition.Y - this.Location.Y); + if (resizable) this.Size = new Size(this.Size.Width, MousePosition.Y - this.Location.Y); } } diff --git a/TimeHACK.Engine/WindowManager.cs b/TimeHACK.Engine/WindowManager.cs index 41d1d02..e206303 100644 --- a/TimeHACK.Engine/WindowManager.cs +++ b/TimeHACK.Engine/WindowManager.cs @@ -10,7 +10,7 @@ namespace TimeHACK.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) + public WinClassic StartWin95(UserControl content, string title, Image icon, bool MaxButton, bool MinButton, bool ShowApplicationAsDialog = false, bool resize = true) { // Setup Window WinClassic app = new WinClassic(); @@ -51,6 +51,9 @@ namespace TimeHACK.Engine app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y); } + //Resize + app.resizable = resize; + // Time for the colors app.programtopbar.BackColor = SaveSystem.currentTheme.activeTitleBarColor; app.Title.ForeColor = SaveSystem.currentTheme.activeTitleTextColor; @@ -81,7 +84,7 @@ namespace TimeHACK.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); + return StartWin95(app, title, null, false, false, resize: false); } public WinClassic StartAboutBox95(string shortname, string longname, Image appicon) @@ -91,7 +94,7 @@ namespace TimeHACK.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); + return StartWin95(uc, "About " + shortname, null, false, false, resize: false); } } } diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index 4d9d15c..ab92313 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -117,7 +117,7 @@ namespace TimeHACK.OS.Win95 CurrentSave.FTime95 = true; SaveSystem.SaveGame(); WinClassicWelcome welcome = new WinClassicWelcome(); - WinClassic app = wm.StartWin95(welcome, "Welcome", null, false, false); + WinClassic app = wm.StartWin95(welcome, "Welcome", null, false, false, resize: false); AddTaskBarItem(app, app.Tag.ToString(), "Welcome", null); nonimportantapps.Add(app); @@ -239,7 +239,7 @@ namespace TimeHACK.OS.Win95 private void downloaderTestToolStripMenuItem_Click(object sender, EventArgs e) { WinClassicDownloader opendownload = new WinClassicDownloader(); - WinClassic app = wm.StartWin95(opendownload, "Downloader", null, false, true); + WinClassic app = wm.StartWin95(opendownload, "Downloader", null, false, true, resize: false); opendownload.appName.Text = "Downloading: Survive The Day"; AddTaskBarItem(app, app.Tag.ToString(), "Downloader", null); @@ -251,7 +251,7 @@ namespace TimeHACK.OS.Win95 private void installerTestToolStripMenuItem_Click(object sender, EventArgs e) { Win95Installer openinstaller = new Win95Installer("Testing"); - WinClassic app = wm.StartWin95(openinstaller, "Installer", null, false, true); + WinClassic app = wm.StartWin95(openinstaller, "Installer", null, false, true, resize: false); AddTaskBarItem(app, app.Tag.ToString(), "Installer", null); @@ -456,7 +456,7 @@ namespace TimeHACK.OS.Win95 private void PropertiesToolStripMenuItem1_Click(object sender, EventArgs e) { WinClassicThemePanel theme = new WinClassicThemePanel(); - WinClassic app = wm.StartWin95(theme, "Themes", null, false, true, false); + WinClassic app = wm.StartWin95(theme, "Themes", null, false, true, false, resize: false); AddTaskBarItem(app, app.Tag.ToString(), "Themes", null); app.BringToFront(); @@ -489,7 +489,7 @@ namespace TimeHACK.OS.Win95 private void CalculatorToolStripMenuItem_Click(object sender, EventArgs e) { - WinClassic app = wm.StartWin95(new WinClassicCalculator(), "Calculator", Properties.Resources.WinClassicCalc, false, false); + WinClassic app = wm.StartWin95(new WinClassicCalculator(), "Calculator", Properties.Resources.WinClassicCalc, false, false, resize: false); AddTaskBarItem(app, app.Tag.ToString(), "Calculator", Properties.Resources.WinClassicCalc); nonimportantapps.Add(app); |
