X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..c29c95fe24973b94fd724db767193171ca7c513d:/interface/wx/cursor.h?ds=sidebyside diff --git a/interface/wx/cursor.h b/interface/wx/cursor.h index cd0f232a8b..1a823893ce 100644 --- a/interface/wx/cursor.h +++ b/interface/wx/cursor.h @@ -3,7 +3,7 @@ // Purpose: interface of wxCursor // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -13,7 +13,7 @@ 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 + 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). @@ -26,8 +26,8 @@ The following is an example of creating a cursor from 32x32 bitmap data (down_bits) and a mask (down_mask) where 1 is black and 0 is white for the - bits, and 1 is opaque and 0 is transparent for the mask. It works on - Windows and GTK+. + bits, and 1 is opaque and 0 is transparent for the mask. + It works on Windows and GTK+. @code static char down_bits[] = { 255, 255, 255, 255, 31, @@ -63,7 +63,7 @@ down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 6); down_image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, 14); wxCursor down_cursor = wxCursor(down_image); - #else + #elif defined(__WXGTK__) or defined(__WXMOTIF__) wxCursor down_cursor = wxCursor(down_bits, 32, 32, 6, 14, down_mask, wxWHITE, wxBLACK); #endif @@ -78,77 +78,84 @@ - ::wxHOURGLASS_CURSOR - ::wxCROSS_CURSOR - @see wxBitmap, wxIcon, wxWindow::SetCursor(), wxSetCursor(), - ::wxStockCursor + @see wxBitmap, wxIcon, wxWindow::SetCursor(), wxSetCursor(), ::wxStockCursor */ -class wxCursor : public wxBitmap +class wxCursor : public wxGDIObject { public: /** Default constructor. */ wxCursor(); + /** - Constructs a cursor by passing an array of bits (Motif and GTK+ only). - @a maskBits is used only under Motif and GTK+. The parameters @a fg and - @a bg are only present on GTK+, and force the cursor to use particular - background and foreground colours. + Constructs a cursor by passing an array of bits (XBM data). + + The parameters @a fg and @a bg have an effect only on GTK+, and force + the cursor to use particular background and foreground colours. If either @a hotSpotX or @a hotSpotY is -1, the hotspot will be the centre of the cursor image (Motif only). @param bits - An array of bits. - @param maskBits - Bits for a mask bitmap. + An array of XBM data bits. @param width Cursor width. @param height Cursor height. @param hotSpotX - Hotspot x coordinate. + Hotspot x coordinate (relative to the top left of the image). @param hotSpotY - Hotspot y coordinate. + Hotspot y coordinate (relative to the top left of the image). + @param maskBits + Bits for a mask bitmap. + + @onlyfor{wxgtk,wxmotif} + + @beginWxPerlOnly + In wxPerl use Wx::Cursor->newData(bits, width, height, hotSpotX = -1, hotSpotY = -1, maskBits = 0). + @endWxPerlOnly */ wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, - const char maskBits[] = NULL, - wxColour* fg = NULL, wxColour* bg = NULL); + const char maskBits[] = NULL); + /** 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. - - @a hotSpotX and @a 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. + The arguments @a hotSpotX and @a hotSpotY are only used when there's no + hotspot info in the resource/image-file to load (e.g. when using + @c wxBITMAP_TYPE_ICO under wxMSW or @c wxBITMAP_TYPE_XPM under wxGTK). + @param cursorName + The name of the resource or the image file to load. @param type - Icon type to load. Under Motif, type defaults to wxBITMAP_TYPE_XBM. - Under Windows, it defaults to wxBITMAP_TYPE_CUR_RESOURCE. Under - MacOS, it defaults to wxBITMAP_TYPE_MACCURSOR_RESOURCE. - Under X, the permitted cursor types are: -