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