A SetCursorEvent is generated when the mouse cursor is about to be set as a result of mouse motion. This event gives the application the chance to perform specific mouse cursor processing based on the current position of the mouse within the window. Use SetCursor to specify the cursor you want to be displayed.

Derived from


Include files


See also

::wxSetCursor wxWindow::wxSetCursor

Event table macros

To process a set cursor event, use this event handler macro to direct input to a member function that takes a wxSetCursorEvent argument.

EVT_SET_CURSOR(func) Process a wxEVT_SET_CURSOR event.


wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0)

Constructor, used by the library itself internally to initialize the event object.


wxCursor& GetCursor(void) const

Returns a reference to the cursor specified by this event.


wxCoord GetX(void) const

Returns the X coordinate of the mouse in client coordinates.


wxCoord GetY(void) const

Returns the Y coordinate of the mouse in client coordinates.


bool HasCursor(void) const

Returns TRUEif the cursor specified by this event is a valid cursor.


You cannot specify wxNullCursor with this event, as it is not considered a valid cursor.


void SetCursor(const wxCursor& cursor)

Sets the cursor associated with this event.

ymasuda 平成17年11月19日