| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:GripBounds.cs
- * 2.功能描述:结构类
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2014/09/04 1.00 新建
- *******************************************************************************/
- using System;
- using System.Drawing;
- namespace Dongke.IBOSS.PRD.Basics.BaseControls
- {
- /// <summary>
- /// CodeProject.com "Simple pop-up control" "http://www.codeproject.com/cs/miscctrl/simplepopup.asp".
- /// </summary>
- 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;
- }
- }
- }
- }
|