diff options
Diffstat (limited to 'TimeHACK.Engine')
| -rw-r--r-- | TimeHACK.Engine/Template/WinClassic.cs | 9 | ||||
| -rw-r--r-- | TimeHACK.Engine/WindowManager.cs | 9 |
2 files changed, 11 insertions, 7 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); } } } |
