.\" This is a wxWidgets manpage page generated from the XML docs .TH wxCursor 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxCursor \- A small, transparent bitmap representing the cursor .SH DESCRIPTION A cursor is a small bitmap usually used for denoting where the mouse pointer is, with a picture that might indicate the interpretation of a mouse click. As with icons, cursors in X and MS Windows are created in a different manner. Therefore, separate cursors will be created for the different environments. Platform-specific methods for creating a wxCursor object are catered for, and this is an occasion where conditional compilation will probably be required (see wxIcon for an example). A single cursor object may be used in many windows (any subwindow type). The wxWidgets convention is to set the cursor for a window, as in X, rather than to set it globally as in MS Windows, although a global ::wxSetCursor is also available for MS Windows use. .SH "PARENTS" wxBitmap wxGDIObject wxObject .SH "INCLUDE FILES" wx/cursor.h .SH MEMBERS .SS wxCursor () Default constructor. .SS wxCursor (const char bits[]int widthint heightint hotSpotX = -1int hotSpotY = -1const char maskBits[] = NULLwxColour* fg = NULLwxColour* bg = NULL) Constructs a cursor by passing an array of bits (Motif and GTK+ only). maskBits is used only under Motif and GTK+. The parameters fg and bg are only present on GTK+, and force the cursor to use particular background and foreground colours. If either hotSpotX or hotSpotY is -1, the hotspot will be the centre of the cursor image (Motif only). .SS wxCursor (const wxString& cursorNamelong typeint hotSpotX = 0int hotSpotY = 0) Constructs a cursor by passing a string resource name or filename. On MacOS when specifying a string resource name, first the color cursors 'crsr' and then the black/white cursors 'CURS' in the resource chain are scanned through. hotSpotX and hotSpotY are currently only used under Windows when loading from an icon file, to specify the cursor hotspot relative to the top left of the image. .SS wxCursor (int cursorId) Constructs a cursor using a cursor identifier. .SS wxCursor (const wxImage& image) Constructs a cursor from a wxImage. The cursor is monochrome, colors with the RGB elements all greater than 127 will be foreground, colors less than this background. The mask (if any) will be used as transparent. In MSW the foreground will be white and the background black. If the cursor is larger than 32x32 it is resized. In GTK, the two most frequent colors will be used for foreground and background. The cursor will be displayed at the size of the image. On MacOS if the cursor is larger than 16x16 it is resized and currently only shown as black/white (mask respected). .SS wxCursor (const wxCursor& cursor) Copy constructor. This uses reference counting so is a cheap operation. .SS ~wxCursor () Destroys the cursor. A cursor can be reused for more than one window, and does not get destroyed when the window is destroyed. wxWidgets destroys all cursors on application exit, although it is best to clean them up explicitly. .SS bool Ok () Returns true if cursor data is present. .SS wxCursor& operator = (const wxCursor& cursor) Assignment operator, using reference counting. Returns a reference to `this'. .SS bool operator == (const wxCursor& cursor) Equality operator. Two cursors are equal if they contain pointers to the same underlying cursor data. It does not compare each attribute, so two independently-created cursors using the same parameters will fail the test. .SS bool operator != (const wxCursor& cursor) Inequality operator. Two cursors are not equal if they contain pointers to different underlying cursor data. It does not compare each attribute. .SH "SEE ALSO" wxBitmap wxGDIObject wxObject wxBitmap wxIcon wxWindow::SetCursor , ::wxSetCursor .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.