1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxCursor
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A cursor is a small bitmap usually used for denoting where the mouse
14 pointer is, with a picture that might indicate the interpretation of a
15 mouse click. As with icons, cursors in X and MS Windows are created
16 in a different manner. Therefore, separate cursors will be created for the
17 different environments. Platform-specific methods for creating a @b wxCursor
18 object are catered for, and this is an occasion where
19 conditional compilation will probably be required (see wxIcon for
22 A single cursor object may be used in many windows (any subwindow type).
23 The wxWidgets convention is to set the cursor for a window, as in X,
24 rather than to set it globally as in MS Windows, although a
25 global ::wxSetCursor is also available for MS Windows use.
31 ::wxNullCursor, ::wxSTANDARD_CURSOR, ::wxHOURGLASS_CURSOR, ::wxCROSS_CURSOR
33 @see wxBitmap, wxIcon, wxWindow::SetCursor, ::wxSetCursor
35 class wxCursor
: public wxBitmap
40 Copy constructor, uses @ref overview_trefcount "reference counting".
45 Bits for a mask bitmap.
55 Icon type to load. Under Motif, type defaults to wxBITMAP_TYPE_XBM. Under
57 it defaults to wxBITMAP_TYPE_CUR_RESOURCE. Under MacOS, it defaults to
58 wxBITMAP_TYPE_MACCURSOR_RESOURCE.
59 Under X, the permitted cursor types are:
72 Load an X bitmap file.
78 Under Windows, the permitted types are:
91 Load a cursor from a .cur cursor file (only if USE_RESOURCE_LOADING_IN_MSW
92 is enabled in setup.h).
98 wxBITMAP_TYPE_CUR_RESOURCE
103 Load a Windows resource (as specified in the .rc file).
114 Load a cursor from a .ico icon file (only if USE_RESOURCE_LOADING_IN_MSW
115 is enabled in setup.h). Specify hotSpotX and hotSpotY.
117 A stock cursor identifier. May be one of:
130 A standard arrow cursor.
141 A standard arrow cursor
142 pointing to the right.
175 Rectangular character cursor.
208 An I-beam cursor (vertical line).
219 Represents a mouse with the left button depressed.
236 wxCURSOR_MIDDLE_BUTTON
241 Represents a mouse with the middle button depressed.
252 A no-entry sign cursor.
285 A cursor that points left.
296 A cursor that points right.
302 wxCURSOR_QUESTION_ARROW
307 An arrow and question mark.
313 wxCURSOR_RIGHT_BUTTON
318 Represents a mouse with the right button depressed.
329 A sizing cursor pointing NE-SW.
340 A sizing cursor pointing N-S.
351 A sizing cursor pointing NW-SE.
362 A sizing cursor pointing W-E.
373 A general sizing cursor.
417 A cursor with both an arrow and
418 an hourglass, (windows.)
424 Note that not all cursors are available on all platforms.
426 Pointer or reference to a cursor to copy.
429 wxCursor(const char bits
[], int width
, int height
,
430 int hotSpotX
= -1, int hotSpotY
= -1,
431 const char maskBits
[] = NULL
,
433 wxColour
* bg
= NULL
);
434 wxCursor(const wxString
& cursorName
, long type
,
435 int hotSpotX
= 0, int hotSpotY
= 0);
436 wxCursor(int cursorId
);
437 wxCursor(const wxImage
& image
);
438 wxCursor(const wxCursor
& cursor
);
443 See @ref overview_refcountdestruct "reference-counted object destruction" for
445 A cursor can be reused for more
446 than one window, and does not get destroyed when the window is
447 destroyed. wxWidgets destroys all cursors on application exit, although
448 it is best to clean them up explicitly.
453 Returns @true if cursor data is present.
458 Assignment operator, using @ref overview_trefcount "reference counting".
460 wxCursor
operator =(const wxCursor
& cursor
);
466 wxCursor wxNullCursor
;
471 wxCursor wxSTANDARD_CURSOR
;
476 wxCursor wxHOURGLASS_CURSOR
;
481 wxCursor wxCROSS_CURSOR
;