예제 #1
0
        private void onFormMouseDown(object sender, MouseEventArgs e)
        {
            // Any mouse down means we close context menu if visible
            if (ctxtForm != null)
            {
                CloseContextMenu(ctxtForm.CtxtMenuControl);
            }

            // Got capture?
            if (ctrlCapturingMouse != null)
            {
                // Transform to control's coordinates
                Point pCtrl = new Point(e.Location.X - ctrlCapturingMouse.AbsLeft, e.Location.Y - ctrlCapturingMouse.AbsTop);
                ctrlCapturingMouse.DoMouseDown(pCtrl, e.Button);
                return;
            }

            // Over any control? Not our job to handle.
            if (DoMouseDown(e.Location, e.Button))
            {
                return;
            }

            // Enter resize/move mode if needed
            if (e.Button == MouseButtons.Left)
            {
                doMouseDownRM(e.Location);
            }
        }
예제 #2
0
        public virtual bool DoMouseDown(Point p, MouseButtons button)
        {
            ZenControlBase ctrl = GetControl(p);

            if (ctrl != null)
            {
                return(ctrl.DoMouseDown(parentToControl(ctrl, p), button));
            }
            return(false);
        }