示例#1
0
 protected override bool TestWithin(Point location)
 {
     if (orientation == GoblinEnums.Orientation.Horizontal)
     {
         return(UI2DHelper.IsWithin(location, new Rectangle(paintBounds.X, paintBounds.Y - 8,
                                                            paintBounds.Width, paintBounds.Height + 13)));
     }
     else
     {
         return(UI2DHelper.IsWithin(location, new Rectangle(paintBounds.X - 8, paintBounds.Y,
                                                            paintBounds.Width + 13, paintBounds.Height)));
     }
 }
示例#2
0
 protected virtual void CheckArrowPress(Point location)
 {
     if (UI2DHelper.IsWithin(location, upArrowBound))
     {
         DoNextClick();
         upPressed = true;
         heldDown  = true;
     }
     else if (UI2DHelper.IsWithin(location, downArrowBound))
     {
         DoPreviousClick();
         downPressed = true;
         heldDown    = true;
     }
 }
示例#3
0
        /// <summary>
        /// Implements how a mouse move event should be handled.
        /// </summary>
        /// <param name="mouseLocation">The current location of the mouse in
        /// screen coordinates</param>
        protected virtual void HandleMouseMove(Point mouseLocation)
        {
            within = TestWithin(mouseLocation);

            if (!within || !enabled || !visible)
            {
                mouseDown = false;
                return;
            }

            if (MouseMovedEvent != null)
            {
                MouseMovedEvent(mouseLocation);
            }

            // FIXME: need fix for enter and exit event for boundary cases!!
            if (UI2DHelper.OnEdge(mouseLocation, paintBounds))
            {
                if (!entered) // Enter event
                {
                    if (MouseEnteredEvent != null)
                    {
                        MouseEnteredEvent();
                    }
                    entered = true;
                }
                else // Exit event
                {
                    if (MouseExitedEvent != null)
                    {
                        MouseExitedEvent();
                    }
                    entered = false;
                }
            }
        }
示例#4
0
 protected virtual bool TestKnobWithin(Point location)
 {
     return(UI2DHelper.IsWithin(location, knobBound));
 }
示例#5
0
 /// <summary>
 /// Tests whether the mouse is within the bounds.
 /// </summary>
 /// <returns></returns>
 protected virtual bool TestWithin(Point location)
 {
     return(UI2DHelper.IsWithin(location, paintBounds));
 }