示例#1
0
 protected override void ProcessMouseDown(Point p)
 {
     if (!RibbonBtnRect.IsEmpty && RibbonBtnRect.Contains(p))
     {
         _RibbonBtnState = EnumControlState.Focused;
     }
     if (!SkinBoxRect.IsEmpty && SkinBoxRect.Contains(p))
     {
         _SkinBtnState = EnumControlState.Focused;
     }
     base.ProcessMouseDown(p);
 }
示例#2
0
 protected override void ProcessMouseMove(Point p)
 {
     _SkinBtnState = EnumControlState.Default;
     if (!RibbonBtnRect.IsEmpty && RibbonBtnRect.Contains(p))
     {
         _RibbonBtnState = EnumControlState.HeightLight;
     }
     if (!SkinBoxRect.IsEmpty && SkinBoxRect.Contains(p))
     {
         _SkinBtnState = EnumControlState.HeightLight;
     }
     base.ProcessMouseMove(p);
 }
示例#3
0
 protected override void ProcessMouseUp(Point p)
 {
     if (!RibbonBtnRect.IsEmpty && RibbonBtnRect.Contains(p))
     {
         _RibbonBtnState = EnumControlState.Default;
         if (this.OnRibbonButtonClick != null)
         {
             BtnEventArgs e = new BtnEventArgs(RibbonBtnRect);
             this.OnRibbonButtonClick(null, e);
         }
     }
     if (!SkinBoxRect.IsEmpty && SkinBoxRect.Contains(p))
     {
         _SkinBtnState = EnumControlState.Default;
         if (this.OnSkinButtonClick != null)
         {
             BtnEventArgs e = new BtnEventArgs(SkinBoxRect);
             this.OnSkinButtonClick(null, e);
         }
     }
     base.ProcessMouseUp(p);
 }
示例#4
0
        protected override void WmNcHitTest(ref Message m)
        {
            int   value = m.LParam.ToInt32();
            Point p     = new Point(Win32.LOWORD(value), Win32.HIWORD(value));

            p = PointToClient(p);
            if (RibbonBtnRect.Contains(p))
            {
                m.Result = new IntPtr(1);
            }
            else
            {
                if (base.ResizeEnable && base.CaptionHeight > 0)
                {
                    int num = 4;
                    if (p.X <= num && p.Y <= num)
                    {
                        m.Result = new IntPtr(13);
                        return;
                    }
                    if (p.X >= base.Width - num && p.Y <= num)
                    {
                        m.Result = new IntPtr(14);
                        return;
                    }
                    if (p.X >= base.Width - num && p.Y >= base.Height - num)
                    {
                        m.Result = new IntPtr(17);
                        return;
                    }
                    if (p.X <= num && p.Y >= base.Height - num)
                    {
                        m.Result = new IntPtr(16);
                        return;
                    }
                    if (p.Y <= num)
                    {
                        m.Result = new IntPtr(12);
                        return;
                    }
                    if (p.Y >= base.Height - num)
                    {
                        m.Result = new IntPtr(15);
                        return;
                    }
                    if (p.X <= num)
                    {
                        m.Result = new IntPtr(10);
                        return;
                    }
                    if (p.X >= base.Width - num)
                    {
                        m.Result = new IntPtr(11);
                        return;
                    }
                }
                if (p.Y <= base.CaptionHeight)
                {
                    if (!base.CloseBoxRect.Contains(p) && !base.MaximizeBoxRect.Contains(p) && !base.MinimizeBoxRect.Contains(p) && !SkinBoxRect.Contains(p) && !RibbonBtnRect.Contains(p))
                    {
                        m.Result = new IntPtr(2);
                    }
                    else
                    {
                        m.Result = new IntPtr(1);
                    }
                }
                else if (base.CaptionHeight > 0)
                {
                    m.Result = new IntPtr(2);
                }
            }
        }