]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: defs.h | |
3 | // Purpose: Declarations/definitions common to all wx source files | |
4 | // Author: Julian Smart and others | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_DEFS_H_ | |
13 | #define _WX_DEFS_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "defs.h" | |
17 | #endif | |
18 | ||
19 | #include <stddef.h> | |
20 | ||
21 | #include "wx/setup.h" | |
22 | #include "wx/version.h" | |
23 | ||
24 | // ---------------------------------------------------------------------------- | |
25 | // compiler and OS identification | |
26 | // ---------------------------------------------------------------------------- | |
27 | ||
28 | // OS | |
29 | #if defined(__HPUX__) || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi ) || defined(__unix__) | |
30 | #ifndef __UNIX__ | |
31 | #define __UNIX__ | |
32 | #endif // Unix | |
33 | ||
34 | // Helps SGI compilation, apparently | |
35 | #ifdef __SGI__ | |
36 | #ifdef __GNUG__ | |
37 | #define __need_wchar_t | |
38 | #else // !gcc | |
39 | // Note I use the term __SGI_CC__ for both cc and CC, its not a good | |
40 | // idea to mix gcc and cc/CC, the name mangling is different | |
41 | #define __SGI_CC__ | |
42 | #endif // gcc/!gcc | |
43 | #endif // SGI | |
44 | ||
45 | #if defined(sun) || defined(__SUN__) | |
46 | #ifndef __GNUG__ | |
47 | #ifndef __SUNCC__ | |
48 | #define __SUNCC__ | |
49 | #endif // Sun CC | |
50 | #endif | |
51 | #endif // Sun | |
52 | #else // Windows | |
53 | #ifndef __WINDOWS__ | |
54 | #define __WINDOWS__ | |
55 | #endif // Windows | |
56 | ||
57 | // define another standard symbol for Microsoft Visual C++: the standard one | |
58 | // (_MSC_VER) is also defined by Metrowerks compiler | |
59 | #if defined(_MSC_VER) && !defined(__MWERKS__) | |
60 | #define __VISUALC__ | |
61 | #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__) | |
62 | #define __BORLANDC__ | |
63 | #elif defined(__WATCOMC__) | |
64 | //#define __WATCOMC__ | |
65 | #elif defined(__SC__) | |
66 | #define __SYMANTECC__ | |
67 | #endif // compiler | |
68 | #endif // OS | |
69 | ||
70 | // suppress some Visual C++ warnings | |
71 | #ifdef __VISUALC__ | |
72 | # pragma warning(disable:4244) // cobversion from double to float | |
73 | # pragma warning(disable:4100) // unreferenced formal parameter | |
74 | #endif | |
75 | ||
76 | // suppress some Salford C++ warnings | |
77 | #ifdef __SALFORDC__ | |
78 | # pragma suppress 353 // Possible nested comments | |
79 | # pragma suppress 593 // Define not used | |
80 | # pragma suppress 61 // enum has no name (doesn't suppress!) | |
81 | # pragma suppress 106 // unnamed, unused parameter | |
82 | # pragma suppress 571 // Virtual function hiding | |
83 | #endif | |
84 | ||
85 | ////////////////////////////////////////////////////////////////////////////////// | |
86 | // Currently Only MS-Windows/NT, XView and Motif are supported | |
87 | // | |
88 | #if defined(__HPUX__) && !defined(__WXMOTIF__) | |
89 | # define __WXMOTIF__ | |
90 | #endif | |
91 | #if defined(__WXMOTIF__) | |
92 | # define __X__ | |
93 | #endif | |
94 | ||
95 | #ifdef __WXMSW__ | |
96 | // wxWindows checks for WIN32, not __WIN32__ | |
97 | #if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__) && !defined(__WXSTUBS__)) | |
98 | #define __WIN32__ | |
99 | #endif | |
100 | ||
101 | #ifndef __WIN32__ | |
102 | #define __WIN16__ | |
103 | #endif | |
104 | ||
105 | #if !defined(__WIN95__) && (WINVER >= 0x0400) | |
106 | #define __WIN95__ | |
107 | #endif | |
108 | ||
109 | #if defined(TWIN32) && !defined(__TWIN32__) | |
110 | #define __TWIN32__ | |
111 | #endif | |
112 | ||
113 | #endif // wxMSW | |
114 | ||
115 | // Make sure the environment is set correctly | |
116 | #if defined(__WXMSW__) && defined(__X__) | |
117 | # error "Target can't be both X and Windows" | |
118 | #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \ | |
119 | !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__) | |
120 | #error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]" | |
121 | #endif | |
122 | ||
123 | #if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__) | |
124 | ||
125 | // Bool is now obsolete, use bool instead | |
126 | // typedef int Bool; | |
127 | ||
128 | #ifndef TRUE | |
129 | # define TRUE 1 | |
130 | # define FALSE 0 | |
131 | # define Bool_DEFINED | |
132 | #endif | |
133 | ||
134 | #elif defined(__WXMSW__) | |
135 | ||
136 | #ifndef TRUE | |
137 | # define TRUE 1 | |
138 | # define FALSE 0 | |
139 | #endif | |
140 | ||
141 | #endif | |
142 | ||
143 | // VC++ 4.0 is 1000. | |
144 | ||
145 | // Add more tests here for compilers that don't already define bool. | |
146 | #if defined( __MWERKS__ ) | |
147 | #if (__MWERKS__ < 0x1000) || !__option(bool) | |
148 | typedef unsigned int bool; | |
149 | #endif | |
150 | #elif defined(__SC__) | |
151 | typedef unsigned int bool; | |
152 | #elif defined(__SALFORDC__) | |
153 | typedef unsigned int bool; | |
154 | #elif defined(__VISUALC__) && (__VISUALC__ <= 1000) | |
155 | typedef unsigned int bool; | |
156 | #elif defined(__VISUALC__) && (__VISUALC__ == 1020) | |
157 | #define bool unsigned int | |
158 | #elif defined(__BORLANDC__) && (__BORLANDC__ < 0x500) | |
159 | typedef unsigned int bool; | |
160 | #elif defined(__WATCOMC__) | |
161 | typedef unsigned int bool; | |
162 | #elif defined(__SUNCC__) | |
163 | #ifdef __SUNPRO_CC | |
164 | // starting from version 5.0 Sun CC understands 'bool' | |
165 | #if __SUNPRO_CC <= 0x0420 | |
166 | // If we use int, we get identically overloaded functions in config.cpp | |
167 | typedef unsigned char bool; | |
168 | #endif // Sun CC version | |
169 | #else | |
170 | #error "Unknown compiler: only Sun's CC and gcc are currently recognised." | |
171 | #endif // Sun CC | |
172 | #endif | |
173 | ||
174 | #if ( defined(__VISUALC__) && (__VISUALC__ <= 800) ) || defined(__GNUWIN32__) || (defined(__BORLANDC__) && defined(__WIN16__)) || defined(__SC__) || defined(__SALFORDC__) | |
175 | // Not a good idea, because later system files (e.g. windows.h) | |
176 | // may try to define it. Use wxByte instead. | |
177 | // #define byte unsigned char | |
178 | #endif | |
179 | ||
180 | typedef unsigned char wxByte; | |
181 | typedef short int WXTYPE; | |
182 | typedef int wxWindowID; | |
183 | ||
184 | // Macro to cut down on compiler warnings. | |
185 | #if REMOVE_UNUSED_ARG | |
186 | #define WXUNUSED(identifier) /* identifier */ | |
187 | #else // stupid, broken compiler | |
188 | #define WXUNUSED(identifier) identifier | |
189 | #endif | |
190 | ||
191 | /* | |
192 | * Making or using wxWindows as a Windows DLL | |
193 | */ | |
194 | ||
195 | #ifdef __WXMSW__ | |
196 | ||
197 | #ifdef __BORLANDC__ | |
198 | ||
199 | # ifdef WXMAKINGDLL | |
200 | # define WXDLLEXPORT __export | |
201 | # define WXDLLEXPORT_DATA(type) type __export | |
202 | # define WXDLLEXPORT_CTORFN __export | |
203 | # elif defined(WXUSINGDLL) | |
204 | # define WXDLLEXPORT __import | |
205 | # define WXDLLEXPORT_DATA(type) type __import | |
206 | # define WXDLLEXPORT_CTORFN | |
207 | # else | |
208 | # define WXDLLEXPORT | |
209 | # define WXDLLEXPORT_DATA(type) type | |
210 | # define WXDLLEXPORT_CTORFN | |
211 | # endif | |
212 | ||
213 | #else | |
214 | ||
215 | # ifdef WXMAKINGDLL | |
216 | # define WXDLLEXPORT __declspec( dllexport ) | |
217 | # define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type | |
218 | # define WXDLLEXPORT_CTORFN // __declspec( dllexport ) | |
219 | # elif defined(WXUSINGDLL) | |
220 | # define WXDLLEXPORT __declspec( dllimport ) | |
221 | # define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type | |
222 | # define WXDLLEXPORT_CTORFN | |
223 | # else | |
224 | # define WXDLLEXPORT | |
225 | # define WXDLLEXPORT_DATA(type) type | |
226 | # define WXDLLEXPORT_CTORFN | |
227 | # endif | |
228 | ||
229 | #endif | |
230 | ||
231 | #else | |
232 | // Non-Windows | |
233 | # define WXDLLEXPORT | |
234 | # define WXDLLEXPORT_DATA(type) type | |
235 | # define WXDLLEXPORT_CTORFN | |
236 | #endif | |
237 | ||
238 | // For ostream, istream ofstream | |
239 | #if defined(__BORLANDC__) && defined( _RTLDLL ) | |
240 | # define WXDLLIMPORT __import | |
241 | #else | |
242 | # define WXDLLIMPORT | |
243 | #endif | |
244 | ||
245 | class WXDLLEXPORT wxObject; | |
246 | class WXDLLEXPORT wxEvent; | |
247 | ||
248 | /** symbolic constant used by all Find()-like functions returning positive | |
249 | integer on success as failure indicator */ | |
250 | #define wxNOT_FOUND (-1) | |
251 | ||
252 | // ---------------------------------------------------------------------------- | |
253 | // Error codes | |
254 | // ---------------------------------------------------------------------------- | |
255 | ||
256 | #ifdef ERR_PARAM | |
257 | #undef ERR_PARAM | |
258 | #endif | |
259 | ||
260 | /// Standard error codes | |
261 | enum ErrCode | |
262 | { | |
263 | /// invalid parameter (in broad sense) | |
264 | ERR_PARAM = (-4000), | |
265 | /// no more data (iteration functions usually return this) | |
266 | ERR_NODATA, | |
267 | /// user cancelled the operation | |
268 | ERR_CANCEL, | |
269 | /// no error (the only non negative error code) | |
270 | ERR_SUCCESS = 0 | |
271 | }; | |
272 | ||
273 | // ---------------------------------------------------------------------------- | |
274 | /** @name Very common macros */ | |
275 | // ---------------------------------------------------------------------------- | |
276 | //@{ | |
277 | /// delete pointer if it is not NULL and NULL it afterwards | |
278 | // (checking that it's !NULL before passing it to delete is just a | |
279 | // a question of style, because delete will do it itself anyhow, but it might | |
280 | // be considered as an error by some overzealous debugging implementations of | |
281 | // the library, so we do it ourselves) | |
282 | #if defined(__SGI_CC__) | |
283 | // Okay this is bad styling, but the native SGI compiler is very picky, it | |
284 | // wont let you compare/assign between a NULL (void *) and another pointer | |
285 | // type. To be really clean we'd need to pass in another argument, the type | |
286 | // of p. | |
287 | // Also note the use of 0L, this would allow future possible 64bit support | |
288 | // (as yet untested) by ensuring that we zero all the bits in a pointer | |
289 | // (which is always the same length as a long (at least with the LP64 standard) | |
290 | // --- offer aug 98 | |
291 | #define wxDELETE(p) if ( (p) ) { delete (p); p = 0L; } | |
292 | #else | |
293 | #define wxDELETE(p) if ( (p) != NULL ) { delete p; p = NULL; } | |
294 | #endif /* __SGI__CC__ */ | |
295 | ||
296 | // delete an array and NULL it (see comments above) | |
297 | #if defined(__SGI_CC__) | |
298 | // see above comment. | |
299 | #define wxDELETEA(p) if ( (p) ) { delete [] (p); p = 0L; } | |
300 | #else | |
301 | #define wxDELETEA(p) if ( ((void *) (p)) != NULL ) { delete [] p; p = NULL; } | |
302 | #endif /* __SGI__CC__ */ | |
303 | ||
304 | /// size of statically declared array | |
305 | #define WXSIZEOF(array) (sizeof(array)/sizeof(array[0])) | |
306 | ||
307 | // Use of these suppresses some compiler warnings | |
308 | WXDLLEXPORT_DATA(extern const bool) wxTrue; | |
309 | WXDLLEXPORT_DATA(extern const bool) wxFalse; | |
310 | ||
311 | // ---------------------------------------------------------------------------- | |
312 | // compiler specific settings | |
313 | // ---------------------------------------------------------------------------- | |
314 | ||
315 | // to allow compiling with warning level 4 under Microsoft Visual C++ some | |
316 | // warnings just must be disabled | |
317 | #ifdef __VISUALC__ | |
318 | #pragma warning(disable: 4514) // unreferenced inline func has been removed | |
319 | /* | |
320 | you might be tempted to disable this one also: triggered by CHECK and FAIL | |
321 | macros in debug.h, but it's, overall, a rather useful one, so I leave it and | |
322 | will try to find some way to disable this warning just for CHECK/FAIL. Anyone? | |
323 | */ | |
324 | #pragma warning(disable: 4127) // conditional expression is constant | |
325 | #endif // VC++ | |
326 | ||
327 | #if defined(__MWERKS__) | |
328 | #undef try | |
329 | #undef except | |
330 | #undef finally | |
331 | #define except(x) catch(...) | |
332 | #endif // Metrowerks | |
333 | ||
334 | // where should i put this? we need to make sure of this as it breaks | |
335 | // the <iostream> code. | |
336 | #if !wxUSE_IOSTREAMH && defined(__WXDEBUG__) | |
337 | #ifndef __MWERKS__ | |
338 | #undef __WXDEBUG__ | |
339 | #endif | |
340 | #endif | |
341 | ||
342 | // Callback function type definition | |
343 | typedef void (*wxFunction) (wxObject&, wxEvent&); | |
344 | ||
345 | /* | |
346 | * Window style flags. | |
347 | * Values are chosen so they can be |'ed in a bit list. | |
348 | * Some styles are used across more than one group, | |
349 | * so the values mustn't clash with others in the group. | |
350 | * Otherwise, numbers can be reused across groups. | |
351 | * | |
352 | * From version 1.66: | |
353 | * Window (cross-group) styles now take up the first half | |
354 | * of the flag, and control-specific styles the | |
355 | * second half. | |
356 | * | |
357 | */ | |
358 | ||
359 | /* | |
360 | * Window (Frame/dialog/subwindow/panel item) style flags | |
361 | */ | |
362 | #define wxVSCROLL 0x80000000 | |
363 | #define wxHSCROLL 0x40000000 | |
364 | #define wxCAPTION 0x20000000 | |
365 | ||
366 | // New styles | |
367 | #define wxDOUBLE_BORDER 0x10000000 | |
368 | #define wxSUNKEN_BORDER 0x08000000 | |
369 | #define wxRAISED_BORDER 0x04000000 | |
370 | #define wxBORDER 0x02000000 | |
371 | #define wxSIMPLE_BORDER 0x02000000 | |
372 | #define wxSTATIC_BORDER 0x01000000 | |
373 | #define wxTRANSPARENT_WINDOW 0x00100000 | |
374 | #define wxNO_BORDER 0x00200000 | |
375 | ||
376 | #define wxUSER_COLOURS 0x00800000 | |
377 | // Override CTL3D etc. control colour processing to | |
378 | // allow own background colour | |
379 | // OBSOLETE - use wxNO_3D instead | |
380 | #define wxNO_3D 0x00800000 | |
381 | // Override CTL3D or native 3D styles for children | |
382 | #define wxCLIP_CHILDREN 0x00400000 | |
383 | // Clip children when painting, which reduces flicker in | |
384 | // e.g. frames and splitter windows, but can't be used in | |
385 | // a panel where a static box must be 'transparent' (panel | |
386 | // paints the background for it) | |
387 | ||
388 | // Add this style to a panel to get tab traversal working | |
389 | // outside of dialogs. | |
390 | #define wxTAB_TRAVERSAL 0x00080000 | |
391 | ||
392 | // Orientations | |
393 | #define wxHORIZONTAL 0x01 | |
394 | #define wxVERTICAL 0x02 | |
395 | #define wxBOTH (wxVERTICAL|wxHORIZONTAL) | |
396 | #define wxCENTER_FRAME 0x04 /* centering into frame rather than screen */ | |
397 | ||
398 | /* | |
399 | * Frame/dialog style flags | |
400 | */ | |
401 | #define wxSTAY_ON_TOP 0x8000 | |
402 | #define wxICONIZE 0x4000 | |
403 | #define wxMINIMIZE wxICONIZE | |
404 | #define wxMAXIMIZE 0x2000 | |
405 | #define wxTHICK_FRAME 0x1000 | |
406 | #define wxSYSTEM_MENU 0x0800 | |
407 | #define wxMINIMIZE_BOX 0x0400 | |
408 | #define wxMAXIMIZE_BOX 0x0200 | |
409 | #define wxTINY_CAPTION_HORIZ 0x0100 | |
410 | #define wxTINY_CAPTION_VERT 0x0080 | |
411 | #define wxRESIZE_BOX wxMAXIMIZE_BOX | |
412 | #define wxRESIZE_BORDER 0x0040 | |
413 | #define wxDIALOG_MODAL 0x0020 | |
414 | #define wxDIALOG_MODELESS 0x0000 | |
415 | ||
416 | #define wxDEFAULT_FRAME_STYLE (wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN) | |
417 | ||
418 | #if WXWIN_COMPATIBILITY | |
419 | #define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE | |
420 | #endif | |
421 | ||
422 | #define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME) | |
423 | ||
424 | /* | |
425 | * Subwindow style flags | |
426 | */ | |
427 | #define wxRETAINED 0x0001 | |
428 | #define wxBACKINGSTORE wxRETAINED | |
429 | // wxCanvas or wxPanel can optionally have a thick frame under MS Windows. | |
430 | // #define wxTHICK_FRAME 0x1000 | |
431 | ||
432 | /* | |
433 | * wxToolBar style flags | |
434 | */ | |
435 | ||
436 | #define wxTB_3DBUTTONS 0x8000 | |
437 | #define wxTB_HORIZONTAL 0x0002 | |
438 | #define wxTB_VERTICAL 0x0004 | |
439 | // Flatbar/Coolbar under Win98 | |
440 | #define wxTB_FLAT 0x0008 | |
441 | ||
442 | /* | |
443 | * Apply to all panel items | |
444 | */ | |
445 | ||
446 | #define wxCOLOURED 0x0800 | |
447 | // Alignment for panel item labels: replaces characters with zeros | |
448 | // when creating label, so spaces can be included in string for alignment. | |
449 | #define wxFIXED_LENGTH 0x0400 | |
450 | #define wxALIGN_LEFT 0x0000 | |
451 | #define wxALIGN_CENTER 0x0100 | |
452 | #define wxALIGN_CENTRE 0x0100 | |
453 | #define wxALIGN_RIGHT 0x0200 | |
454 | ||
455 | /* | |
456 | * Styles for wxListBox | |
457 | */ | |
458 | ||
459 | #define wxLB_SORT 0x0010 | |
460 | #define wxLB_SINGLE 0x0020 | |
461 | #define wxLB_MULTIPLE 0x0040 | |
462 | #define wxLB_EXTENDED 0x0080 | |
463 | // wxLB_OWNERDRAW is Windows-only | |
464 | #define wxLB_OWNERDRAW 0x0100 | |
465 | #define wxLB_NEEDED_SB 0x0200 | |
466 | #define wxLB_ALWAYS_SB 0x0400 | |
467 | #define wxLB_HSCROLL wxHSCROLL | |
468 | ||
469 | /* | |
470 | * wxTextCtrl style flags | |
471 | */ | |
472 | #define wxPROCESS_ENTER 0x0004 | |
473 | #define wxPASSWORD 0x0008 | |
474 | #define wxTE_PROCESS_ENTER wxPROCESS_ENTER | |
475 | #define wxTE_PASSWORD wxPASSWORD | |
476 | #define wxTE_READONLY 0x0010 | |
477 | #define wxTE_MULTILINE 0x0020 | |
478 | #define wxTE_PROCESS_TAB 0x0040 | |
479 | ||
480 | /* | |
481 | * wxComboBox style flags | |
482 | */ | |
483 | #define wxCB_SIMPLE 0x0004 | |
484 | #define wxCB_SORT 0x0008 | |
485 | #define wxCB_READONLY 0x0010 | |
486 | #define wxCB_DROPDOWN 0x0020 | |
487 | ||
488 | /* | |
489 | * wxRadioBox/wxRadioButton style flags | |
490 | */ | |
491 | ||
492 | // New, more intuitive names to specify majorDim argument | |
493 | ||
494 | // Same as wxRA_HORIZONTAL | |
495 | #define wxRA_SPECIFY_COLS 0x0001 | |
496 | // Same as wxRA_VERTICAL | |
497 | #define wxRA_SPECIFY_ROWS 0x0002 | |
498 | ||
499 | // Old names for compatibility | |
500 | #define wxRA_HORIZONTAL wxHORIZONTAL | |
501 | #define wxRA_VERTICAL wxVERTICAL | |
502 | #define wxRB_GROUP 0x0004 | |
503 | ||
504 | /* | |
505 | * wxGauge flags | |
506 | */ | |
507 | #define wxGA_PROGRESSBAR 0x0004 | |
508 | #define wxGA_HORIZONTAL wxHORIZONTAL | |
509 | #define wxGA_VERTICAL wxVERTICAL | |
510 | ||
511 | /* | |
512 | * wxSlider flags | |
513 | */ | |
514 | ||
515 | #define wxSL_HORIZONTAL wxHORIZONTAL | |
516 | #define wxSL_VERTICAL wxVERTICAL | |
517 | // The next one is obsolete - use scroll events instead | |
518 | #define wxSL_NOTIFY_DRAG 0x0000 | |
519 | #define wxSL_AUTOTICKS 0x0008 | |
520 | // #define wxSL_MANUALTICKS 0x0010 | |
521 | #define wxSL_LABELS 0x0020 | |
522 | #define wxSL_LEFT 0x0040 | |
523 | #define wxSL_TOP 0x0080 | |
524 | #define wxSL_RIGHT 0x0100 | |
525 | #define wxSL_BOTTOM 0x0200 | |
526 | #define wxSL_BOTH 0x0400 | |
527 | #define wxSL_SELRANGE 0x0800 | |
528 | ||
529 | /* | |
530 | * wxScrollBar flags | |
531 | */ | |
532 | ||
533 | #define wxSB_HORIZONTAL wxHORIZONTAL | |
534 | #define wxSB_VERTICAL wxVERTICAL | |
535 | ||
536 | /* | |
537 | * wxButton flags | |
538 | */ | |
539 | ||
540 | #define wxBU_AUTODRAW 0x0004 | |
541 | #define wxBU_NOAUTODRAW 0x0000 | |
542 | ||
543 | /* | |
544 | * wxTreeCtrl flags | |
545 | */ | |
546 | ||
547 | #define wxTR_HAS_BUTTONS 0x0004 | |
548 | #define wxTR_EDIT_LABELS 0x0008 | |
549 | #define wxTR_LINES_AT_ROOT 0x0010 | |
550 | ||
551 | /* | |
552 | * wxListCtrl flags | |
553 | */ | |
554 | ||
555 | #define wxLC_ICON 0x0004 | |
556 | #define wxLC_SMALL_ICON 0x0008 | |
557 | #define wxLC_LIST 0x0010 | |
558 | #define wxLC_REPORT 0x0020 | |
559 | #define wxLC_ALIGN_TOP 0x0040 | |
560 | #define wxLC_ALIGN_LEFT 0x0080 | |
561 | #define wxLC_AUTOARRANGE 0x0100 | |
562 | #define wxLC_USER_TEXT 0x0200 | |
563 | #define wxLC_EDIT_LABELS 0x0400 | |
564 | #define wxLC_NO_HEADER 0x0800 | |
565 | #define wxLC_NO_SORT_HEADER 0x1000 | |
566 | #define wxLC_SINGLE_SEL 0x2000 | |
567 | #define wxLC_SORT_ASCENDING 0x4000 | |
568 | #define wxLC_SORT_DESCENDING 0x8000 | |
569 | ||
570 | #define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT) | |
571 | #define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT) | |
572 | #define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING) | |
573 | ||
574 | // Omitted because (a) too much detail (b) not enough style flags | |
575 | // #define wxLC_NO_SCROLL | |
576 | // #define wxLC_NO_LABEL_WRAP | |
577 | // #define wxLC_OWNERDRAW_FIXED | |
578 | // #define wxLC_SHOW_SEL_ALWAYS | |
579 | ||
580 | /* | |
581 | * wxSpinButton flags | |
582 | */ | |
583 | ||
584 | #define wxSP_VERTICAL 0x0004 | |
585 | #define wxSP_HORIZONTAL 0x0008 | |
586 | #define wxSP_ARROW_KEYS 0x0010 | |
587 | #define wxSP_WRAP 0x0020 | |
588 | ||
589 | /* | |
590 | * wxSplitterWindow flags | |
591 | */ | |
592 | ||
593 | #define wxSP_NOBORDER 0x0000 | |
594 | #define wxSP_3D 0x0004 | |
595 | #define wxSP_BORDER 0x0008 | |
596 | ||
597 | /* | |
598 | * wxFrame extra flags | |
599 | */ | |
600 | ||
601 | // No title on taskbar | |
602 | #define wxFRAME_TOOL_WINDOW 0x0004 | |
603 | ||
604 | /* | |
605 | * wxTabCtrl flags | |
606 | */ | |
607 | ||
608 | #define wxTAB_MULTILINE 0x0000 | |
609 | #define wxTAB_RIGHTJUSTIFY 0x0004 | |
610 | #define wxTAB_FIXEDWIDTH 0x0008 | |
611 | #define wxTAB_OWNERDRAW 0x0010 | |
612 | ||
613 | // Sorry, I changed my mind about these names... | |
614 | #define wxTC_MULTILINE 0x0000 | |
615 | #define wxTC_RIGHTJUSTIFY 0x0004 | |
616 | #define wxTC_FIXEDWIDTH 0x0008 | |
617 | #define wxTC_OWNERDRAW 0x0010 | |
618 | ||
619 | /* | |
620 | * wxStatusBar95 flags | |
621 | */ | |
622 | ||
623 | #define wxST_SIZEGRIP 0x0002 | |
624 | ||
625 | /* | |
626 | * GDI descriptions | |
627 | */ | |
628 | ||
629 | enum { | |
630 | // Text font families | |
631 | wxDEFAULT = 70, | |
632 | wxDECORATIVE, | |
633 | wxROMAN, | |
634 | wxSCRIPT, | |
635 | wxSWISS, | |
636 | wxMODERN, | |
637 | wxTELETYPE, /* @@@@ */ | |
638 | ||
639 | // Proportional or Fixed width fonts (not yet used) | |
640 | wxVARIABLE = 80, | |
641 | wxFIXED, | |
642 | ||
643 | wxNORMAL = 90, | |
644 | wxLIGHT, | |
645 | wxBOLD, | |
646 | // Also wxNORMAL for normal (non-italic text) | |
647 | wxITALIC, | |
648 | wxSLANT, | |
649 | ||
650 | // Pen styles | |
651 | wxSOLID = 100, | |
652 | wxDOT, | |
653 | wxLONG_DASH, | |
654 | wxSHORT_DASH, | |
655 | wxDOT_DASH, | |
656 | wxUSER_DASH, | |
657 | ||
658 | wxTRANSPARENT, | |
659 | ||
660 | // Brush & Pen Stippling. Note that a stippled pen cannot be dashed!! | |
661 | // Note also that stippling a Pen IS meaningfull, because a Line is | |
662 | // drawn with a Pen, and without any Brush -- and it can be stippled. | |
663 | wxSTIPPLE = 110, | |
664 | wxBDIAGONAL_HATCH, | |
665 | wxCROSSDIAG_HATCH, | |
666 | wxFDIAGONAL_HATCH, | |
667 | wxCROSS_HATCH, | |
668 | wxHORIZONTAL_HATCH, | |
669 | wxVERTICAL_HATCH, | |
670 | #define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH) | |
671 | ||
672 | wxJOIN_BEVEL = 120, | |
673 | wxJOIN_MITER, | |
674 | wxJOIN_ROUND, | |
675 | ||
676 | wxCAP_ROUND = 130, | |
677 | wxCAP_PROJECTING, | |
678 | wxCAP_BUTT | |
679 | }; | |
680 | ||
681 | ||
682 | // Logical ops | |
683 | typedef enum | |
684 | { | |
685 | wxCLEAR, // 0 | |
686 | wxXOR, // src XOR dst | |
687 | wxINVERT, // NOT dst | |
688 | wxOR_REVERSE, // src OR (NOT dst) | |
689 | wxAND_REVERSE,// src AND (NOT dst) | |
690 | wxCOPY, // src | |
691 | wxAND, // src AND dst | |
692 | wxAND_INVERT, // (NOT src) AND dst | |
693 | wxNO_OP, // dst | |
694 | wxNOR, // (NOT src) AND (NOT dst) | |
695 | wxEQUIV, // (NOT src) XOR dst | |
696 | wxSRC_INVERT, // (NOT src) | |
697 | wxOR_INVERT, // (NOT src) OR dst | |
698 | wxNAND, // (NOT src) OR (NOT dst) | |
699 | wxOR, // src OR dst | |
700 | wxSET, // 1 | |
701 | wxSRC_OR, // source _bitmap_ OR destination | |
702 | wxSRC_AND // source _bitmap_ AND destination | |
703 | } form_ops_t; | |
704 | ||
705 | // Flood styles | |
706 | #define wxFLOOD_SURFACE 1 | |
707 | #define wxFLOOD_BORDER 2 | |
708 | ||
709 | // Polygon filling mode | |
710 | #define wxODDEVEN_RULE 1 | |
711 | #define wxWINDING_RULE 2 | |
712 | ||
713 | // ToolPanel in wxFrame | |
714 | #define wxTOOL_TOP 1 | |
715 | #define wxTOOL_BOTTOM 2 | |
716 | #define wxTOOL_LEFT 3 | |
717 | #define wxTOOL_RIGHT 4 | |
718 | ||
719 | // Dialog specifiers/return values | |
720 | ||
721 | #define wxOK 0x0001 | |
722 | #define wxYES_NO 0x0002 | |
723 | #define wxCANCEL 0x0004 | |
724 | #define wxYES 0x0008 | |
725 | #define wxNO 0x0010 | |
726 | ||
727 | #define wxICON_EXCLAMATION 0x0020 | |
728 | #define wxICON_HAND 0x0040 | |
729 | #define wxICON_QUESTION 0x0080 | |
730 | #define wxICON_INFORMATION 0x0100 | |
731 | ||
732 | #define wxICON_STOP wxICON_HAND | |
733 | #define wxICON_ASTERISK wxICON_INFORMATION | |
734 | #define wxICON_MASK (0x0020|0x0040|0x0080|0x0100) | |
735 | ||
736 | #define wxCENTRE 0x0200 | |
737 | #define wxCENTER wxCENTRE | |
738 | ||
739 | // Possible SetSize flags | |
740 | ||
741 | // Use internally-calculated width if -1 | |
742 | #define wxSIZE_AUTO_WIDTH 0x0001 | |
743 | // Use internally-calculated height if -1 | |
744 | #define wxSIZE_AUTO_HEIGHT 0x0002 | |
745 | // Use internally-calculated width and height if each is -1 | |
746 | #define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT) | |
747 | // Ignore missing (-1) dimensions (use existing). | |
748 | // For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code. | |
749 | #define wxSIZE_USE_EXISTING 0x0000 | |
750 | // Allow -1 as a valid position | |
751 | #define wxSIZE_ALLOW_MINUS_ONE 0x0004 | |
752 | // Don't do parent client adjustments (for implementation only) | |
753 | #define wxSIZE_NO_ADJUSTMENTS 0x0008 | |
754 | ||
755 | #ifndef __WXGTK__ | |
756 | ||
757 | enum wxDataFormat | |
758 | { | |
759 | wxDF_INVALID = 0, | |
760 | wxDF_TEXT = 1, /* CF_TEXT */ | |
761 | wxDF_BITMAP = 2, /* CF_BITMAP */ | |
762 | wxDF_METAFILE = 3, /* CF_METAFILEPICT */ | |
763 | wxDF_SYLK = 4, | |
764 | wxDF_DIF = 5, | |
765 | wxDF_TIFF = 6, | |
766 | wxDF_OEMTEXT = 7, /* CF_OEMTEXT */ | |
767 | wxDF_DIB = 8, /* CF_DIB */ | |
768 | wxDF_PALETTE = 9, | |
769 | wxDF_PENDATA = 10, | |
770 | wxDF_RIFF = 11, | |
771 | wxDF_WAVE = 12, | |
772 | wxDF_UNICODETEXT = 13, | |
773 | wxDF_ENHMETAFILE = 14, | |
774 | wxDF_FILENAME = 15, /* CF_HDROP */ | |
775 | wxDF_LOCALE = 16, | |
776 | wxDF_PRIVATE = 20 | |
777 | }; | |
778 | ||
779 | #endif | |
780 | ||
781 | /* Virtual keycodes */ | |
782 | ||
783 | enum wxKeyCode | |
784 | { | |
785 | WXK_BACK = 8, | |
786 | WXK_TAB = 9, | |
787 | WXK_RETURN = 13, | |
788 | WXK_ESCAPE = 27, | |
789 | WXK_SPACE = 32, | |
790 | WXK_DELETE = 127, | |
791 | ||
792 | WXK_START = 300, | |
793 | WXK_LBUTTON, | |
794 | WXK_RBUTTON, | |
795 | WXK_CANCEL, | |
796 | WXK_MBUTTON, | |
797 | WXK_CLEAR, | |
798 | WXK_SHIFT, | |
799 | WXK_CONTROL, | |
800 | WXK_MENU, | |
801 | WXK_PAUSE, | |
802 | WXK_CAPITAL, | |
803 | WXK_PRIOR, /* Page up */ | |
804 | WXK_NEXT, /* Page down */ | |
805 | WXK_END, | |
806 | WXK_HOME, | |
807 | WXK_LEFT, | |
808 | WXK_UP, | |
809 | WXK_RIGHT, | |
810 | WXK_DOWN, | |
811 | WXK_SELECT, | |
812 | WXK_PRINT, | |
813 | WXK_EXECUTE, | |
814 | WXK_SNAPSHOT, | |
815 | WXK_INSERT, | |
816 | WXK_HELP, | |
817 | WXK_NUMPAD0, | |
818 | WXK_NUMPAD1, | |
819 | WXK_NUMPAD2, | |
820 | WXK_NUMPAD3, | |
821 | WXK_NUMPAD4, | |
822 | WXK_NUMPAD5, | |
823 | WXK_NUMPAD6, | |
824 | WXK_NUMPAD7, | |
825 | WXK_NUMPAD8, | |
826 | WXK_NUMPAD9, | |
827 | WXK_MULTIPLY, | |
828 | WXK_ADD, | |
829 | WXK_SEPARATOR, | |
830 | WXK_SUBTRACT, | |
831 | WXK_DECIMAL, | |
832 | WXK_DIVIDE, | |
833 | WXK_F1, | |
834 | WXK_F2, | |
835 | WXK_F3, | |
836 | WXK_F4, | |
837 | WXK_F5, | |
838 | WXK_F6, | |
839 | WXK_F7, | |
840 | WXK_F8, | |
841 | WXK_F9, | |
842 | WXK_F10, | |
843 | WXK_F11, | |
844 | WXK_F12, | |
845 | WXK_F13, | |
846 | WXK_F14, | |
847 | WXK_F15, | |
848 | WXK_F16, | |
849 | WXK_F17, | |
850 | WXK_F18, | |
851 | WXK_F19, | |
852 | WXK_F20, | |
853 | WXK_F21, | |
854 | WXK_F22, | |
855 | WXK_F23, | |
856 | WXK_F24, | |
857 | WXK_NUMLOCK, | |
858 | WXK_SCROLL, | |
859 | WXK_PAGEUP, | |
860 | WXK_PAGEDOWN | |
861 | }; | |
862 | ||
863 | /* OS mnemonics -- Identify the running OS (useful for Windows) | |
864 | * [Not all platforms are currently available or supported] */ | |
865 | enum | |
866 | { | |
867 | wxUNKNOWN_PLATFORM, | |
868 | wxCURSES, // Text-only CURSES | |
869 | wxXVIEW_X, // Sun's XView OpenLOOK toolkit | |
870 | wxMOTIF_X, // OSF Motif 1.x.x | |
871 | wxCOSE_X, // OSF Common Desktop Environment | |
872 | wxNEXTSTEP, // NeXTStep | |
873 | wxMACINTOSH, // Apple System 7 | |
874 | wxGTK, // GTK | |
875 | wxQT, // Qt | |
876 | wxGEOS, // GEOS | |
877 | wxOS2_PM, // OS/2 Workplace | |
878 | wxWINDOWS, // Windows or WfW | |
879 | wxPENWINDOWS, // Windows for Pen Computing | |
880 | wxWINDOWS_NT, // Windows NT | |
881 | wxWIN32S, // Windows 32S API | |
882 | wxWIN95, // Windows 95 | |
883 | wxWIN386 // Watcom 32-bit supervisor modus | |
884 | }; | |
885 | ||
886 | /* Printing */ | |
887 | #ifndef wxPORTRAIT | |
888 | #define wxPORTRAIT 1 | |
889 | #define wxLANDSCAPE 2 | |
890 | #endif | |
891 | ||
892 | /* Standard menu identifiers */ | |
893 | #define wxID_LOWEST 4999 | |
894 | ||
895 | #define wxID_OPEN 5000 | |
896 | #define wxID_CLOSE 5001 | |
897 | #define wxID_NEW 5002 | |
898 | #define wxID_SAVE 5003 | |
899 | #define wxID_SAVEAS 5004 | |
900 | #define wxID_REVERT 5005 | |
901 | #define wxID_EXIT 5006 | |
902 | #define wxID_UNDO 5007 | |
903 | #define wxID_REDO 5008 | |
904 | #define wxID_HELP 5009 | |
905 | #define wxID_PRINT 5010 | |
906 | #define wxID_PRINT_SETUP 5011 | |
907 | #define wxID_PREVIEW 5012 | |
908 | #define wxID_ABOUT 5013 | |
909 | #define wxID_HELP_CONTENTS 5014 | |
910 | #define wxID_HELP_COMMANDS 5015 | |
911 | #define wxID_HELP_PROCEDURES 5016 | |
912 | #define wxID_HELP_CONTEXT 5017 | |
913 | ||
914 | #define wxID_CUT 5030 | |
915 | #define wxID_COPY 5031 | |
916 | #define wxID_PASTE 5032 | |
917 | #define wxID_CLEAR 5033 | |
918 | #define wxID_FIND 5034 | |
919 | #define wxID_DUPLICATE 5035 | |
920 | #define wxID_SELECTALL 5036 | |
921 | ||
922 | #define wxID_FILE1 5050 | |
923 | #define wxID_FILE2 5051 | |
924 | #define wxID_FILE3 5052 | |
925 | #define wxID_FILE4 5053 | |
926 | #define wxID_FILE5 5054 | |
927 | #define wxID_FILE6 5055 | |
928 | #define wxID_FILE7 5056 | |
929 | #define wxID_FILE8 5057 | |
930 | #define wxID_FILE9 5058 | |
931 | ||
932 | #define wxID_OK 5100 | |
933 | #define wxID_CANCEL 5101 | |
934 | #define wxID_APPLY 5102 | |
935 | #define wxID_YES 5103 | |
936 | #define wxID_NO 5104 | |
937 | #define wxID_STATIC 5105 | |
938 | ||
939 | #define wxID_HIGHEST 5999 | |
940 | ||
941 | /* Shortcut for easier dialog-unit-to-pixel conversion */ | |
942 | #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt) | |
943 | ||
944 | #ifdef __WXMSW__ | |
945 | /* Stand-ins for Windows types, to avoid | |
946 | * #including all of windows.h */ | |
947 | typedef unsigned long WXHWND; | |
948 | typedef unsigned long WXHANDLE; | |
949 | typedef unsigned long WXHICON; | |
950 | typedef unsigned long WXHFONT; | |
951 | typedef unsigned long WXHMENU; | |
952 | typedef unsigned long WXHPEN; | |
953 | typedef unsigned long WXHBRUSH; | |
954 | typedef unsigned long WXHPALETTE; | |
955 | typedef unsigned long WXHCURSOR; | |
956 | typedef unsigned long WXHRGN; | |
957 | typedef unsigned long WXHACCEL; | |
958 | typedef unsigned long WXHINSTANCE; | |
959 | typedef unsigned long WXHBITMAP; | |
960 | typedef unsigned long WXHIMAGELIST; | |
961 | typedef unsigned long WXHGLOBAL; | |
962 | typedef unsigned long WXHDC; | |
963 | typedef unsigned int WXUINT; | |
964 | typedef unsigned long WXDWORD; | |
965 | typedef unsigned short WXWORD; | |
966 | typedef unsigned int WXWPARAM; | |
967 | typedef long WXLPARAM; | |
968 | typedef unsigned long WXCOLORREF; | |
969 | typedef void * WXRGNDATA; | |
970 | typedef void * WXMSG; | |
971 | typedef unsigned long WXHCONV; | |
972 | typedef unsigned long WXHKEY; | |
973 | typedef unsigned long WXHTREEITEM; | |
974 | typedef void * WXDRAWITEMSTRUCT; | |
975 | typedef void * WXMEASUREITEMSTRUCT; | |
976 | typedef void * WXLPCREATESTRUCT; | |
977 | #ifdef __GNUWIN32__ | |
978 | typedef int (*WXFARPROC)(); | |
979 | #elif defined(__WIN32__) | |
980 | typedef int (__stdcall *WXFARPROC)(); | |
981 | #else | |
982 | typedef int (*WXFARPROC)(); | |
983 | #endif | |
984 | ||
985 | #endif | |
986 | ||
987 | #ifdef __WXMOTIF__ | |
988 | /* Stand-ins for X/Xt/Motif types */ | |
989 | typedef void* WXWindow; | |
990 | typedef void* WXWidget; | |
991 | typedef void* WXAppContext; | |
992 | typedef void* WXColormap; | |
993 | typedef void WXDisplay; | |
994 | typedef void WXEvent; | |
995 | typedef void* WXCursor; | |
996 | typedef void* WXPixmap; | |
997 | typedef void* WXFontStructPtr; | |
998 | typedef void* WXGC; | |
999 | typedef void* WXRegion; | |
1000 | typedef void* WXFont; | |
1001 | typedef void* WXImage; | |
1002 | typedef void* WXCursor; | |
1003 | typedef void* WXFontList; | |
1004 | #endif | |
1005 | ||
1006 | #ifdef __WXGTK__ | |
1007 | /* Stand-ins for GLIB types */ | |
1008 | typedef int gint; | |
1009 | typedef unsigned guint; | |
1010 | typedef unsigned long gulong; | |
1011 | typedef void* gpointer; | |
1012 | ||
1013 | /* Stand-ins for GDK types */ | |
1014 | typedef gulong GdkAtom; | |
1015 | typedef struct _GdkColor GdkColor; | |
1016 | typedef struct _GdkColormap GdkColormap; | |
1017 | typedef struct _GdkFont GdkFont; | |
1018 | typedef struct _GdkGC GdkGC; | |
1019 | typedef struct _GdkWindow GdkWindow; | |
1020 | typedef struct _GdkWindow GdkBitmap; | |
1021 | typedef struct _GdkWindow GdkPixmap; | |
1022 | typedef struct _GdkCursor GdkCursor; | |
1023 | typedef struct _GdkRegion GdkRegion; | |
1024 | ||
1025 | /* Stand-ins for GTK types */ | |
1026 | typedef struct _GtkWidget GtkWidget; | |
1027 | typedef struct _GtkStyle GtkStyle; | |
1028 | typedef struct _GtkAdjustment GtkAdjustment; | |
1029 | typedef struct _GtkList GtkList; | |
1030 | typedef struct _GtkToolbar GtkToolbar; | |
1031 | typedef struct _GtkTooltips GtkTooltips; | |
1032 | typedef struct _GtkNotebook GtkNotebook; | |
1033 | typedef struct _GtkNotebookPage GtkNotebookPage; | |
1034 | ||
1035 | #endif | |
1036 | ||
1037 | // This is required because of clashing macros in windows.h, which may be | |
1038 | // included before or after wxWindows classes, and therefore must be | |
1039 | // disabled here before any significant wxWindows headers are included. | |
1040 | #ifdef __WXMSW__ | |
1041 | #ifdef GetClassInfo | |
1042 | #undef GetClassInfo | |
1043 | #endif | |
1044 | ||
1045 | #ifdef GetClassName | |
1046 | #undef GetClassName | |
1047 | #endif | |
1048 | ||
1049 | #ifdef DrawText | |
1050 | #undef DrawText | |
1051 | #endif | |
1052 | ||
1053 | #ifdef GetCharWidth | |
1054 | #undef GetCharWidth | |
1055 | #endif | |
1056 | ||
1057 | #ifdef StartDoc | |
1058 | #undef StartDoc | |
1059 | #endif | |
1060 | ||
1061 | #ifdef FindWindow | |
1062 | #undef FindWindow | |
1063 | #endif | |
1064 | ||
1065 | #ifdef FindResource | |
1066 | #undef FindResource | |
1067 | #endif | |
1068 | #endif | |
1069 | // __WXMSW__ | |
1070 | ||
1071 | #endif | |
1072 | // _WX_DEFS_H_ |