aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Engine/Template
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-03-26 11:28:05 -0600
committerAShifter <[email protected]>2017-03-26 11:28:24 -0600
commitf16f3a8a3df33f46c4ec6c864447cced97c0f034 (patch)
tree6c06d045bd7afa16c89b63c01c41b2ace019ff8b /TimeHACK.Engine/Template
parenta7128e18c33b39b6253f9af3022fb1a47b1ac5f1 (diff)
downloadhistacom2-f16f3a8a3df33f46c4ec6c864447cced97c0f034.tar.gz
histacom2-f16f3a8a3df33f46c4ec6c864447cced97c0f034.tar.bz2
histacom2-f16f3a8a3df33f46c4ec6c864447cced97c0f034.zip
Finished WindowManager.cs
I HOPE YOU LIKE IT HONEYFRY
Diffstat (limited to 'TimeHACK.Engine/Template')
-rw-r--r--TimeHACK.Engine/Template/WinClassic.Designer.cs27
-rw-r--r--TimeHACK.Engine/Template/WinClassic.cs66
2 files changed, 82 insertions, 11 deletions
diff --git a/TimeHACK.Engine/Template/WinClassic.Designer.cs b/TimeHACK.Engine/Template/WinClassic.Designer.cs
index 7df96b7..6fc4a78 100644
--- a/TimeHACK.Engine/Template/WinClassic.Designer.cs
+++ b/TimeHACK.Engine/Template/WinClassic.Designer.cs
@@ -44,11 +44,13 @@
this.bottom = new System.Windows.Forms.Panel();
this.right = new System.Windows.Forms.Panel();
this.top = new System.Windows.Forms.Panel();
+ this.programIcon = new System.Windows.Forms.PictureBox();
this.program.SuspendLayout();
this.programtopbar.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
@@ -81,6 +83,7 @@
// programtopbar
//
this.programtopbar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(170)))));
+ this.programtopbar.Controls.Add(this.programIcon);
this.programtopbar.Controls.Add(this.maximizebutton);
this.programtopbar.Controls.Add(this.minimizebutton);
this.programtopbar.Controls.Add(this.Title);
@@ -90,6 +93,7 @@
this.programtopbar.Name = "programtopbar";
this.programtopbar.Size = new System.Drawing.Size(292, 18);
this.programtopbar.TabIndex = 0;
+ this.programtopbar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.programtopbar_drag);
//
// maximizebutton
//
@@ -100,6 +104,7 @@
this.maximizebutton.Size = new System.Drawing.Size(16, 14);
this.maximizebutton.TabIndex = 6;
this.maximizebutton.TabStop = false;
+ this.maximizebutton.Click += new System.EventHandler(this.maximizebutton_Click);
//
// minimizebutton
//
@@ -116,7 +121,7 @@
this.Title.AutoSize = true;
this.Title.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Title.ForeColor = System.Drawing.Color.White;
- this.Title.Location = new System.Drawing.Point(3, 2);
+ this.Title.Location = new System.Drawing.Point(23, 3);
this.Title.Name = "Title";
this.Title.Size = new System.Drawing.Size(99, 13);
this.Title.TabIndex = 3;
@@ -131,6 +136,7 @@
this.closebutton.Size = new System.Drawing.Size(16, 14);
this.closebutton.TabIndex = 4;
this.closebutton.TabStop = false;
+ this.closebutton.Click += new System.EventHandler(this.closebutton_Click);
//
// toprightcorner
//
@@ -208,6 +214,17 @@
this.top.Size = new System.Drawing.Size(300, 4);
this.top.TabIndex = 8;
//
+ // programIcon
+ //
+ this.programIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.programIcon.ErrorImage = null;
+ this.programIcon.InitialImage = null;
+ this.programIcon.Location = new System.Drawing.Point(2, 1);
+ this.programIcon.Name = "programIcon";
+ this.programIcon.Size = new System.Drawing.Size(16, 16);
+ this.programIcon.TabIndex = 0;
+ this.programIcon.TabStop = false;
+ //
// WinClassic
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -223,6 +240,7 @@
((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);
}
@@ -230,10 +248,7 @@
#endregion
internal System.Windows.Forms.Panel program;
- private System.Windows.Forms.Panel programContent;
internal System.Windows.Forms.Panel programtopbar;
- internal System.Windows.Forms.PictureBox maximizebutton;
- internal System.Windows.Forms.PictureBox minimizebutton;
internal System.Windows.Forms.Label Title;
internal System.Windows.Forms.PictureBox closebutton;
internal System.Windows.Forms.Panel toprightcorner;
@@ -244,5 +259,9 @@
internal System.Windows.Forms.Panel bottom;
internal System.Windows.Forms.Panel right;
internal System.Windows.Forms.Panel top;
+ public System.Windows.Forms.Panel programContent;
+ public System.Windows.Forms.PictureBox maximizebutton;
+ public System.Windows.Forms.PictureBox minimizebutton;
+ public System.Windows.Forms.PictureBox programIcon;
}
} \ No newline at end of file
diff --git a/TimeHACK.Engine/Template/WinClassic.cs b/TimeHACK.Engine/Template/WinClassic.cs
index aa72263..1bd11e3 100644
--- a/TimeHACK.Engine/Template/WinClassic.cs
+++ b/TimeHACK.Engine/Template/WinClassic.cs
@@ -1,11 +1,5 @@
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.Runtime.InteropServices;
using System.Windows.Forms;
namespace TimeHACK.Engine.Template
@@ -16,5 +10,63 @@ namespace TimeHACK.Engine.Template
{
InitializeComponent();
}
+
+ public const int WM_NCLBUTTONDOWN = 0xA1;
+ public const int HT_CAPTION = 0x2;
+
+ [DllImportAttribute("user32.dll")]
+ public static extern int SendMessage(IntPtr hWnd,
+ int Msg, int wParam, int lParam);
+ [DllImportAttribute("user32.dll")]
+ public static extern bool ReleaseCapture();
+
+ private void programtopbar_drag(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Left)
+ {
+ ReleaseCapture();
+ SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
+ }
+ }
+
+ private void closebutton_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ public Boolean max = false;
+
+ private void maximizebutton_Click(object sender, EventArgs e)
+ {
+ if (max == false)
+ {
+ this.right.Hide();
+ this.left.Hide();
+ this.bottom.Hide();
+ this.top.Hide();
+ this.bottomleftcorner.Hide();
+ this.bottomrightcorner.Hide();
+ this.topleftcorner.Hide();
+ this.toprightcorner.Hide();
+ this.Dock = DockStyle.Fill;
+ max = true;
+ maximizebutton.Image = Properties.Resources.WinClassicRestore;
+ }
+ else
+ {
+ this.right.Show();
+ this.left.Show();
+ this.bottom.Show();
+ this.top.Show();
+ this.bottomleftcorner.Show();
+ this.bottomrightcorner.Show();
+ this.topleftcorner.Show();
+ this.toprightcorner.Show();
+ this.Dock = DockStyle.None;
+ max = false;
+ maximizebutton.Image = Properties.Resources.WinClassicMax;
+ }
+
+ }
}
}