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