diff options
| author | lempamo <[email protected]> | 2017-08-02 10:35:43 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-08-02 10:35:43 -0500 |
| commit | a3b48880bf4136cb8033305fde052727e24ab8b1 (patch) | |
| tree | c2b0ef7c9bfc56da1493154eab4cbc2cd2d8eed0 /TimeHACK.Engine/Template/WinClassic.cs | |
| parent | 9a68e5ed46f76d4ddda94c234a65a757797bdae9 (diff) | |
| parent | 5fdd82f5f0069ad55662ff974a30d415543d3474 (diff) | |
| download | histacom2-a3b48880bf4136cb8033305fde052727e24ab8b1.tar.gz histacom2-a3b48880bf4136cb8033305fde052727e24ab8b1.tar.bz2 histacom2-a3b48880bf4136cb8033305fde052727e24ab8b1.zip | |
Merge pull request #145 from jtsshieh/master
Working but pretty buggy resize system
Diffstat (limited to 'TimeHACK.Engine/Template/WinClassic.cs')
| -rw-r--r-- | TimeHACK.Engine/Template/WinClassic.cs | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/TimeHACK.Engine/Template/WinClassic.cs b/TimeHACK.Engine/Template/WinClassic.cs index ec80fcc..cc2a67a 100644 --- a/TimeHACK.Engine/Template/WinClassic.cs +++ b/TimeHACK.Engine/Template/WinClassic.cs @@ -79,18 +79,67 @@ namespace TimeHACK.Engine.Template { if (e.Button == MouseButtons.Left) { - 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); + if (resizable) this.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + if (resizable)this.Location = new Point(Cursor.Position.X, this.Location.Y); } } private void bottom_MouseMove(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Left) { + if (e.Button == MouseButtons.Left) + { if (resizable) this.Size = new Size(this.Size.Width, MousePosition.Y - this.Location.Y); } } + private void bottomrightcorner_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + if (resizable) this.Size = new Size(MousePosition.X - this.Location.X, MousePosition.Y - this.Location.Y); + } + } + + private void bottomleftcorner_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + if (resizable) this.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + if (resizable) this.Height = (Cursor.Position.Y - this.Location.Y); + if (resizable) this.Location = new Point(Cursor.Position.X, this.Location.Y); + } + } + + private void topleftcorner_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + if (resizable) this.Width = ((this.Width + this.Location.X) - Cursor.Position.X); + if (resizable) this.Location = new Point(Cursor.Position.X, this.Location.Y); + if (resizable) this.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); + if (resizable) this.Location = new Point(this.Location.X, Cursor.Position.Y); + } + } + + private void top_MouseMove(object sender, MouseEventArgs e) + { + if(e.Button == MouseButtons.Left) + { + if(resizable) this.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y); + if(resizable) this.Location = new Point(this.Location.X, Cursor.Position.Y); + } + } + + private void toprightcorner_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + if (resizable) this.Width = (Cursor.Position.X - this.Location.X); + if (resizable) this.Height = ((this.Location.Y - Cursor.Position.Y) + this.Height); + if (resizable) this.Location = new Point(this.Location.X, Cursor.Position.Y); + } + } + public bool max = false; private void maximizebutton_Click(object sender, EventArgs e) |
