[Win] Cleaned up window size/pos properties

This commit is contained in:
thefiddler 2014-05-09 15:22:33 +02:00
parent f0d0f6e53a
commit 8eae337d93

View file

@ -419,8 +419,7 @@ namespace OpenTK.Platform.Windows
}; };
// Max points GetMouseMovePointsEx can return is 64. // Max points GetMouseMovePointsEx can return is 64.
int numPoints = 64; const int numPoints = 64;
MouseMovePoint* movePoints = stackalloc MouseMovePoint[numPoints]; MouseMovePoint* movePoints = stackalloc MouseMovePoint[numPoints];
// GetMouseMovePointsEx fills in movePoints so that the most // GetMouseMovePointsEx fills in movePoints so that the most
@ -977,7 +976,7 @@ namespace OpenTK.Platform.Windows
#region Location #region Location
public Point Location public override Point Location
{ {
get { return Bounds.Location; } get { return Bounds.Location; }
set set
@ -991,7 +990,7 @@ namespace OpenTK.Platform.Windows
#region Size #region Size
public Size Size public override Size Size
{ {
get { return Bounds.Size; } get { return Bounds.Size; }
set set
@ -1003,29 +1002,6 @@ namespace OpenTK.Platform.Windows
#endregion #endregion
#region ClientRectangle
public Rectangle ClientRectangle
{
get
{
if (client_rectangle.Width == 0)
client_rectangle.Width = 1;
if (client_rectangle.Height == 0)
client_rectangle.Height = 1;
return client_rectangle;
}
set
{
WindowStyle style = (WindowStyle)Functions.GetWindowLong(window.Handle, GetWindowLongOffsets.STYLE);
Win32Rectangle rect = Win32Rectangle.From(value);
Functions.AdjustWindowRect(ref rect, style, false);
Size = new Size(rect.Width, rect.Height);
}
}
#endregion
#region ClientSize #region ClientSize
public override Size ClientSize public override Size ClientSize
@ -1045,46 +1021,6 @@ namespace OpenTK.Platform.Windows
#endregion #endregion
#region Width
public int Width
{
get { return ClientRectangle.Width; }
set { ClientRectangle = new Rectangle(0, 0, value, Height); }
}
#endregion
#region Height
public int Height
{
get { return ClientRectangle.Height; }
set { ClientRectangle = new Rectangle(0, 0, Width, value); }
}
#endregion
#region X
public int X
{
get { return Location.X; }
set { Location = new Point(value, Y); }
}
#endregion
#region Y
public int Y
{
get { return Location.Y; }
set { Location = new Point(X, value); }
}
#endregion
#region Icon #region Icon
public override Icon Icon public override Icon Icon