aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine/Template/WinClassic.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Histacom2.Engine/Template/WinClassic.cs')
-rw-r--r--Histacom2.Engine/Template/WinClassic.cs70
1 files changed, 52 insertions, 18 deletions
diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs
index 25cbfaa..1f715ab 100644
--- a/Histacom2.Engine/Template/WinClassic.cs
+++ b/Histacom2.Engine/Template/WinClassic.cs
@@ -88,8 +88,11 @@ namespace Histacom2.Engine.Template
{
var toDraw = resizer.ToDraw;
if (resizable) {
- if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
- if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
}
resizer.ToDraw = toDraw;
}
@@ -100,8 +103,11 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) toDraw.Y = this.Location.Y;
- if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y;
+ if (resizable)
+ {
+ toDraw.Y = this.Location.Y;
+ toDraw.Height = MousePosition.Y - this.Location.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -111,8 +117,13 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
- if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y;
+ if (resizable)
+ {
+ if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8)
+ toDraw.Width = MousePosition.X - this.Location.X;
+ toDraw.Height = MousePosition.Y - this.Location.Y;
+ }
+
resizer.ToDraw = toDraw;
}
}
@@ -122,9 +133,15 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X);
- if (resizable) toDraw.Height = Cursor.Position.Y - this.Location.Y;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
+ if (resizable)
+ {
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
+ toDraw.Height = Cursor.Position.Y - this.Location.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -134,10 +151,16 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
- if (resizable) toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
+ toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -147,8 +170,11 @@ namespace Histacom2.Engine.Template
if(e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -158,9 +184,12 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
- if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
+ toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -310,6 +339,11 @@ namespace Histacom2.Engine.Template
gfx.DrawLine(new Pen(_darkBack), 0, 2, 2, 2);
}
+ private void minimizebutton_Click(object sender, EventArgs e)
+ {
+ Hide();
+ }
+
public Size prevSize;
public Point prevPoint;
private void maximizebutton_Click(object sender, EventArgs e)