RaUI/Source/ryControls/Sheng.Winform.Controls/PopupControl/GripBounds.cs
鑫Intel 8b41f58f5c ### 2021-07-01更新
------
#### ryControlsV4    V3.0.2107.0101
- *.[新增]新增Sheng.Winform.Controls部分控件。

#### RyWeb    V3.0.2107.0101
- *.[新增]QuickWeb新增引用页设置。
#### MyDbV4    V3.0.2107.0101
- *.[新增]支持忽略大小写的替换功能。
2021-07-04 09:41:31 +08:00

114 lines
2.8 KiB
C#

using System;
using System.Drawing;
namespace Sheng.Winform.Controls.PopupControl
{
internal struct GripBounds
{
private const int GripSize = 6;
private const int CornerGripSize = GripSize << 1;
public GripBounds(Rectangle clientRectangle)
{
this.clientRectangle = clientRectangle;
}
private Rectangle clientRectangle;
public Rectangle ClientRectangle
{
get { return clientRectangle; }
//set { clientRectangle = value; }
}
public Rectangle Bottom
{
get
{
Rectangle rect = ClientRectangle;
rect.Y = rect.Bottom - GripSize + 1;
rect.Height = GripSize;
return rect;
}
}
public Rectangle BottomRight
{
get
{
Rectangle rect = ClientRectangle;
rect.Y = rect.Bottom - CornerGripSize + 1;
rect.Height = CornerGripSize;
rect.X = rect.Width - CornerGripSize + 1;
rect.Width = CornerGripSize;
return rect;
}
}
public Rectangle Top
{
get
{
Rectangle rect = ClientRectangle;
rect.Height = GripSize;
return rect;
}
}
public Rectangle TopRight
{
get
{
Rectangle rect = ClientRectangle;
rect.Height = CornerGripSize;
rect.X = rect.Width - CornerGripSize + 1;
rect.Width = CornerGripSize;
return rect;
}
}
public Rectangle Left
{
get
{
Rectangle rect = ClientRectangle;
rect.Width = GripSize;
return rect;
}
}
public Rectangle BottomLeft
{
get
{
Rectangle rect = ClientRectangle;
rect.Width = CornerGripSize;
rect.Y = rect.Height - CornerGripSize + 1;
rect.Height = CornerGripSize;
return rect;
}
}
public Rectangle Right
{
get
{
Rectangle rect = ClientRectangle;
rect.X = rect.Right - GripSize + 1;
rect.Width = GripSize;
return rect;
}
}
public Rectangle TopLeft
{
get
{
Rectangle rect = ClientRectangle;
rect.Width = CornerGripSize;
rect.Height = CornerGripSize;
return rect;
}
}
}
}