1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Declarations/definitions common to all wx source files
4 // Author: Julian Smart and others
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "defs.h"
30 #include "wx/version.h"
32 // ----------------------------------------------------------------------------
33 // compiler and OS identification
34 // ----------------------------------------------------------------------------
37 #if defined(__unix) || defined(__unix__) || defined(____SVR4____) || \
38 defined(__LINUX__) || defined(__sgi ) || \
39 defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
46 // Helps SGI compilation, apparently
49 #define __need_wchar_t
51 // Note I use the term __SGI_CC__ for both cc and CC, its not a good
52 // idea to mix gcc and cc/CC, the name mangling is different
57 #if defined(sun) || defined(__SUN__)
65 #if defined(__hpux) && !defined(__HPUX__)
69 #elif defined(applec) || defined(THINK_C) || ( defined( __MWERKS__ ) && !defined(__INTEL__) )
71 #elif defined(__OS2__)
72 #if defined(__IBMCPP__)
73 #define __VISAGEAVER__ __IBMCPP__
81 // Place other OS/2 compiler environment defines here
87 // define another standard symbol for Microsoft Visual C++: the standard one
88 // (_MSC_VER) is also defined by Metrowerks compiler
89 #if defined(_MSC_VER) && !defined(__MWERKS__)
90 #define __VISUALC__ _MSC_VER
91 #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
93 #elif defined(__WATCOMC__)
100 // suppress some Visual C++ warnings
102 # pragma warning(disable:4244) // conversion from double to float
103 # pragma warning(disable:4100) // unreferenced formal parameter
104 # pragma warning(disable:4511) // copy ctor couldn't be generated
105 # pragma warning(disable:4512) // operator=() couldn't be generated
107 # pragma warning(disable:4134) // conversion between pointers to members of same class
108 # pragma warning(disable:4135) // conversion between different integral types
109 # pragma warning(disable:4769) // assignment of near pointer to long integer
111 #endif // __VISUALC__
113 // suppress some Salford C++ warnings
115 # pragma suppress 353 // Possible nested comments
116 # pragma suppress 593 // Define not used
117 # pragma suppress 61 // enum has no name (doesn't suppress!)
118 # pragma suppress 106 // unnamed, unused parameter
119 # pragma suppress 571 // Virtual function hiding
120 #endif // __SALFORDC__
124 // VC1.5 does not have LPTSTR type
126 #define LPCTSTR LPCSTR
130 // Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
131 // so define it ourselves
136 // Resolves linking problems under HP-UX
137 #if defined(__HPUX__) && defined(__GNUG__)
138 #define va_list __gnuc_va_list
141 //////////////////////////////////////////////////////////////////////////////////
142 // Currently Only MS-Windows/NT, XView and Motif are supported
144 #if defined(__HPUX__) && !defined(__WXGTK__)
147 #endif // __WXMOTIF__
150 #if defined(__WXMOTIF__)
155 // wxWindows checks for WIN32, not __WIN32__
156 #if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__) && !defined(__WXSTUBS__))
176 #if !defined(__WIN95__) && (WINVER >= 0x0400)
180 #if defined(TWIN32) && !defined(__TWIN32__)
186 // Make sure the environment is set correctly
187 #if defined(__WXMSW__) && defined(__X__)
188 #error "Target can't be both X and Windows"
189 #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXPM__) && \
190 !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__)
191 #error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS__]"
194 // ============================================================================
195 // non portable C++ features
196 // ============================================================================
198 // ----------------------------------------------------------------------------
199 // check for native bool type and TRUE/FALSE constants
200 // ----------------------------------------------------------------------------
202 #if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXPM__) || defined(__WXSTUBS__)
203 // Bool is now obsolete, use bool instead
211 #elif defined(__WXMSW__)
218 // Add more tests here for Windows compilers that already define bool
219 // (under Unix, configure tests for this)
221 #if defined( __MWERKS__ )
222 #if (__MWERKS__ >= 0x1000) && !__option(bool)
225 #elif defined(__VISUALC__) && (__VISUALC__ == 1020)
226 // in VC++ 4.2 the bool keyword is reserved (hence can't be typedefed)
227 // but not implemented, so we must #define it
228 #define bool unsigned int
229 #elif defined(__VISUALC__) && (__VISUALC__ == 1010)
230 // For VisualC++ 4.1, we need to define
231 // bool as something between 4.0 & 5.0...
232 typedef unsigned int wxbool
;
235 #elif defined(__VISUALC__) && (__VISUALC__ > 1020)
236 // VC++ supports bool since 4.2
238 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)
239 // Borland 5.0+ supports bool
241 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
242 // Watcom 11+ supports bool
244 #elif defined(__GNUWIN32__)
245 // Cygwin supports bool
247 #elif defined(__VISAGECPP__)
248 typedef unsigned long bool;
253 #if !defined(HAVE_BOOL) && !defined(bool)
254 // NB: of course, this doesn't replace the standard type, because, for
255 // example, overloading based on bool/int parameter doesn't work and
256 // so should be avoided in portable programs
257 typedef unsigned int bool;
260 typedef short int WXTYPE
;
262 // special care should be taken with this type under Windows where the real
263 // window id is unsigned, so we must always do the cast before comparing them
264 // (or else they would be always different!). Usign wxGetWindowId() which does
265 // the cast itself is recommended. Note that this type can't be unsigned
266 // because -1 is a valid (and largely used) value for window id.
267 typedef int wxWindowID
;
269 // Macro to cut down on compiler warnings.
270 #if REMOVE_UNUSED_ARG
271 #define WXUNUSED(identifier) /* identifier */
272 #else // stupid, broken compiler
273 #define WXUNUSED(identifier) identifier
277 * Making or using wxWindows as a Windows DLL
280 #if defined(__WXMSW__)
282 // _declspec works in BC++ 5 and later, as well as VC++
283 #if defined(__VISUALC__) || defined(__BORLANDC__)
286 # define WXDLLEXPORT _declspec( dllexport )
287 # define WXDLLEXPORT_DATA(type) _declspec( dllexport ) type
288 # define WXDLLEXPORT_CTORFN
289 # elif defined(WXUSINGDLL)
290 # define WXDLLEXPORT _declspec( dllimport )
291 # define WXDLLEXPORT_DATA(type) _declspec( dllimport ) type
292 # define WXDLLEXPORT_CTORFN
295 # define WXDLLEXPORT_DATA(type) type
296 # define WXDLLEXPORT_CTORFN
299 #elif defined(__WXPM__)
302 # define WXDLLEXPORT _Export
303 # define WXDLLEXPORT_DATA(type) _Export type
304 # define WXDLLEXPORT_CTORFN
305 # elif defined(WXUSINGDLL)
306 # define WXDLLEXPORT _Export
307 # define WXDLLEXPORT_DATA(type) _Export type
308 # define WXDLLEXPORT_CTORFN
311 # define WXDLLEXPORT_DATA(type) type
312 # define WXDLLEXPORT_CTORFN
317 # define WXDLLEXPORT_DATA(type) type
318 # define WXDLLEXPORT_CTORFN
323 # define WXDLLEXPORT_DATA(type) type
324 # define WXDLLEXPORT_CTORFN
327 // For ostream, istream ofstream
328 #if defined(__BORLANDC__) && defined( _RTLDLL )
329 # define WXDLLIMPORT __import
334 class WXDLLEXPORT wxObject
;
335 class WXDLLEXPORT wxEvent
;
337 /** symbolic constant used by all Find()-like functions returning positive
338 integer on success as failure indicator */
339 #define wxNOT_FOUND (-1)
341 // ----------------------------------------------------------------------------
342 /** @name Very common macros */
343 // ----------------------------------------------------------------------------
345 /// delete pointer if it is not NULL and NULL it afterwards
346 // (checking that it's !NULL before passing it to delete is just a
347 // a question of style, because delete will do it itself anyhow, but it might
348 // be considered as an error by some overzealous debugging implementations of
349 // the library, so we do it ourselves)
350 #if defined(__SGI_CC__)
351 // Okay this is bad styling, but the native SGI compiler is very picky, it
352 // wont let you compare/assign between a NULL (void *) and another pointer
353 // type. To be really clean we'd need to pass in another argument, the type
355 // Also note the use of 0L, this would allow future possible 64bit support
356 // (as yet untested) by ensuring that we zero all the bits in a pointer
357 // (which is always the same length as a long (at least with the LP64 standard)
359 #define wxDELETE(p) if ( (p) ) { delete (p); p = 0L; }
361 #define wxDELETE(p) if ( (p) != NULL ) { delete p; p = NULL; }
362 #endif /* __SGI__CC__ */
364 // delete an array and NULL it (see comments above)
365 #if defined(__SGI_CC__)
366 // see above comment.
367 #define wxDELETEA(p) if ( (p) ) { delete [] (p); p = 0L; }
369 #define wxDELETEA(p) if ( ((void *) (p)) != NULL ) { delete [] p; p = NULL; }
370 #endif /* __SGI__CC__ */
372 /// size of statically declared array
373 #define WXSIZEOF(array) (sizeof(array)/sizeof(array[0]))
375 // Use of these suppresses some compiler warnings
376 WXDLLEXPORT_DATA(extern const bool) wxTrue
;
377 WXDLLEXPORT_DATA(extern const bool) wxFalse
;
379 // ----------------------------------------------------------------------------
380 // compiler specific settings
381 // ----------------------------------------------------------------------------
383 // to allow compiling with warning level 4 under Microsoft Visual C++ some
384 // warnings just must be disabled
386 #pragma warning(disable: 4514) // unreferenced inline func has been removed
388 you might be tempted to disable this one also: triggered by CHECK and FAIL
389 macros in debug.h, but it's, overall, a rather useful one, so I leave it and
390 will try to find some way to disable this warning just for CHECK/FAIL. Anyone?
392 #pragma warning(disable: 4127) // conditional expression is constant
395 #if defined(__MWERKS__)
399 #define except(x) catch(...)
402 // where should i put this? we need to make sure of this as it breaks
403 // the <iostream> code.
404 #if !wxUSE_IOSTREAMH && defined(__WXDEBUG__)
410 // Callback function type definition
411 typedef void (*wxFunction
) (wxObject
&, wxEvent
&);
413 // ----------------------------------------------------------------------------
414 // OS mnemonics -- Identify the running OS (useful for Windows)
415 // ----------------------------------------------------------------------------
417 // Not all platforms are currently available or supported
421 wxCURSES
, // Text-only CURSES
422 wxXVIEW_X
, // Sun's XView OpenLOOK toolkit
423 wxMOTIF_X
, // OSF Motif 1.x.x
424 wxCOSE_X
, // OSF Common Desktop Environment
425 wxNEXTSTEP
, // NeXTStep
426 wxMACINTOSH
, // Apple System 7
428 wxGTK_WIN32
, // GTK on Win32
429 wxGTK_OS2
, // GTK on OS/2
430 wxGTK_BEOS
, // GTK on BeOS
433 wxOS2_PM
, // OS/2 Workplace
434 wxWINDOWS
, // Windows or WfW
435 wxPENWINDOWS
, // Windows for Pen Computing
436 wxWINDOWS_NT
, // Windows NT
437 wxWIN32S
, // Windows 32S API
438 wxWIN95
, // Windows 95
439 wxWIN386
, // Watcom 32-bit supervisor modus
440 wxMGL_UNIX
, // MGL with direct hardware access
442 wxMGL_WIN32
, // MGL on Win32
443 wxMGL_OS2
// MGL on OS/2
446 // ----------------------------------------------------------------------------
447 // machine specific settings
448 // ----------------------------------------------------------------------------
450 // fixed length types
452 #define wxInt8 char signed
453 #define wxUint8 char unsigned
456 #define wxInt16 int signed
457 #define wxUint16 int unsigned
458 #define wxInt32 long signed
459 #define wxUint32 long unsigned
463 #define wxInt16 short signed
464 #define wxUint16 short unsigned
465 #define wxInt32 int signed
466 #define wxUint32 int unsigned
470 #define wxInt16 short signed
471 #define wxUint16 short unsigned
472 #define wxInt32 int signed
473 #define wxUint32 int unsigned
477 #define wxInt16 short signed
478 #define wxUint16 short unsigned
479 #define wxInt32 int signed
480 #define wxUint32 int unsigned
483 #if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXOS2__)
484 #if defined(SIZEOF_INT)
485 /* well, this shouldn't happen... */
486 #define wxInt16 short signed
487 #define wxUint16 short unsigned
488 #define wxInt32 int signed
489 #define wxUint32 int unsigned
491 #define wxInt16 short signed
492 #define wxUint16 short unsigned
493 #define wxInt32 int signed
494 #define wxUint32 int unsigned
498 #define wxByte wxUint8
499 #define wxWord wxUint16
503 #define wxBIG_ENDIAN 4321
504 #define wxLITTLE_ENDIAN 1234
505 #define wxPDP_ENDIAN 3412
507 #ifdef WORDS_BIGENDIAN
508 #define wxBYTE_ORDER wxBIG_ENDIAN
510 #define wxBYTE_ORDER wxLITTLE_ENDIAN
515 #define wxUINT16_SWAP_ALWAYS(val) \
517 (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \
518 (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8)))
520 #define wxINT16_SWAP_ALWAYS(val) \
522 (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \
523 (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8)))
525 #define wxUINT32_SWAP_ALWAYS(val) \
527 (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \
528 (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \
529 (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \
530 (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24)))
532 #define wxINT32_SWAP_ALWAYS(val) \
534 (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \
535 (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \
536 (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \
537 (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24)))
539 // machine specific byte swapping
541 #ifdef WORDS_BIGENDIAN
542 #define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val)
543 #define wxINT16_SWAP_ON_BE(val) wxINT16_SWAP_ALWAYS(val)
544 #define wxUINT16_SWAP_ON_LE(val) (val)
545 #define wxINT16_SWAP_ON_LE(val) (val)
546 #define wxUINT32_SWAP_ON_BE(val) wxUINT32_SWAP_ALWAYS(val)
547 #define wxINT32_SWAP_ON_BE(val) wxINT32_SWAP_ALWAYS(val)
548 #define wxUINT32_SWAP_ON_LE(val) (val)
549 #define wxINT32_SWAP_ON_LE(val) (val)
551 #define wxUINT16_SWAP_ON_LE(val) wxUINT16_SWAP_ALWAYS(val)
552 #define wxINT16_SWAP_ON_LE(val) wxINT16_SWAP_ALWAYS(val)
553 #define wxUINT16_SWAP_ON_BE(val) (val)
554 #define wxINT16_SWAP_ON_BE(val) (val)
555 #define wxUINT32_SWAP_ON_LE(val) wxUINT32_SWAP_ALWAYS(val)
556 #define wxINT32_SWAP_ON_LE(val) wxINT32_SWAP_ALWAYS(val)
557 #define wxUINT32_SWAP_ON_BE(val) (val)
558 #define wxINT32_SWAP_ON_BE(val) (val)
561 // ----------------------------------------------------------------------------
562 // Window style flags
563 // ----------------------------------------------------------------------------
566 * Values are chosen so they can be |'ed in a bit list.
567 * Some styles are used across more than one group,
568 * so the values mustn't clash with others in the group.
569 * Otherwise, numbers can be reused across groups.
572 * Window (cross-group) styles now take up the first half
573 * of the flag, and control-specific styles the
579 * Window (Frame/dialog/subwindow/panel item) style flags
581 #define wxVSCROLL 0x80000000
582 #define wxHSCROLL 0x40000000
583 #define wxCAPTION 0x20000000
586 #define wxDOUBLE_BORDER 0x10000000
587 #define wxSUNKEN_BORDER 0x08000000
588 #define wxRAISED_BORDER 0x04000000
589 #define wxBORDER 0x02000000
590 #define wxSIMPLE_BORDER wxBORDER
591 #define wxSTATIC_BORDER 0x01000000
592 #define wxTRANSPARENT_WINDOW 0x00100000
593 #define wxNO_BORDER 0x00200000
595 #define wxUSER_COLOURS 0x00800000
596 // Override CTL3D etc. control colour processing to
597 // allow own background colour
598 // OBSOLETE - use wxNO_3D instead
599 #define wxNO_3D 0x00800000
600 // Override CTL3D or native 3D styles for children
601 #define wxCLIP_CHILDREN 0x00400000
602 // Clip children when painting, which reduces flicker in
603 // e.g. frames and splitter windows, but can't be used in
604 // a panel where a static box must be 'transparent' (panel
605 // paints the background for it)
607 // Add this style to a panel to get tab traversal working
608 // outside of dialogs.
609 #define wxTAB_TRAVERSAL 0x00080000
611 // Add this style if the control wants to get all keyboard messages (under
612 // Windows, it won't normally get the dialog navigation key events)
613 #define wxWANTS_CHARS 0x00040000
615 // Make window retained (mostly Motif, I think)
616 #define wxRETAINED 0x00020000
617 #define wxBACKINGSTORE wxRETAINED
619 // don't invalidate the whole window (resulting in a PAINT event) when the
620 // window is resized (currently, makes sense for wxMSW only)
621 #define wxNO_FULL_REPAINT_ON_RESIZE 0x00010000
623 * wxFrame/wxDialog style flags
625 #define wxSTAY_ON_TOP 0x8000
626 #define wxICONIZE 0x4000
627 #define wxMINIMIZE wxICONIZE
628 #define wxMAXIMIZE 0x2000
629 #define wxTHICK_FRAME 0x1000
630 #define wxSYSTEM_MENU 0x0800
631 #define wxMINIMIZE_BOX 0x0400
632 #define wxMAXIMIZE_BOX 0x0200
633 #define wxTINY_CAPTION_HORIZ 0x0100
634 #define wxTINY_CAPTION_VERT 0x0080
635 #define wxRESIZE_BOX wxMAXIMIZE_BOX
636 #define wxRESIZE_BORDER 0x0040
637 #define wxDIALOG_MODAL 0x0020
638 #define wxDIALOG_MODELESS 0x0000
639 // Add for normal Windows frame behaviour
640 #define wxFRAME_FLOAT_ON_PARENT 0x0020
643 #if WXWIN_COMPATIBILITY
644 #define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE
647 #define wxDEFAULT_FRAME_STYLE \
648 (wxSYSTEM_MENU | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN)
651 # define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME)
653 // Under Unix, the dialogs don't have a system menu. Specifying
654 // wxSYSTEM_MENU here, will make a close button appear.
655 # define wxDEFAULT_DIALOG_STYLE (wxCAPTION)
659 * wxExtDialog style flags
661 #define wxED_CLIENT_MARGIN 0x0004
662 #define wxED_BUTTONS_BOTTOM 0x0000 // has no effect
663 #define wxED_BUTTONS_RIGHT 0x0002
664 #define wxED_STATIC_LINE 0x0001
666 #if defined(__WXMSW__) || defined(__WXMAC__)
667 # define wxEXT_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE|wxED_CLIENT_MARGIN)
669 # define wxEXT_DIALOG_STYLE (wxDEFAULT_DIALOG_STYLE|wxED_CLIENT_MARGIN|wxED_STATIC_LINE)
673 * wxToolBar style flags
675 #define wxTB_3DBUTTONS 0x8000
676 #define wxTB_HORIZONTAL 0x0002
677 #define wxTB_VERTICAL 0x0004
678 // Flatbar/Coolbar under Win98/ GTK 1.2
679 #define wxTB_FLAT 0x0008
680 // use native docking under GTK
681 #define wxTB_DOCKABLE 0x0010
684 * wxMenuBar style flags
686 // use native docking
687 #define wxMB_DOCKABLE 0x0001
692 #define wxMENU_TEAROFF 0x0001
695 * Apply to all panel items
697 #define wxCOLOURED 0x0800
698 // Alignment for panel item labels: replaces characters with zeros
699 // when creating label, so spaces can be included in string for alignment.
700 #define wxFIXED_LENGTH 0x0400
701 #define wxALIGN_LEFT 0x0000
702 #define wxALIGN_CENTER 0x0100
703 #define wxALIGN_CENTRE 0x0100
704 #define wxALIGN_RIGHT 0x0200
707 * Styles for wxListBox
709 #define wxLB_SORT 0x0010
710 #define wxLB_SINGLE 0x0020
711 #define wxLB_MULTIPLE 0x0040
712 #define wxLB_EXTENDED 0x0080
713 // wxLB_OWNERDRAW is Windows-only
714 #define wxLB_OWNERDRAW 0x0100
715 #define wxLB_NEEDED_SB 0x0200
716 #define wxLB_ALWAYS_SB 0x0400
717 #define wxLB_HSCROLL wxHSCROLL
720 * wxTextCtrl style flags
722 #define wxPROCESS_ENTER 0x0004
723 #define wxPASSWORD 0x0008
724 #define wxTE_PROCESS_ENTER wxPROCESS_ENTER
725 #define wxTE_PASSWORD wxPASSWORD
726 #define wxTE_READONLY 0x0010
727 #define wxTE_MULTILINE 0x0020
728 #define wxTE_PROCESS_TAB 0x0040
729 // this style means to use RICHEDIT control and does something only under wxMSW
730 // and Win32 and is silently ignored under all other platforms
731 #define wxTE_RICH 0x0080
734 * wxComboBox style flags
736 #define wxCB_SIMPLE 0x0004
737 #define wxCB_SORT 0x0008
738 #define wxCB_READONLY 0x0010
739 #define wxCB_DROPDOWN 0x0020
742 * wxRadioBox style flags
744 // New, more intuitive names to specify majorDim argument
745 #define wxRA_SPECIFY_COLS wxHORIZONTAL
746 #define wxRA_SPECIFY_ROWS wxVERTICAL
747 // Old names for compatibility
748 #define wxRA_HORIZONTAL wxHORIZONTAL
749 #define wxRA_VERTICAL wxVERTICAL
752 * wxRadioButton style flag
754 #define wxRB_GROUP 0x0004
759 #define wxGA_PROGRESSBAR 0x0004
760 #define wxGA_HORIZONTAL wxHORIZONTAL
761 #define wxGA_VERTICAL wxVERTICAL
763 #define wxGA_SMOOTH 0x0008
768 #define wxSL_HORIZONTAL wxHORIZONTAL
769 #define wxSL_VERTICAL wxVERTICAL
770 // The next one is obsolete - use scroll events instead
771 #define wxSL_NOTIFY_DRAG 0x0000
772 #define wxSL_AUTOTICKS 0x0008
773 // #define wxSL_MANUALTICKS 0x0010
774 #define wxSL_LABELS 0x0020
775 #define wxSL_LEFT 0x0040
776 #define wxSL_TOP 0x0080
777 #define wxSL_RIGHT 0x0100
778 #define wxSL_BOTTOM 0x0200
779 #define wxSL_BOTH 0x0400
780 #define wxSL_SELRANGE 0x0800
785 #define wxSB_HORIZONTAL wxHORIZONTAL
786 #define wxSB_VERTICAL wxVERTICAL
789 * wxButton flags (Win32 only)
791 #define wxBU_AUTODRAW 0x0004
792 #define wxBU_NOAUTODRAW 0x0000
797 #define wxTR_HAS_BUTTONS 0x0004
798 #define wxTR_EDIT_LABELS 0x0008
799 #define wxTR_LINES_AT_ROOT 0x0010
801 #define wxTR_SINGLE 0x0000
802 #define wxTR_MULTIPLE 0x0020
803 #define wxTR_EXTENDED 0x0040
804 #define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080
809 #define wxLC_ICON 0x0004
810 #define wxLC_SMALL_ICON 0x0008
811 #define wxLC_LIST 0x0010
812 #define wxLC_REPORT 0x0020
813 #define wxLC_ALIGN_TOP 0x0040
814 #define wxLC_ALIGN_LEFT 0x0080
815 #define wxLC_AUTOARRANGE 0x0100
816 #define wxLC_USER_TEXT 0x0200
817 #define wxLC_EDIT_LABELS 0x0400
818 #define wxLC_NO_HEADER 0x0800
819 #define wxLC_NO_SORT_HEADER 0x1000
820 #define wxLC_SINGLE_SEL 0x2000
821 #define wxLC_SORT_ASCENDING 0x4000
822 #define wxLC_SORT_DESCENDING 0x8000
824 #define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT)
825 #define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT)
826 #define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING)
828 // Omitted because (a) too much detail (b) not enough style flags
829 // #define wxLC_NO_SCROLL
830 // #define wxLC_NO_LABEL_WRAP
831 // #define wxLC_OWNERDRAW_FIXED
832 // #define wxLC_SHOW_SEL_ALWAYS
837 #define wxSP_VERTICAL 0x0004
838 #define wxSP_HORIZONTAL 0x0008
839 #define wxSP_ARROW_KEYS 0x0010
840 #define wxSP_WRAP 0x0020
843 * wxSplitterWindow flags
845 #define wxSP_NOBORDER 0x0000
846 #define wxSP_3D 0x0004
847 #define wxSP_BORDER 0x0008
848 #define wxSP_PERMIT_UNSPLIT 0x0010
849 #define wxSP_LIVE_UPDATE 0x0020
852 * wxFrame extra flags
854 // No title on taskbar
855 #define wxFRAME_TOOL_WINDOW 0x0004
860 #define wxTC_MULTILINE 0x0000
861 #define wxTC_RIGHTJUSTIFY 0x0004
862 #define wxTC_FIXEDWIDTH 0x0008
863 #define wxTC_OWNERDRAW 0x0010
868 #define wxNB_FIXEDWIDTH 0x0008
871 * wxStatusBar95 flags
873 #define wxST_SIZEGRIP 0x0002
878 #define wxLI_HORIZONTAL wxHORIZONTAL
879 #define wxLI_VERTICAL wxVERTICAL
882 * wxProgressDialog flags
884 #define wxPD_CAN_ABORT 0x0001
885 #define wxPD_APP_MODAL 0x0002
886 #define wxPD_AUTO_HIDE 0x0004
887 #define wxPD_ELAPSED_TIME 0x0008
888 #define wxPD_ESTIMATED_TIME 0x0010
889 #define wxPD_REMAINING_TIME 0x0020
892 * extended dialog specifiers. these values are stored in a different
893 * flag and thus do not overlap with other style flags. note that these
894 * values do not correspond to the return values of the dialogs (for
895 * those values, look at the wxID_XXX defines).
897 #define wxOK 0x00000001
898 #define wxYES_NO 0x00000002
899 #define wxCANCEL 0x00000004
900 #define wxYES 0x00000008
901 #define wxNO 0x00000010
902 #define wxNO_DEFAULT 0x00000020
903 #define wxYES_DEFAULT 0x00000000 // has no effect
905 #define wxICON_EXCLAMATION 0x00000040
906 #define wxICON_HAND 0x00000080
907 #define wxICON_WARNING wxICON_EXCLAMATION
908 #define wxICON_ERROR wxICON_HAND
909 #define wxICON_QUESTION 0x00000100
910 #define wxICON_INFORMATION 0x00000200
911 #define wxICON_STOP wxICON_HAND
912 #define wxICON_ASTERISK wxICON_INFORMATION
913 #define wxICON_MASK (0x00000040|0x00000080|0x00000100|0x00000200)
915 #define wxCENTRE 0x00000400
916 #define wxCENTER wxCENTRE
918 #define wxFORWARD 0x00000800
919 #define wxBACKWARD 0x00001000
920 #define wxRESET 0x00002000
921 #define wxHELP 0x00004000
922 #define wxMORE 0x00008000
923 #define wxSETUP 0x00010000
925 // ----------------------------------------------------------------------------
927 // ----------------------------------------------------------------------------
930 #define wxID_LOWEST 4999
932 #define wxID_OPEN 5000
933 #define wxID_CLOSE 5001
934 #define wxID_NEW 5002
935 #define wxID_SAVE 5003
936 #define wxID_SAVEAS 5004
937 #define wxID_REVERT 5005
938 #define wxID_EXIT 5006
939 #define wxID_UNDO 5007
940 #define wxID_REDO 5008
941 #define wxID_HELP 5009
942 #define wxID_PRINT 5010
943 #define wxID_PRINT_SETUP 5011
944 #define wxID_PREVIEW 5012
945 #define wxID_ABOUT 5013
946 #define wxID_HELP_CONTENTS 5014
947 #define wxID_HELP_COMMANDS 5015
948 #define wxID_HELP_PROCEDURES 5016
949 #define wxID_HELP_CONTEXT 5017
951 #define wxID_CUT 5030
952 #define wxID_COPY 5031
953 #define wxID_PASTE 5032
954 #define wxID_CLEAR 5033
955 #define wxID_FIND 5034
956 #define wxID_DUPLICATE 5035
957 #define wxID_SELECTALL 5036
959 #define wxID_FILE1 5050
960 #define wxID_FILE2 5051
961 #define wxID_FILE3 5052
962 #define wxID_FILE4 5053
963 #define wxID_FILE5 5054
964 #define wxID_FILE6 5055
965 #define wxID_FILE7 5056
966 #define wxID_FILE8 5057
967 #define wxID_FILE9 5058
969 // Standard button IDs
971 #define wxID_CANCEL 5101
972 #define wxID_APPLY 5102
973 #define wxID_YES 5103
975 #define wxID_STATIC 5105
976 #define wxID_FORWARD 5106
977 #define wxID_BACKWARD 5107
978 #define wxID_DEFAULT 5108
979 #define wxID_MORE 5109
980 #define wxID_SETUP 5110
981 #define wxID_RESET 5111
983 #define wxID_HIGHEST 5999
985 // ----------------------------------------------------------------------------
986 // Orientations and directions
987 // ----------------------------------------------------------------------------
991 wxHORIZONTAL
= 0x0001,
993 wxBOTH
= (wxVERTICAL
| wxHORIZONTAL
)
1004 // wxCENTRE = 0x0400 (defined above)
1006 // centering into frame rather than screen (obsolete)
1007 #define wxCENTER_FRAME 0x0000
1008 // centre on screen rather than parent
1009 #define wxCENTRE_ON_SCREEN 0x0004
1010 #define wxCENTER_ON_SCREEN wxCENTRE_ON_SCREEN
1012 // ----------------------------------------------------------------------------
1013 // Possible SetSize flags
1014 // ----------------------------------------------------------------------------
1016 // Use internally-calculated width if -1
1017 #define wxSIZE_AUTO_WIDTH 0x0001
1018 // Use internally-calculated height if -1
1019 #define wxSIZE_AUTO_HEIGHT 0x0002
1020 // Use internally-calculated width and height if each is -1
1021 #define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT)
1022 // Ignore missing (-1) dimensions (use existing).
1023 // For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code.
1024 #define wxSIZE_USE_EXISTING 0x0000
1025 // Allow -1 as a valid position
1026 #define wxSIZE_ALLOW_MINUS_ONE 0x0004
1027 // Don't do parent client adjustments (for implementation only)
1028 #define wxSIZE_NO_ADJUSTMENTS 0x0008
1030 // ----------------------------------------------------------------------------
1032 // ----------------------------------------------------------------------------
1035 // Text font families
1042 wxTELETYPE
, /* @@@@ */
1044 // Proportional or Fixed width fonts (not yet used)
1051 // Also wxNORMAL for normal (non-italic text)
1065 // Brush & Pen Stippling. Note that a stippled pen cannot be dashed!!
1066 // Note also that stippling a Pen IS meaningfull, because a Line is
1067 // drawn with a Pen, and without any Brush -- and it can be stippled.
1075 #define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
1091 wxXOR
, // src XOR dst
1092 wxINVERT
, // NOT dst
1093 wxOR_REVERSE
, // src OR (NOT dst)
1094 wxAND_REVERSE
,// src AND (NOT dst)
1096 wxAND
, // src AND dst
1097 wxAND_INVERT
, // (NOT src) AND dst
1099 wxNOR
, // (NOT src) AND (NOT dst)
1100 wxEQUIV
, // (NOT src) XOR dst
1101 wxSRC_INVERT
, // (NOT src)
1102 wxOR_INVERT
, // (NOT src) OR dst
1103 wxNAND
, // (NOT src) OR (NOT dst)
1106 wxSRC_OR
, // source _bitmap_ OR destination
1107 wxSRC_AND
// source _bitmap_ AND destination
1111 #define wxFLOOD_SURFACE 1
1112 #define wxFLOOD_BORDER 2
1114 /* Polygon filling mode */
1115 #define wxODDEVEN_RULE 1
1116 #define wxWINDING_RULE 2
1118 /* ToolPanel in wxFrame */
1119 #define wxTOOL_TOP 1
1120 #define wxTOOL_BOTTOM 2
1121 #define wxTOOL_LEFT 3
1122 #define wxTOOL_RIGHT 4
1128 wxDF_TEXT
= 1, /* CF_TEXT */
1129 wxDF_BITMAP
= 2, /* CF_BITMAP */
1130 wxDF_METAFILE
= 3, /* CF_METAFILEPICT */
1134 wxDF_OEMTEXT
= 7, /* CF_OEMTEXT */
1135 wxDF_DIB
= 8, /* CF_DIB */
1140 wxDF_UNICODETEXT
= 13,
1141 wxDF_ENHMETAFILE
= 14,
1142 wxDF_FILENAME
= 15, /* CF_HDROP */
1148 /* Virtual keycodes */
1171 WXK_PRIOR
, /* Page up */
1172 WXK_NEXT
, /* Page down */
1245 WXK_NUMPAD_PAGEDOWN
,
1251 WXK_NUMPAD_MULTIPLY
,
1253 WXK_NUMPAD_SEPARATOR
,
1254 WXK_NUMPAD_SUBTRACT
,
1259 // Mapping modes (as per Windows)
1261 #define wxMM_LOMETRIC 2
1262 #define wxMM_HIMETRIC 3
1263 #define wxMM_LOENGLISH 4
1264 #define wxMM_HIENGLISH 5
1265 #define wxMM_TWIPS 6
1266 #define wxMM_ISOTROPIC 7
1267 #define wxMM_ANISOTROPIC 8
1269 #define wxMM_POINTS 9
1270 #define wxMM_METRIC 10
1272 /* Shortcut for easier dialog-unit-to-pixel conversion */
1273 #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
1277 wxPAPER_NONE
, // Use specific dimensions
1278 wxPAPER_LETTER
, // Letter, 8 1/2 by 11 inches
1279 wxPAPER_LEGAL
, // Legal, 8 1/2 by 14 inches
1280 wxPAPER_A4
, // A4 Sheet, 210 by 297 millimeters
1281 wxPAPER_CSHEET
, // C Sheet, 17 by 22 inches
1282 wxPAPER_DSHEET
, // D Sheet, 22 by 34 inches
1283 wxPAPER_ESHEET
, // E Sheet, 34 by 44 inches
1284 wxPAPER_LETTERSMALL
, // Letter Small, 8 1/2 by 11 inches
1285 wxPAPER_TABLOID
, // Tabloid, 11 by 17 inches
1286 wxPAPER_LEDGER
, // Ledger, 17 by 11 inches
1287 wxPAPER_STATEMENT
, // Statement, 5 1/2 by 8 1/2 inches
1288 wxPAPER_EXECUTIVE
, // Executive, 7 1/4 by 10 1/2 inches
1289 wxPAPER_A3
, // A3 sheet, 297 by 420 millimeters
1290 wxPAPER_A4SMALL
, // A4 small sheet, 210 by 297 millimeters
1291 wxPAPER_A5
, // A5 sheet, 148 by 210 millimeters
1292 wxPAPER_B4
, // B4 sheet, 250 by 354 millimeters
1293 wxPAPER_B5
, // B5 sheet, 182-by-257-millimeter paper
1294 wxPAPER_FOLIO
, // Folio, 8-1/2-by-13-inch paper
1295 wxPAPER_QUARTO
, // Quarto, 215-by-275-millimeter paper
1296 wxPAPER_10X14
, // 10-by-14-inch sheet
1297 wxPAPER_11X17
, // 11-by-17-inch sheet
1298 wxPAPER_NOTE
, // Note, 8 1/2 by 11 inches
1299 wxPAPER_ENV_9
, // #9 Envelope, 3 7/8 by 8 7/8 inches
1300 wxPAPER_ENV_10
, // #10 Envelope, 4 1/8 by 9 1/2 inches
1301 wxPAPER_ENV_11
, // #11 Envelope, 4 1/2 by 10 3/8 inches
1302 wxPAPER_ENV_12
, // #12 Envelope, 4 3/4 by 11 inches
1303 wxPAPER_ENV_14
, // #14 Envelope, 5 by 11 1/2 inches
1304 wxPAPER_ENV_DL
, // DL Envelope, 110 by 220 millimeters
1305 wxPAPER_ENV_C5
, // C5 Envelope, 162 by 229 millimeters
1306 wxPAPER_ENV_C3
, // C3 Envelope, 324 by 458 millimeters
1307 wxPAPER_ENV_C4
, // C4 Envelope, 229 by 324 millimeters
1308 wxPAPER_ENV_C6
, // C6 Envelope, 114 by 162 millimeters
1309 wxPAPER_ENV_C65
, // C65 Envelope, 114 by 229 millimeters
1310 wxPAPER_ENV_B4
, // B4 Envelope, 250 by 353 millimeters
1311 wxPAPER_ENV_B5
, // B5 Envelope, 176 by 250 millimeters
1312 wxPAPER_ENV_B6
, // B6 Envelope, 176 by 125 millimeters
1313 wxPAPER_ENV_ITALY
, // Italy Envelope, 110 by 230 millimeters
1314 wxPAPER_ENV_MONARCH
, // Monarch Envelope, 3 7/8 by 7 1/2 inches
1315 wxPAPER_ENV_PERSONAL
, // 6 3/4 Envelope, 3 5/8 by 6 1/2 inches
1316 wxPAPER_FANFOLD_US
, // US Std Fanfold, 14 7/8 by 11 inches
1317 wxPAPER_FANFOLD_STD_GERMAN
, // German Std Fanfold, 8 1/2 by 12 inches
1318 wxPAPER_FANFOLD_LGL_GERMAN
, // German Legal Fanfold, 8 1/2 by 13 inches
1320 wxPAPER_ISO_B4
, // B4 (ISO) 250 x 353 mm
1321 wxPAPER_JAPANESE_POSTCARD
, // Japanese Postcard 100 x 148 mm
1322 wxPAPER_9X11
, // 9 x 11 in
1323 wxPAPER_10X11
, // 10 x 11 in
1324 wxPAPER_15X11
, // 15 x 11 in
1325 wxPAPER_ENV_INVITE
, // Envelope Invite 220 x 220 mm
1326 wxPAPER_LETTER_EXTRA
, // Letter Extra 9 \275 x 12 in
1327 wxPAPER_LEGAL_EXTRA
, // Legal Extra 9 \275 x 15 in
1328 wxPAPER_TABLOID_EXTRA
, // Tabloid Extra 11.69 x 18 in
1329 wxPAPER_A4_EXTRA
, // A4 Extra 9.27 x 12.69 in
1330 wxPAPER_LETTER_TRANSVERSE
, // Letter Transverse 8 \275 x 11 in
1331 wxPAPER_A4_TRANSVERSE
, // A4 Transverse 210 x 297 mm
1332 wxPAPER_LETTER_EXTRA_TRANSVERSE
, // Letter Extra Transverse 9\275 x 12 in
1333 wxPAPER_A_PLUS
, // SuperA/SuperA/A4 227 x 356 mm
1334 wxPAPER_B_PLUS
, // SuperB/SuperB/A3 305 x 487 mm
1335 wxPAPER_LETTER_PLUS
, // Letter Plus 8.5 x 12.69 in
1336 wxPAPER_A4_PLUS
, // A4 Plus 210 x 330 mm
1337 wxPAPER_A5_TRANSVERSE
, // A5 Transverse 148 x 210 mm
1338 wxPAPER_B5_TRANSVERSE
, // B5 (JIS) Transverse 182 x 257 mm
1339 wxPAPER_A3_EXTRA
, // A3 Extra 322 x 445 mm
1340 wxPAPER_A5_EXTRA
, // A5 Extra 174 x 235 mm
1341 wxPAPER_B5_EXTRA
, // B5 (ISO) Extra 201 x 276 mm
1342 wxPAPER_A2
, // A2 420 x 594 mm
1343 wxPAPER_A3_TRANSVERSE
, // A3 Transverse 297 x 420 mm
1344 wxPAPER_A3_EXTRA_TRANSVERSE
// A3 Extra Transverse 322 x 445 mm
1348 /* Printing orientation */
1350 #define wxPORTRAIT 1
1351 #define wxLANDSCAPE 2
1354 /* Duplex printing modes
1358 wxDUPLEX_SIMPLEX
, // Non-duplex
1359 wxDUPLEX_HORIZONTAL
,
1366 #define wxPRINT_QUALITY_HIGH -1
1367 #define wxPRINT_QUALITY_MEDIUM -2
1368 #define wxPRINT_QUALITY_LOW -3
1369 #define wxPRINT_QUALITY_DRAFT -4
1371 typedef int wxPrintQuality
;
1373 /* Print mode (currently PostScript only)
1377 wxPRINT_MODE_NONE
= 0,
1378 wxPRINT_MODE_PREVIEW
= 1, // Preview in external application
1379 wxPRINT_MODE_FILE
= 2, // Print to file
1380 wxPRINT_MODE_PRINTER
= 3 // Send to printer
1383 // ---------------------------------------------------------------------------
1384 // macros that enable wxWindows apps to be compiled in absence of the
1385 // sytem headers, although some platform specific types are used in the
1386 // platform specific (implementation) parts of the headers
1387 // ---------------------------------------------------------------------------
1389 #if defined(__WXMSW__) || defined(__WXPM__)
1390 // Stand-ins for Windows types or OS/2, to avoid #including all of windows.h or os2.h
1391 typedef unsigned long WXHWND
;
1392 typedef unsigned long WXHANDLE
;
1393 typedef unsigned long WXHICON
;
1394 typedef unsigned long WXHFONT
;
1395 typedef unsigned long WXHMENU
;
1396 typedef unsigned long WXHPEN
;
1397 typedef unsigned long WXHBRUSH
;
1398 typedef unsigned long WXHPALETTE
;
1399 typedef unsigned long WXHCURSOR
;
1400 typedef unsigned long WXHRGN
;
1401 typedef unsigned long WXHACCEL
;
1402 typedef unsigned long WXHINSTANCE
;
1403 typedef unsigned long WXHBITMAP
;
1404 typedef unsigned long WXHIMAGELIST
;
1405 typedef unsigned long WXHGLOBAL
;
1406 typedef unsigned long WXHDC
;
1407 typedef unsigned int WXUINT
;
1408 typedef unsigned long WXDWORD
;
1409 typedef unsigned short WXWORD
;
1410 typedef unsigned int WXWPARAM
;
1411 typedef long WXLPARAM
;
1412 typedef unsigned long WXCOLORREF
;
1413 typedef void * WXRGNDATA
;
1414 typedef void * WXMSG
;
1415 typedef unsigned long WXHCONV
;
1416 typedef unsigned long WXHKEY
;
1417 typedef unsigned long WXHTREEITEM
;
1419 typedef void * WXDRAWITEMSTRUCT
;
1420 typedef void * WXMEASUREITEMSTRUCT
;
1421 typedef void * WXLPCREATESTRUCT
;
1423 #if defined(__GNUWIN32__) || defined(__WXWINE__)
1424 typedef int (*WXFARPROC
)();
1425 #elif defined(__WIN32__)
1426 typedef int (__stdcall
*WXFARPROC
)();
1428 typedef int (*WXFARPROC
)();
1431 typedef WXHWND WXWidget
;
1435 /* Stand-ins for X/Xt/Motif types */
1436 typedef void* WXWindow
;
1437 typedef void* WXWidget
;
1438 typedef void* WXAppContext
;
1439 typedef void* WXColormap
;
1440 typedef void WXDisplay
;
1441 typedef void WXEvent
;
1442 typedef void* WXCursor
;
1443 typedef void* WXPixmap
;
1444 typedef void* WXFontStructPtr
;
1446 typedef void* WXRegion
;
1447 typedef void* WXFont
;
1448 typedef void* WXImage
;
1449 typedef void* WXCursor
;
1450 typedef void* WXFontList
;
1452 typedef unsigned long Atom
; /* this might fail on a few architectures */
1457 /* Stand-ins for GLIB types */
1459 typedef unsigned guint
;
1460 typedef unsigned long gulong
;
1461 typedef void* gpointer
;
1462 typedef struct _GSList GSList
;
1464 /* Stand-ins for GDK types */
1465 typedef gulong GdkAtom
;
1466 typedef struct _GdkColor GdkColor
;
1467 typedef struct _GdkColormap GdkColormap
;
1468 typedef struct _GdkFont GdkFont
;
1469 typedef struct _GdkGC GdkGC
;
1470 typedef struct _GdkWindow GdkWindow
;
1471 typedef struct _GdkWindow GdkBitmap
;
1472 typedef struct _GdkWindow GdkPixmap
;
1473 typedef struct _GdkCursor GdkCursor
;
1474 typedef struct _GdkRegion GdkRegion
;
1475 typedef struct _GdkDragContext GdkDragContext
;
1477 /* Stand-ins for GTK types */
1478 typedef struct _GtkWidget GtkWidget
;
1479 typedef struct _GtkStyle GtkStyle
;
1480 typedef struct _GtkAdjustment GtkAdjustment
;
1481 typedef struct _GtkList GtkList
;
1482 typedef struct _GtkToolbar GtkToolbar
;
1483 typedef struct _GtkTooltips GtkTooltips
;
1484 typedef struct _GtkNotebook GtkNotebook
;
1485 typedef struct _GtkNotebookPage GtkNotebookPage
;
1486 typedef struct _GtkAccelGroup GtkAccelGroup
;
1487 typedef struct _GtkItemFactory GtkItemFactory
;
1488 typedef struct _GtkSelectionData GtkSelectionData
;
1490 typedef GtkWidget
*WXWidget
;
1493 // This is required because of clashing macros in windows.h, which may be
1494 // included before or after wxWindows classes, and therefore must be
1495 // disabled here before any significant wxWindows headers are included.
1527 // ---------------------------------------------------------------------------
1528 // macro to define a class without copy ctor nor assignment operator
1529 // ---------------------------------------------------------------------------
1531 #define DECLARE_NO_COPY_CLASS(classname) \
1533 classname(const classname&); \
1534 classname& operator=(const classname&)