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