Example #1
0
        protected override bool OnMotionNotifyEvent(Gdk.EventMotion evnt)
        {
            if (!EventInGripWindow(evnt))
            {
                return(false);
            }

            if (InPreDrag)
            {
                if (Drag.CheckThreshold(this, startX, startY,
                                        (int)evnt.X, (int)evnt.Y))
                {
                    DockObjectFlags &= ~(DockObjectFlags.InPreDrag);
                    dragoffX         = startX;
                    dragoffY         = startY;
                    StartDrag();
                }
            }

            if (!InDrag)
            {
                return(false);
            }

            int newX = (int)evnt.XRoot;
            int newY = (int)evnt.YRoot;

            OnDragMotion(newX, newY);
            DockItemMotionHandler handler = DockItemMotion;

            if (handler != null)
            {
                handler(this, newX, newY);
            }

            return(true);
        }