1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxCursor
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @ingroup group_class_gdi
14 A cursor is a small bitmap usually used for denoting where the mouse
15 pointer is, with a picture that might indicate the interpretation of a
16 mouse click. As with icons, cursors in X and MS Windows are created
17 in a different manner. Therefore, separate cursors will be created for the
18 different environments. Platform-specific methods for creating a @b wxCursor
19 object are catered for, and this is an occasion where
20 conditional compilation will probably be required (see wxIcon for
23 A single cursor object may be used in many windows (any subwindow type).
24 The wxWidgets convention is to set the cursor for a window, as in X,
25 rather than to set it globally as in MS Windows, although a
26 global ::wxSetCursor is also available for MS Windows use.
32 ::Objects:, ::wxNullCursor, ::Pointers:, ::wxSTANDARD_CURSOR,
33 ::wxHOURGLASS_CURSOR, ::wxCROSS_CURSOR,
35 @see wxBitmap, wxIcon, wxWindow::SetCursor, ::wxSetCursor
37 class wxCursor
: public wxBitmap
42 Copy constructor, uses @ref overview_trefcount "reference counting".
47 Bits for a mask bitmap.
57 Icon type to load. Under Motif, type defaults to wxBITMAP_TYPE_XBM. Under
59 it defaults to wxBITMAP_TYPE_CUR_RESOURCE. Under MacOS, it defaults to
60 wxBITMAP_TYPE_MACCURSOR_RESOURCE.
61 Under X, the permitted cursor types are:
74 Load an X bitmap file.
80 Under Windows, the permitted types are:
93 Load a cursor from a .cur cursor file (only if USE_RESOURCE_LOADING_IN_MSW
94 is enabled in setup.h).
100 wxBITMAP_TYPE_CUR_RESOURCE
105 Load a Windows resource (as specified in the .rc file).
116 Load a cursor from a .ico icon file (only if USE_RESOURCE_LOADING_IN_MSW
117 is enabled in setup.h). Specify hotSpotX and hotSpotY.
119 A stock cursor identifier. May be one of:
132 A standard arrow cursor.
143 A standard arrow cursor
144 pointing to the right.
177 Rectangular character cursor.
210 An I-beam cursor (vertical line).
221 Represents a mouse with the left button depressed.
238 wxCURSOR_MIDDLE_BUTTON
243 Represents a mouse with the middle button depressed.
254 A no-entry sign cursor.
287 A cursor that points left.
298 A cursor that points right.
304 wxCURSOR_QUESTION_ARROW
309 An arrow and question mark.
315 wxCURSOR_RIGHT_BUTTON
320 Represents a mouse with the right button depressed.
331 A sizing cursor pointing NE-SW.
342 A sizing cursor pointing N-S.
353 A sizing cursor pointing NW-SE.
364 A sizing cursor pointing W-E.
375 A general sizing cursor.
419 A cursor with both an arrow and
420 an hourglass, (windows.)
426 Note that not all cursors are available on all platforms.
428 Pointer or reference to a cursor to copy.
431 wxCursor(const char bits
[], int width
, int height
,
432 int hotSpotX
= -1, int hotSpotY
= -1,
433 const char maskBits
[] = NULL
,
435 wxColour
* bg
= NULL
);
436 wxCursor(const wxString
& cursorName
, long type
,
437 int hotSpotX
= 0, int hotSpotY
= 0);
438 wxCursor(int cursorId
);
439 wxCursor(const wxImage
& image
);
440 wxCursor(const wxCursor
& cursor
);
445 See @ref overview_refcountdestruct "reference-counted object destruction" for
447 A cursor can be reused for more
448 than one window, and does not get destroyed when the window is
449 destroyed. wxWidgets destroys all cursors on application exit, although
450 it is best to clean them up explicitly.
455 Returns @true if cursor data is present.
460 Assignment operator, using @ref overview_trefcount "reference counting".
462 wxCursor
operator =(const wxCursor
& cursor
);
475 wxCursor wxNullCursor
;
486 wxCursor wxSTANDARD_CURSOR
;
491 wxCursor wxHOURGLASS_CURSOR
;
496 wxCursor wxCROSS_CURSOR
;