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))); } }
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; } }
/// <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; } } }
protected virtual bool TestKnobWithin(Point location) { return(UI2DHelper.IsWithin(location, knobBound)); }
/// <summary> /// Tests whether the mouse is within the bounds. /// </summary> /// <returns></returns> protected virtual bool TestWithin(Point location) { return(UI2DHelper.IsWithin(location, paintBounds)); }