]> git.saurik.com Git - wxWidgets.git/blob - interface/cursor.h
add const qualifiers
[wxWidgets.git] / interface / cursor.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cursor.h
3 // Purpose: documentation for wxCursor class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxCursor
11 @wxheader{cursor.h}
12
13 A cursor is a small bitmap usually used for denoting where the mouse
14 pointer is, with a picture that might indicate the interpretation of a
15 mouse click. As with icons, cursors in X and MS Windows are created
16 in a different manner. Therefore, separate cursors will be created for the
17 different environments. Platform-specific methods for creating a @b wxCursor
18 object are catered for, and this is an occasion where
19 conditional compilation will probably be required (see wxIcon for
20 an example).
21
22 A single cursor object may be used in many windows (any subwindow type).
23 The wxWidgets convention is to set the cursor for a window, as in X,
24 rather than to set it globally as in MS Windows, although a
25 global ::wxSetCursor is also available for MS Windows use.
26
27 @library{wxcore}
28 @category{gdi}
29
30 @stdobjects
31 Objects:
32 wxNullCursor
33 Pointers:
34 wxSTANDARD_CURSOR
35
36 wxHOURGLASS_CURSOR
37
38 wxCROSS_CURSOR
39
40 @seealso
41 wxBitmap, wxIcon, wxWindow::SetCursor, ::wxSetCursor
42 */
43 class wxCursor : public wxBitmap
44 {
45 public:
46 //@{
47 /**
48 Copy constructor, uses @ref overview_trefcount "reference counting".
49
50 @param bits
51 An array of bits.
52 @param maskBits
53 Bits for a mask bitmap.
54 @param width
55 Cursor width.
56 @param height
57 Cursor height.
58 @param hotSpotX
59 Hotspot x coordinate.
60 @param hotSpotY
61 Hotspot y coordinate.
62 @param type
63 Icon type to load. Under Motif, type defaults to wxBITMAP_TYPE_XBM. Under
64 Windows,
65 it defaults to wxBITMAP_TYPE_CUR_RESOURCE. Under MacOS, it defaults to
66 wxBITMAP_TYPE_MACCURSOR_RESOURCE.
67 Under X, the permitted cursor types are:
68
69
70
71
72
73
74
75 wxBITMAP_TYPE_XBM
76
77
78
79
80 Load an X bitmap file.
81
82
83
84
85
86 Under Windows, the permitted types are:
87
88
89
90
91
92
93
94 wxBITMAP_TYPE_CUR
95
96
97
98
99 Load a cursor from a .cur cursor file (only if USE_RESOURCE_LOADING_IN_MSW
100 is enabled in setup.h).
101
102
103
104
105
106 wxBITMAP_TYPE_CUR_RESOURCE
107
108
109
110
111 Load a Windows resource (as specified in the .rc file).
112
113
114
115
116
117 wxBITMAP_TYPE_ICO
118
119
120
121
122 Load a cursor from a .ico icon file (only if USE_RESOURCE_LOADING_IN_MSW
123 is enabled in setup.h). Specify hotSpotX and hotSpotY.
124 @param cursorId
125 A stock cursor identifier. May be one of:
126
127
128
129
130
131
132
133 wxCURSOR_ARROW
134
135
136
137
138 A standard arrow cursor.
139
140
141
142
143
144 wxCURSOR_RIGHT_ARROW
145
146
147
148
149 A standard arrow cursor
150 pointing to the right.
151
152
153
154
155
156 wxCURSOR_BLANK
157
158
159
160
161 Transparent cursor.
162
163
164
165
166
167 wxCURSOR_BULLSEYE
168
169
170
171
172 Bullseye cursor.
173
174
175
176
177
178 wxCURSOR_CHAR
179
180
181
182
183 Rectangular character cursor.
184
185
186
187
188
189 wxCURSOR_CROSS
190
191
192
193
194 A cross cursor.
195
196
197
198
199
200 wxCURSOR_HAND
201
202
203
204
205 A hand cursor.
206
207
208
209
210
211 wxCURSOR_IBEAM
212
213
214
215
216 An I-beam cursor (vertical line).
217
218
219
220
221
222 wxCURSOR_LEFT_BUTTON
223
224
225
226
227 Represents a mouse with the left button depressed.
228
229
230
231
232
233 wxCURSOR_MAGNIFIER
234
235
236
237
238 A magnifier icon.
239
240
241
242
243
244 wxCURSOR_MIDDLE_BUTTON
245
246
247
248
249 Represents a mouse with the middle button depressed.
250
251
252
253
254
255 wxCURSOR_NO_ENTRY
256
257
258
259
260 A no-entry sign cursor.
261
262
263
264
265
266 wxCURSOR_PAINT_BRUSH
267
268
269
270
271 A paintbrush cursor.
272
273
274
275
276
277 wxCURSOR_PENCIL
278
279
280
281
282 A pencil cursor.
283
284
285
286
287
288 wxCURSOR_POINT_LEFT
289
290
291
292
293 A cursor that points left.
294
295
296
297
298
299 wxCURSOR_POINT_RIGHT
300
301
302
303
304 A cursor that points right.
305
306
307
308
309
310 wxCURSOR_QUESTION_ARROW
311
312
313
314
315 An arrow and question mark.
316
317
318
319
320
321 wxCURSOR_RIGHT_BUTTON
322
323
324
325
326 Represents a mouse with the right button depressed.
327
328
329
330
331
332 wxCURSOR_SIZENESW
333
334
335
336
337 A sizing cursor pointing NE-SW.
338
339
340
341
342
343 wxCURSOR_SIZENS
344
345
346
347
348 A sizing cursor pointing N-S.
349
350
351
352
353
354 wxCURSOR_SIZENWSE
355
356
357
358
359 A sizing cursor pointing NW-SE.
360
361
362
363
364
365 wxCURSOR_SIZEWE
366
367
368
369
370 A sizing cursor pointing W-E.
371
372
373
374
375
376 wxCURSOR_SIZING
377
378
379
380
381 A general sizing cursor.
382
383
384
385
386
387 wxCURSOR_SPRAYCAN
388
389
390
391
392 A spraycan cursor.
393
394
395
396
397
398 wxCURSOR_WAIT
399
400
401
402
403 A wait cursor.
404
405
406
407
408
409 wxCURSOR_WATCH
410
411
412
413
414 A watch cursor.
415
416
417
418
419
420 wxCURSOR_ARROWWAIT
421
422
423
424
425 A cursor with both an arrow and
426 an hourglass, (windows.)
427
428
429
430
431
432 Note that not all cursors are available on all platforms.
433 @param cursor
434 Pointer or reference to a cursor to copy.
435 */
436 wxCursor();
437 wxCursor(const char bits[], int width, int height,
438 int hotSpotX = -1, int hotSpotY = -1,
439 const char maskBits[] = NULL,
440 wxColour* fg = NULL,
441 wxColour* bg = NULL);
442 wxCursor(const wxString& cursorName, long type,
443 int hotSpotX = 0, int hotSpotY = 0);
444 wxCursor(int cursorId);
445 wxCursor(const wxImage& image);
446 wxCursor(const wxCursor& cursor);
447 //@}
448
449 /**
450 Destroys the cursor.
451 See @ref overview_refcountdestruct "reference-counted object destruction" for
452 more info.
453 A cursor can be reused for more
454 than one window, and does not get destroyed when the window is
455 destroyed. wxWidgets destroys all cursors on application exit, although
456 it is best to clean them up explicitly.
457 */
458 ~wxCursor();
459
460 /**
461 Returns @true if cursor data is present.
462 */
463 bool IsOk() const;
464
465 /**
466 Assignment operator, using @ref overview_trefcount "reference counting".
467 */
468 wxCursor operator =(const wxCursor& cursor);
469 };