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 ::Objects:, ::wxNullCursor, ::Pointers:, ::wxSTANDARD_CURSOR,
32 ::wxHOURGLASS_CURSOR, ::wxCROSS_CURSOR,
34 @see wxBitmap, wxIcon, wxWindow::SetCursor, ::wxSetCursor
36 class wxCursor
: public wxBitmap
41 Copy constructor, uses @ref overview_trefcount "reference counting".
46 Bits for a mask bitmap.
56 Icon type to load. Under Motif, type defaults to wxBITMAP_TYPE_XBM. Under
58 it defaults to wxBITMAP_TYPE_CUR_RESOURCE. Under MacOS, it defaults to
59 wxBITMAP_TYPE_MACCURSOR_RESOURCE.
60 Under X, the permitted cursor types are:
73 Load an X bitmap file.
79 Under Windows, the permitted types are:
92 Load a cursor from a .cur cursor file (only if USE_RESOURCE_LOADING_IN_MSW
93 is enabled in setup.h).
99 wxBITMAP_TYPE_CUR_RESOURCE
104 Load a Windows resource (as specified in the .rc file).
115 Load a cursor from a .ico icon file (only if USE_RESOURCE_LOADING_IN_MSW
116 is enabled in setup.h). Specify hotSpotX and hotSpotY.
118 A stock cursor identifier. May be one of:
131 A standard arrow cursor.
142 A standard arrow cursor
143 pointing to the right.
176 Rectangular character cursor.
209 An I-beam cursor (vertical line).
220 Represents a mouse with the left button depressed.
237 wxCURSOR_MIDDLE_BUTTON
242 Represents a mouse with the middle button depressed.
253 A no-entry sign cursor.
286 A cursor that points left.
297 A cursor that points right.
303 wxCURSOR_QUESTION_ARROW
308 An arrow and question mark.
314 wxCURSOR_RIGHT_BUTTON
319 Represents a mouse with the right button depressed.
330 A sizing cursor pointing NE-SW.
341 A sizing cursor pointing N-S.
352 A sizing cursor pointing NW-SE.
363 A sizing cursor pointing W-E.
374 A general sizing cursor.
418 A cursor with both an arrow and
419 an hourglass, (windows.)
425 Note that not all cursors are available on all platforms.
427 Pointer or reference to a cursor to copy.
430 wxCursor(const char bits
[], int width
, int height
,
431 int hotSpotX
= -1, int hotSpotY
= -1,
432 const char maskBits
[] = NULL
,
434 wxColour
* bg
= NULL
);
435 wxCursor(const wxString
& cursorName
, long type
,
436 int hotSpotX
= 0, int hotSpotY
= 0);
437 wxCursor(int cursorId
);
438 wxCursor(const wxImage
& image
);
439 wxCursor(const wxCursor
& cursor
);
444 See @ref overview_refcountdestruct "reference-counted object destruction" for
446 A cursor can be reused for more
447 than one window, and does not get destroyed when the window is
448 destroyed. wxWidgets destroys all cursors on application exit, although
449 it is best to clean them up explicitly.
454 Returns @true if cursor data is present.
459 Assignment operator, using @ref overview_trefcount "reference counting".
461 wxCursor
operator =(const wxCursor
& cursor
);
474 wxCursor wxNullCursor
;
485 wxCursor wxSTANDARD_CURSOR
;
490 wxCursor wxHOURGLASS_CURSOR
;
495 wxCursor wxCROSS_CURSOR
;