예제 #1
0
        internal override void DoMouseDown(DUIMouseEventArgs e)
        {
            if (!this.Visible || !this.Enabled)
            {
                return;
            }
            DUIControl dUIControl = this.GetChildAtPoint(e.Location);

            if (dUIControl == null)
            {
                #region 重写的部分,只有在多边形区域内的时候才判定为设置焦点
                if (this.ContainPoint(e.Location) || this.GetPolygonPointIndex(e.Location) != -1)
                {
                    this.Focus();
                }
                else
                {
                    if (this.DUIParent != null)
                    {
                        this.DUIParent.Focus();
                    }
                }
                #endregion
                this.AlwaysMouseDown(this, e);
                this.InvokeOnMouseDown(this, e);
            }
            else
            {
                dUIControl.DoMouseDown(new DUIMouseEventArgs(e.Button, e.Clicks, dUIControl.PointFromParent(e.Location), e.Delta));
            }
        }
예제 #2
0
 public DUIControlAnyChangingEventArgs(DUIControl control, RectangleF newBounds, RectangleF oldBounds, PointF newCenter, PointF oldCenter, PointF newSkew, PointF oldSkew, PointF newScale, PointF oldScale, float newRotateAngle, float oldRotateAngle)
 {
     this.control        = control;
     this.newBounds      = newBounds;
     this.oldBounds      = oldBounds;
     this.newCenter      = newCenter;
     this.oldCenter      = oldCenter;
     this.newSkew        = newSkew;
     this.oldSkew        = oldSkew;
     this.newScale       = newScale;
     this.oldScale       = oldScale;
     this.newRotateAngle = newRotateAngle;
     this.oldRotateAngle = oldRotateAngle;
 }
예제 #3
0
        public ToolTipForm()
        {
            this.DoubleBuffered         = true;
            this.synchronizationContext = SynchronizationContext.Current;
            this.DropShadowEnabled      = false; //是否绘制边框阴影
            this.BackColor = Color.Transparent;
            this.control   = new ToolTipControl()
            {
                Width = 200, Height = 200
            };
            DUIControl dc = new DUIControl()
            {
                Dock = DockStyle.Fill
            };

            this.control.DUIControls.Add(dc);
            mControlHost         = new ToolStripControlHost(this.control);
            mControlHost.Padding = Padding.Empty;
            mControlHost.Margin  = Padding.Empty;
            //mControlHost.AutoSize = false;
            this.Padding = Padding.Empty;
            this.Items.Add(mControlHost);
            dc.Paint += (s, e) =>
            {
                e.Graphics.DrawImageDc(this.backImageDc, 0, 0);
                e.Graphics.FillRectangle(DUIBrushes.Blue, new RectangleF(60, 60, 60, 60));
            };
            this.control.Paint += (s, e) =>
            {
                //IntPtr hDC = e.Graphics.GetHdc();
                //NativeMethods.BitBlt(hDC, 0, 0, this.Width, this.Height, backImageDc.Hdc, 0, 0, 0xCC0020);
                //e.Graphics.ReleaseHdc(hDC);
                //using (SolidBrush sb = new SolidBrush(Color.FromArgb(60, Color.Red)))
                //{
                //    e.Graphics.FillRectangle(sb, new Rectangle(0, 0, this.Width, this.Height));
                //}
            };
        }
 public DUIControlRotateAngleChangingEventArgs(DUIControl control, float newRotateAngle, float oldRotateAngle)
 {
     this.control        = control;
     this.newRotateAngle = newRotateAngle;
     this.oldRotateAngle = oldRotateAngle;
 }
 public DUIParentSkewChangingEventArgs(DUIControl control, PointF newSkew, PointF oldSkew)
 {
     this.control = control;
     this.newSkew = newSkew;
     this.oldSkew = oldSkew;
 }
 public DUIControlLocationChangingEventArgs(DUIControl control, PointF newLocation, PointF oldLocation)
 {
     this.control     = control;
     this.newLocation = newLocation;
     this.oldLocation = oldLocation;
 }
예제 #7
0
 public DUIParentBoundsChangingEventArgs(DUIControl control, RectangleF newBounds, RectangleF oldBounds)
 {
     this.control   = control;
     this.newBounds = newBounds;
     this.oldBounds = oldBounds;
 }
예제 #8
0
 public DUIControlEventArgs(DUIControl control)
 {
     this.control = control;
 }
 public DUIParentScaleChangingEventArgs(DUIControl control, PointF newScale, PointF oldScale)
 {
     this.control  = control;
     this.newScale = newScale;
     this.oldScale = oldScale;
 }
예제 #10
0
 public DUIMouseStateEventArgs(DUIControl affectedControl, MouseButtons button)
 {
     this.affectedControl = affectedControl;
     this.button          = button;
 }
예제 #11
0
 public DUILayoutEventArgs(DUIControl affectedControl, string affectedProperty)
 {
     this.affectedControl  = affectedControl;
     this.affectedProperty = affectedProperty;
 }
예제 #12
0
 public DUIParentChangingEventArgs(DUIControl newParent, DUIControl oldParent)
 {
     this.newParent = newParent;
     this.oldParent = oldParent;
 }
 public DUIControlCenterChangingEventArgs(DUIControl control, PointF newCenter, PointF oldCenter)
 {
     this.control   = control;
     this.newCenter = newCenter;
     this.oldCenter = oldCenter;
 }
 public DUIParentSizeChangingEventArgs(DUIControl control, SizeF newSize, SizeF oldSize)
 {
     this.control = control;
     this.newSize = newSize;
     this.oldSize = oldSize;
 }