]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_cursor.i
install activex too
[wxWidgets.git] / wxPython / src / _cursor.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _cursor.i
3// Purpose: SWIG interface for wxCursor
4//
5// Author: Robin Dunn
6//
7// Created: 7-July-1997
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17
4c42683a
RD
18
19DocStr(wxCursor,
20"A cursor is a small bitmap usually used for denoting where the
21mouse pointer is, with a picture that might indicate the
22interpretation of a mouse click.
23
24A single cursor object may be used in many windows (any subwindow
25type). The wxWindows convention is to set the cursor for a
26window, as in X, rather than to set it globally as in MS Windows,
27although a global wx.SetCursor function is also available for use
28on MS Windows.");
29
30
31RefDoc(wxCursor::wxCursor(int id),
32"
33 Stock Cursor IDs
34
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.)
62
63");
64
d14a1e28
RD
65class wxCursor : public wxGDIObject
66{
67public:
4c42683a 68
e029dde7
RD
69 RefDoc(wxCursor, ""); // turn it off for the ctors
70
d14a1e28 71 %extend {
4c42683a
RD
72 DocStr(wxCursor,
73 "Construct a Cursor from a file. Specify the type of file using\n"
74 "wx.BITAMP_TYPE* constants, and specify the hotspot if not using a\n"
75 ".cur file.\n"
76 "\n"
77 "This cursor is not available on wxGTK, use wx.StockCursor,\n"
78 "wx.CursorFromImage, or wx.CursorFromBits instead.");
79 wxCursor(const wxString* cursorName, long type, int hotSpotX=0, int hotSpotY=0) {
80%#ifdef __WXGTK__
dd9f7fea 81 wxCHECK_MSG(False, NULL,
4c42683a
RD
82 wxT("wx.Cursor constructor not implemented for wxGTK, use wx.StockCursor, wx.CursorFromImage, or wx.CursorFromBits instead."));
83%#else
1cee36ad 84 return new wxCursor(*cursorName, type, hotSpotX, hotSpotY);
4c42683a 85%#endif
d14a1e28
RD
86 }
87 }
88
89 ~wxCursor();
90
4c42683a
RD
91 DocCtorStrName(
92 wxCursor(int id),
93 "Create a cursor using one of the stock cursors. Note that not\n"
94 "all cursors are available on all platforms.",
95 StockCursor);
96
97
98 DocCtorStrName(
99 wxCursor(const wxImage& image),
100 "Constructs a cursor from a wxImage. The cursor is monochrome,\n"
101 "colors with the RGB elements all greater than 127 will be\n"
102 "foreground, colors less than this background. The mask (if any)\n"
103 "will be used as transparent.\n"
104 "\n"
105 "In MSW the foreground will be white and the background black. The\n"
106 "cursor is resized to 32x32 In GTK, the two most frequent colors\n"
107 "will be used for foreground and background. The cursor will be\n"
108 "displayed at the size of the image. On MacOS the cursor is\n"
109 "resized to 16x16 and currently only shown as black/white (mask\n"
110 "respected).",
111 CursorFromImage);
112
113
114// %extend {
115// DocStr(wxCursor,
116// "");
117// %name(CursorFromBits) wxCursor(PyObject* bits, int width, int height,
118// int hotSpotX=-1, int hotSpotY=-1,
119// PyObject* maskBits=NULL) {
120// char* bitsbuf;
121// char* maskbuf = NULL;
122// int length;
123// PyString_AsStringAndSize(bits, &bitsbuf, &length);
124// if (maskBits)
125// PyString_AsStringAndSize(maskBits, &maskbuf, &length);
126// return new wxCursor(bitsbuf, width, height, hotSpotX, hotSpotY, maskbuf);
127// }
128// }
129
130
d14a1e28 131
d14a1e28 132#ifdef __WXMSW__
4c42683a
RD
133 DocDeclStr(
134 long , GetHandle(),
135 "Get the MS Windows handle for the cursor");
136
a0c956e8
RD
137 %extend {
138 DocStr(SetHandle,
139 "Set the MS Windows handle to use for the cursor");
140 void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
141 }
4c42683a 142
d14a1e28
RD
143#endif
144
4c42683a
RD
145 DocDeclStr(
146 bool , Ok(),
147 "");
148
149 %pythoncode { def __nonzero__(self): return self.Ok() }
150
d14a1e28
RD
151
152#ifdef __WXMSW__
4c42683a
RD
153 DocDeclStr(
154 int , GetWidth(),
155 "");
156
157 DocDeclStr(
158 int , GetHeight(),
159 "");
160
161 DocDeclStr(
162 int , GetDepth(),
163 "");
164
165 DocDeclStr(
166 void , SetWidth(int w),
167 "");
168
169 DocDeclStr(
170 void , SetHeight(int h),
171 "");
172
173 DocDeclStr(
174 void , SetDepth(int d),
175 "");
176
177 DocDeclStr(
178 void , SetSize(const wxSize& size),
179 "");
180
d14a1e28
RD
181#endif
182
d14a1e28
RD
183};
184
185
186//---------------------------------------------------------------------------
187//---------------------------------------------------------------------------