1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wxCursor
7 // Created: 7-July-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
20 "A cursor is a small bitmap usually used for denoting where the
21 mouse pointer is, with a picture that might indicate the
22 interpretation of a mouse click.
24 A single cursor object may be used in many windows (any subwindow
25 type). The wxWindows convention is to set the cursor for a
26 window, as in X, rather than to set it globally as in MS Windows,
27 although a global wx.SetCursor function is also available for use
31 RefDoc(wxCursor::wxCursor(int id),
35 wx.CURSOR_ARROW A standard arrow cursor.
36 wx.CURSOR_RIGHT_ARROW A standard arrow cursor pointing to the right.
37 wx.CURSOR_BLANK Transparent cursor.
38 wx.CURSOR_BULLSEYE Bullseye cursor.
39 wx.CURSOR_CHAR Rectangular character cursor.
40 wx.CURSOR_CROSS A cross cursor.
41 wx.CURSOR_HAND A hand cursor.
42 wx.CURSOR_IBEAM An I-beam cursor (vertical line).
43 wx.CURSOR_LEFT_BUTTON Represents a mouse with the left button depressed.
44 wx.CURSOR_MAGNIFIER A magnifier icon.
45 wx.CURSOR_MIDDLE_BUTTON Represents a mouse with the middle button depressed.
46 wx.CURSOR_NO_ENTRY A no-entry sign cursor.
47 wx.CURSOR_PAINT_BRUSH A paintbrush cursor.
48 wx.CURSOR_PENCIL A pencil cursor.
49 wx.CURSOR_POINT_LEFT A cursor that points left.
50 wx.CURSOR_POINT_RIGHT A cursor that points right.
51 wx.CURSOR_QUESTION_ARROW An arrow and question mark.
52 wx.CURSOR_RIGHT_BUTTON Represents a mouse with the right button depressed.
53 wx.CURSOR_SIZENESW A sizing cursor pointing NE-SW.
54 wx.CURSOR_SIZENS A sizing cursor pointing N-S.
55 wx.CURSOR_SIZENWSE A sizing cursor pointing NW-SE.
56 wx.CURSOR_SIZEWE A sizing cursor pointing W-E.
57 wx.CURSOR_SIZING A general sizing cursor.
58 wx.CURSOR_SPRAYCAN A spraycan cursor.
59 wx.CURSOR_WAIT A wait cursor.
60 wx.CURSOR_WATCH A watch cursor.
61 wx.CURSOR_ARROWWAIT A cursor with both an arrow and an hourglass, (windows.)
65 class wxCursor : public wxGDIObject
71 "Construct a Cursor from a file. Specify the type of file using\n"
72 "wx.BITAMP_TYPE* constants, and specify the hotspot if not using a\n"
75 "This cursor is not available on wxGTK, use wx.StockCursor,\n"
76 "wx.CursorFromImage, or wx.CursorFromBits instead.");
77 wxCursor(const wxString* cursorName, long type, int hotSpotX=0, int hotSpotY=0) {
79 wxCHECK_MSG(False, NULL,
80 wxT("wx.Cursor constructor not implemented for wxGTK, use wx.StockCursor, wx.CursorFromImage, or wx.CursorFromBits instead."));
82 return new wxCursor(*cursorName, type, hotSpotX, hotSpotY);
91 "Create a cursor using one of the stock cursors. Note that not\n"
92 "all cursors are available on all platforms.",
97 wxCursor(const wxImage& image),
98 "Constructs a cursor from a wxImage. The cursor is monochrome,\n"
99 "colors with the RGB elements all greater than 127 will be\n"
100 "foreground, colors less than this background. The mask (if any)\n"
101 "will be used as transparent.\n"
103 "In MSW the foreground will be white and the background black. The\n"
104 "cursor is resized to 32x32 In GTK, the two most frequent colors\n"
105 "will be used for foreground and background. The cursor will be\n"
106 "displayed at the size of the image. On MacOS the cursor is\n"
107 "resized to 16x16 and currently only shown as black/white (mask\n"
115 // %name(CursorFromBits) wxCursor(PyObject* bits, int width, int height,
116 // int hotSpotX=-1, int hotSpotY=-1,
117 // PyObject* maskBits=NULL) {
119 // char* maskbuf = NULL;
121 // PyString_AsStringAndSize(bits, &bitsbuf, &length);
123 // PyString_AsStringAndSize(maskBits, &maskbuf, &length);
124 // return new wxCursor(bitsbuf, width, height, hotSpotX, hotSpotY, maskbuf);
133 "Get the MS Windows handle for the cursor");
137 "Set the MS Windows handle to use for the cursor");
138 void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
147 %pythoncode { def __nonzero__(self): return self.Ok() }
164 void , SetWidth(int w),
168 void , SetHeight(int h),
172 void , SetDepth(int d),
176 void , SetSize(const wxSize& size),
184 //---------------------------------------------------------------------------
185 //---------------------------------------------------------------------------