diff --git a/configure.in b/configure.in index b3b38ba9a4..de1cf2a540 100644 --- a/configure.in +++ b/configure.in @@ -2968,6 +2968,10 @@ if test "$wxUSE_APPLE_IEEE" = "yes"; then AC_DEFINE(wxUSE_APPLE_IEEE) fi +if test "$wxUSE_TIMER" = "yes"; then + AC_DEFINE(wxUSE_TIMER) +fi + if test "$wxUSE_WAVE" = "yes"; then AC_DEFINE(wxUSE_WAVE) fi diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 5d144f010d..010b3c384e 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -47,24 +47,50 @@ wxUSE_TOOLBAR || \ wxUSE_TOOLTIPS || \ wxUSE_TREECTRL - #if !wxUSE_CONTROLS - #if wxABORT_ON_CONFIG_ERROR - #error "wxUSE_CONTROLS unset but some controls used" - #else - #undef wxUSE_CONTROLS - #define wxUSE_CONTROLS 1 - #endif - #endif +# if !wxUSE_CONTROLS +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_CONTROLS unset but some controls used" +# else +# undef wxUSE_CONTROLS +# define wxUSE_CONTROLS 1 +# endif +# endif #endif /* controls */ #if wxUSE_STOPWATCH - #if !wxUSE_LONGLONG - #if wxABORT_ON_CONFIG_ERROR - #error "wxUSE_STOPWATCH requires wxUSE_LONGLONG" - #else - #undef wxUSE_LONGLONG - #define wxUSE_LONGLONG 1 - #endif - #endif +# if !wxUSE_LONGLONG +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_STOPWATCH requires wxUSE_LONGLONG" +# else +# undef wxUSE_LONGLONG +# define wxUSE_LONGLONG 1 +# endif +# endif #endif /* wxUSE_STOPWATCH */ +#if !defined(wxUSE_DYNAMIC_CLASSES) || !wxUSE_DYNAMIC_CLASSES +# if wxABORT_ON_CONFIG_ERROR +# error "wxUSE_DYNAMIC_CLASSES must be defined as 1" +# else +# undef wxUSE_DYNAMIC_CLASSES +# define wxUSE_DYNAMIC_CLASSES +# endif +#endif /* wxUSE_DYNAMIC_CLASSES */ + +#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE +# if wxABORT_ON_CONFIG_ERROR +# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE" +# else +# undef wxUSE_TEXTFILE +# define wxUSE_TEXTFILE 1 +# endif +#endif /* wxUSE_MIMETYPE */ + +#if wxUSE_TEXTFILE && !wxUSE_FILE +# if wxABORT_ON_CONFIG_ERROR +# error "wxUSE_TEXTFILE requires wxUSE_FILE" +# else +# undef wxUSE_FILE +# define wxUSE_FILE 1 +# endif +#endif /* wxUSE_TEXTFILE */ diff --git a/include/wx/dragimag.h b/include/wx/dragimag.h index d137c02f21..f467fc1d19 100644 --- a/include/wx/dragimag.h +++ b/include/wx/dragimag.h @@ -1,6 +1,8 @@ #ifndef _WX_DRAGIMAG_H_BASE_ #define _WX_DRAGIMAG_H_BASE_ +#if wxUSE_DRAGIMAG + #if defined(__WXMSW__) #ifdef __WIN16__ #include "wx/generic/dragimgg.h" @@ -42,5 +44,7 @@ #endif +#endif // wxUSE_DRAGIMAG + #endif // _WX_DRAGIMAG_H_BASE_ diff --git a/include/wx/menu.h b/include/wx/menu.h index ca2e84ba20..e6c2c7f8bb 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -16,6 +16,8 @@ #pragma interface "menubase.h" #endif +#if wxUSE_MENUS + // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -419,5 +421,7 @@ protected: #endif #endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY +#endif // wxUSE_MENUS + #endif // _WX_MENU_H_BASE_ diff --git a/include/wx/menuitem.h b/include/wx/menuitem.h index a16e421171..9b2c328a1f 100644 --- a/include/wx/menuitem.h +++ b/include/wx/menuitem.h @@ -12,6 +12,8 @@ #ifndef _WX_MENUITEM_H_BASE_ #define _WX_MENUITEM_H_BASE_ +#if wxUSE_MENUS + // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -143,5 +145,7 @@ private: #endif #endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY +#endif // wxUSE_MENUS + #endif // _WX_MENUITEM_H_BASE_ diff --git a/include/wx/mimetype.h b/include/wx/mimetype.h index dcd26cafa4..a4d03c7245 100644 --- a/include/wx/mimetype.h +++ b/include/wx/mimetype.h @@ -24,7 +24,7 @@ class wxMimeTypesManagerImpl; #include "wx/defs.h" -#if wxUSE_FILE +#if wxUSE_MIMETYPE // the things we really need #include "wx/string.h" @@ -242,8 +242,7 @@ private: // the default mime manager for wxWindows programs WXDLLEXPORT_DATA(extern wxMimeTypesManager *) wxTheMimeTypesManager; -#endif - // wxUSE_FILE +#endif // wxUSE_MIMETYPE #endif //_MIMETYPE_H diff --git a/include/wx/msw/bmpbuttn.h b/include/wx/msw/bmpbuttn.h index 0f9b28aa62..8fae23b520 100644 --- a/include/wx/msw/bmpbuttn.h +++ b/include/wx/msw/bmpbuttn.h @@ -16,6 +16,8 @@ #pragma interface "bmpbuttn.h" #endif +#if wxUSE_BMPBUTTON + #include "wx/button.h" #include "wx/bitmap.h" @@ -84,5 +86,7 @@ protected: int m_marginY; }; +#endif // wxUSE_BMPBUTTON + #endif // _WX_BMPBUTTN_H_ diff --git a/include/wx/msw/checkbox.h b/include/wx/msw/checkbox.h index 2dc291ebb9..48243f8bb1 100644 --- a/include/wx/msw/checkbox.h +++ b/include/wx/msw/checkbox.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.h +// Name: wx/msw/checkbox.h // Purpose: wxCheckBox class // Author: Julian Smart // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CHECKBOX_H_ @@ -16,6 +16,8 @@ #pragma interface "checkbox.h" #endif +#if wxUSE_CHECKBOX + #include "wx/control.h" WXDLLEXPORT_DATA(extern const wxChar*) wxCheckBoxNameStr; @@ -80,5 +82,8 @@ public: virtual void SetLabel(const wxBitmap& bitmap); }; + +#endif // wxUSE_CHECKBOX + #endif // _WX_CHECKBOX_H_ diff --git a/include/wx/msw/gauge95.h b/include/wx/msw/gauge95.h index 3cb7379a65..c1ab4ab1d0 100644 --- a/include/wx/msw/gauge95.h +++ b/include/wx/msw/gauge95.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _GAUGE95_H_ @@ -16,6 +16,8 @@ #pragma interface "gauge95.h" #endif +#if wxUSE_SLIDER + #include "wx/control.h" WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr; @@ -75,5 +77,7 @@ protected: int m_gaugePos; }; +#endif // wxUSE_GAUGE + #endif // _GAUGEMSW_H_ diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h index 7f7f1b679c..38c95ca792 100644 --- a/include/wx/msw/listbox.h +++ b/include/wx/msw/listbox.h @@ -16,6 +16,8 @@ #pragma interface "listbox.h" #endif +#if wxUSE_LISTBOX + // ---------------------------------------------------------------------------- // simple types // ---------------------------------------------------------------------------- @@ -133,5 +135,7 @@ private: DECLARE_DYNAMIC_CLASS(wxListBox) }; +#endif // wxUSE_LISTBOX + #endif // _WX_LISTBOX_H_ diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index b918bb063a..d6da66a5a9 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -13,9 +13,11 @@ #define _WX_LISTCTRL_H_ #ifdef __GNUG__ -#pragma interface "listctrl.h" + #pragma interface "listctrl.h" #endif +#if wxUSE_LISTCTRL + #include "wx/control.h" #include "wx/event.h" #include "wx/hash.h" @@ -358,5 +360,7 @@ private: DECLARE_DYNAMIC_CLASS(wxListCtrl) }; +#endif // wxUSE_LISTCTRL + #endif // _WX_LISTCTRL_H_ diff --git a/include/wx/msw/mimetype.h b/include/wx/msw/mimetype.h index 605c00fe01..2e1ace9b0a 100644 --- a/include/wx/msw/mimetype.h +++ b/include/wx/msw/mimetype.h @@ -18,8 +18,9 @@ #include "wx/defs.h" -#include "wx/mimetype.h" +#if wxUSE_MIMETYPE +#include "wx/mimetype.h" class WXDLLEXPORT wxFileTypeImpl { @@ -89,6 +90,7 @@ private: wxArrayFileTypeInfo m_fallbacks; }; +#endif // wxUSE_MIMETYPE #endif //_MIMETYPE_IMPL_H diff --git a/include/wx/msw/notebook.h b/include/wx/msw/notebook.h index 4b95a47eb7..adc31bdaf8 100644 --- a/include/wx/msw/notebook.h +++ b/include/wx/msw/notebook.h @@ -15,6 +15,8 @@ #pragma interface "notebook.h" #endif +#if wxUSE_NOTEBOOK + // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -165,4 +167,6 @@ protected: DECLARE_EVENT_TABLE() }; +#endif // wxUSE_NOTEBOOK + #endif // _NOTEBOOK_H diff --git a/include/wx/msw/radiobox.h b/include/wx/msw/radiobox.h index 471ca12608..115be65e20 100644 --- a/include/wx/msw/radiobox.h +++ b/include/wx/msw/radiobox.h @@ -16,6 +16,8 @@ #pragma interface "radiobox.h" #endif +#if wxUSE_RADIOBOX + #include "wx/control.h" WXDLLEXPORT_DATA(extern const wxChar*) wxRadioBoxNameStr; @@ -124,5 +126,7 @@ protected: virtual wxSize DoGetBestSize() const; }; +#endif // wxUSE_RADIOBOX + #endif // _WX_RADIOBOX_H_ diff --git a/include/wx/msw/radiobut.h b/include/wx/msw/radiobut.h index b75df13479..b0d96d99f1 100644 --- a/include/wx/msw/radiobut.h +++ b/include/wx/msw/radiobut.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RADIOBUT_H_ @@ -16,6 +16,8 @@ #pragma interface "radiobut.h" #endif +#if wxUSE_RADIOBTN + #include "wx/control.h" WXDLLEXPORT_DATA(extern const wxChar*) wxRadioButtonNameStr; @@ -54,41 +56,7 @@ class WXDLLEXPORT wxRadioButton: public wxControl void Command(wxCommandEvent& event); }; -// Not implemented -#if 0 -class WXDLLEXPORT wxBitmap ; - -WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr; - -class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton -{ - DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton) - protected: - wxBitmap *theButtonBitmap; - public: - inline wxBitmapRadioButton(void) { theButtonBitmap = NULL; } - inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapRadioButtonNameStr) - { - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapRadioButtonNameStr); - - virtual void SetLabel(const wxBitmap *label); - virtual void SetValue(bool val) ; - virtual bool GetValue(void) const ; -}; -#endif +#endif // wxUSE_RADIOBTN #endif // _WX_RADIOBUT_H_ diff --git a/include/wx/msw/scrolbar.h b/include/wx/msw/scrolbar.h index ec4e2dfebd..ace2c1704c 100644 --- a/include/wx/msw/scrolbar.h +++ b/include/wx/msw/scrolbar.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SCROLBAR_H_ @@ -16,6 +16,8 @@ #pragma interface "scrolbar.h" #endif +#if wxUSE_SCROLLBAR + #include "wx/control.h" WXDLLEXPORT_DATA(extern const wxChar*) wxScrollBarNameStr; @@ -87,5 +89,7 @@ protected: DECLARE_EVENT_TABLE() }; +#endif // wxUSE_SCROLLBAR + #endif // _WX_SCROLBAR_H_ diff --git a/include/wx/msw/slider95.h b/include/wx/msw/slider95.h index 1a38d44350..ded886a8bc 100644 --- a/include/wx/msw/slider95.h +++ b/include/wx/msw/slider95.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _SLIDER95_H_ @@ -16,6 +16,8 @@ #pragma interface "slider95.h" #endif +#if wxUSE_SLIDER + #include "wx/control.h" WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr; @@ -105,5 +107,7 @@ protected: int sizeFlags = wxSIZE_AUTO); }; +#endif // wxUSE_SLIDER + #endif // _SLIDER95_H_ diff --git a/include/wx/msw/statbmp.h b/include/wx/msw/statbmp.h index fb294bbc60..7f99f396c6 100644 --- a/include/wx/msw/statbmp.h +++ b/include/wx/msw/statbmp.h @@ -16,6 +16,8 @@ #pragma interface "statbmp.h" #endif +#if wxUSE_STATBMP + #include "wx/control.h" #include "wx/icon.h" #include "wx/bitmap.h" @@ -86,5 +88,7 @@ protected: wxGDIImage *m_image; }; +#endif // wxUSE_STATBMP + #endif // _WX_STATBMP_H_ diff --git a/include/wx/msw/statbox.h b/include/wx/msw/statbox.h index 54ad5e352e..24dfe5ec91 100644 --- a/include/wx/msw/statbox.h +++ b/include/wx/msw/statbox.h @@ -16,6 +16,8 @@ #pragma interface "statbox.h" #endif +#if wxUSE_STATBOX + #include "wx/control.h" WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBoxNameStr; @@ -57,5 +59,7 @@ protected: virtual wxSize DoGetBestSize() const; }; +#endif // wxUSE_STATBOX + #endif // _WX_STATBOX_H_ diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index 78c77e0714..9d5b97c3b7 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -20,6 +20,8 @@ #pragma interface "treectrl.h" #endif +#if wxUSE_TREECTRL + #include "wx/textctrl.h" #include "wx/dynarray.h" #include "wx/treebase.h" @@ -449,5 +451,7 @@ private: DECLARE_DYNAMIC_CLASS(wxTreeCtrl) }; +#endif // wxUSE_TREECTRL + #endif // _WX_TREECTRL_H_ diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index bb3c5a2cd9..53d44496b4 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -109,7 +109,9 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; +#if wxUSE_MENUS virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); +#endif // wxUSE_MENUS virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = TRUE ); @@ -154,12 +156,14 @@ public: void GetCaretPos(int *x, int *y) const; #endif // wxUSE_CARET +#ifndef __WXUNIVERSAL__ // Native resource loading (implemented in src/msw/nativdlg.cpp) // FIXME: should they really be all virtual? virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id); virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name); wxWindow* GetWindowChild1(wxWindowID id); wxWindow* GetWindowChild(wxWindowID id); +#endif // __WXUNIVERSAL__ // a MSW only function which sends a size event to the window using its // current size - this has an effect of refreshing the window layout @@ -232,11 +236,13 @@ public: virtual void MSWDeviceToLogical(float *x, float *y) const; #endif // WXWIN_COMPATIBILITY +#ifndef __WXUNIVERSAL__ // Create an appropriate wxWindow from a HWND virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd); // Make sure the window style reflects the HWND style (roughly) virtual void AdoptAttributesFromHWND(); +#endif // __WXUNIVERSAL__ // Setup background and foreground colours correctly virtual void SetupColours(); diff --git a/include/wx/setup.h b/include/wx/setup.h index a38f59eb9f..fe7b783d36 100644 --- a/include/wx/setup.h +++ b/include/wx/setup.h @@ -15,7 +15,16 @@ #error No __WXxxx__ define set! Please define one of __WXBASE__,__WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXPM__,__WXSTUBS__ #endif -#ifdef __WXBASE__ +// wxUniversal is defined together with one of other ports, so test for it +// first +#ifdef __WXUNIVERSAL__ +#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__) +#include "wx/univd/setup.h" +#else +#include "wx/univ/setup.h" +#endif + +#elif defined(__WXBASE__) #if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__) #include "wx/based/setup.h" #else @@ -56,5 +65,7 @@ #endif #endif -#endif - /* _WX_SETUP_H_BASE_ */ + +#include "chkconf.h" + +#endif /* _WX_SETUP_H_BASE_ */ diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 87c7ed631c..5f656f3703 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -18,7 +18,7 @@ #ifdef __GNUG__ #pragma interface "textctrlbase.h" -#endif +#endif #include "wx/defs.h" diff --git a/include/wx/univ/app.h b/include/wx/univ/app.h new file mode 100644 index 0000000000..20ad226047 --- /dev/null +++ b/include/wx/univ/app.h @@ -0,0 +1,21 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/univ/app.h +// Purpose: wxUniversalApp class extends wxApp for wxUniv port +// Author: Vadim Zeitlin +// Modified by: +// Created: 06.08.00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vadim Zeitlin +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_UNIX_APP_H_ +#define _WX_UNIX_APP_H_ + +class WXDLLEXPORT wxUniversalApp : public wxApp +{ +public: +}; + +#endif // _WX_UNIX_APP_H_ + diff --git a/include/wx/univ/renderer.h b/include/wx/univ/renderer.h new file mode 100644 index 0000000000..f3fd6cda61 --- /dev/null +++ b/include/wx/univ/renderer.h @@ -0,0 +1,33 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/univ/renderer.h +// Purpose: wxRenderer class declaration +// Author: Vadim Zeitlin +// Modified by: +// Created: 06.08.00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vadim Zeitlin +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +/* + wxRenderer class is used to draw all wxWindows controls. This is an ABC and + the look of the application is determined by the concrete derivation of + wxRenderer used in the program. + + */ + +#ifndef _WX_UNIX_RENDERER_H_ +#define _WX_UNIX_RENDERER_H_ + +class WXDLLEXPORT wxRenderer +{ +public: + // draw the label + virtual void DrawLabel(wxDC& dc, wxWindow *window) = 0; + + // draw the border and adjust the DC + virtual void DrawBorder(wxDC& dc, wxWindow *window) = 0; +}; + +#endif // _WX_UNIX_RENDERER_H_ + diff --git a/include/wx/univ/setup.h b/include/wx/univ/setup.h new file mode 100644 index 0000000000..86c0748cd7 --- /dev/null +++ b/include/wx/univ/setup.h @@ -0,0 +1,153 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/univ/setup.h +// Purpose: configuration settings for wxUniversal/MSW +// Author: Vadim Zeitlin +// Modified by: +// Created: 14.08.00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vadim Zeitlin +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_UNIV_SETUP_H_ +#define _WX_UNIV_SETUP_H_ + +// ---------------------------------------------------------------------------- +// undef everything +// ---------------------------------------------------------------------------- + +#define wxUSE_GUI 1 +#define WXWIN_COMPATIBILITY 0 +#define wxICON_IS_BITMAP 0 +#define wxFONT_SIZE_COMPATIBILITY 0 +#define wxDIALOG_UNIT_COMPATIBILITY 1 +#define wxUSE_DEBUG_CONTEXT 0 +#define wxUSE_MEMORY_TRACING 0 +#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 +#define wxUSE_DEBUG_NEW_ALWAYS 0 +#define wxUSE_ON_FATAL_EXCEPTION 0 + +#define wxUSE_UNICODE 0 +#define wxUSE_WCHAR_T 0 +#define wxUSE_LOG 1 +#define wxUSE_THREADS 0 +#define wxUSE_STREAMS 0 +#define wxUSE_STD_IOSTREAM 0 +#define wxUSE_SERIAL 0 +#define wxUSE_LONGLONG 0 +#define wxUSE_TIMER 0 +#define wxUSE_TIMEDATE 0 +#define wxUSE_DATETIME 0 +#define wxUSE_CONFIG 0 +#define wxUSE_CONFIG_NATIVE 0 +#define wxUSE_DIALUP_MANAGER 0 +#define wxUSE_DYNLIB_CLASS 0 +#define wxUSE_SOCKETS 0 +#define wxUSE_FILESYSTEM 0 +#define wxUSE_FS_ZIP 0 +#define wxUSE_FS_INET 0 +#define wxUSE_ZIPSTREAM 0 +#define wxUSE_ZLIB 0 +#define wxUSE_FILESYSTEM 0 +#define wxUSE_FS_ZIP 0 +#define wxUSE_FS_INET 0 +#define wxUSE_ZIPSTREAM 0 +#define wxUSE_ZLIB 0 +#define wxUSE_APPLE_IEEE 0 +#define wxUSE_FILE 0 +#define wxUSE_TEXTFILE 0 +#define wxUSE_INTL 0 +#define wxUSE_MENUS 0 +#define wxUSE_TOOLBAR 0 +#define wxUSE_TOOLBAR_NATIVE 0 +#define wxUSE_TOOLBAR_SIMPLE 0 +#define wxUSE_NOTEBOOK 0 +#define wxUSE_FONTMAP 0 +#define wxUSE_MIMETYPE 0 + +#define wxUSE_BUTTON 0 +#define wxUSE_BMPBUTTON 0 +#define wxUSE_CARET 0 +#define wxUSE_CHECKBOX 0 +#define wxUSE_CHECKLISTBOX 0 +#define wxUSE_CHOICE 0 +#define wxUSE_COMBOBOX 0 +#define wxUSE_GAUGE 0 +#define wxUSE_LISTBOX 0 +#define wxUSE_LISTCTRL 0 +#define wxUSE_RADIOBOX 0 +#define wxUSE_RADIOBTN 0 +#define wxUSE_SASH 0 +#define wxUSE_SCROLLBAR 0 +#define wxUSE_SLIDER 0 +#define wxUSE_SPINBTN 0 +#define wxUSE_SPINCTRL 0 +#define wxUSE_STATLINE 0 +#define wxUSE_STATTEXT 0 +#define wxUSE_STATLBMP 0 +#define wxUSE_STATUSBAR 0 +#define wxUSE_TOOLTIPS 0 +#define wxUSE_TREECTRL 0 + +#define wxUSE_NATIVE_STATUSBAR 0 +#define wxUSE_BUTTONBAR 0 +#define wxUSE_GRID 0 +#define wxUSE_NEW_GRID 0 +#define wxUSE_VALIDATORS 0 +#define wxUSE_ACCEL 0 +#define wxUSE_GENERIC_DIALOGS_IN_MSW 0 +#define wxUSE_COMMON_DIALOGS 0 +#define wxUSE_TEXTDLG 0 +#define wxUSE_PROGRESSDLG 0 +#define wxUSE_BUSYINFO 0 +#define wxUSE_DIRDLG 0 +#define wxUSE_FONTDLG 0 +#define wxUSE_FILEDLG 0 +#define wxUSE_TEXTDLG 0 +#define wxUSE_CHOICEDLG 0 +#define wxUSE_NUMBERDLG 0 +#define wxUSE_STARTUP_TIPS 0 + +#define wxUSE_METAFILE 0 +#define wxUSE_ENH_METAFILE 0 +#define wxUSE_WIN_METAFILES_ALWAYS 0 +#define wxUSE_DOC_VIEW_ARCHITECTURE 0 +#define wxUSE_MDI_ARCHITECTURE 0 +#define wxUSE_PRINTING_ARCHITECTURE 0 +#define wxUSE_HTML 0 +#define wxUSE_PLOT 0 +#define wxUSE_GLCANVAS 0 +#define wxUSE_TREELAYOUT 0 +#define wxUSE_IPC 0 +#define wxUSE_HELP 0 +#define wxUSE_MS_HTML_HELP 0 +#define wxUSE_RESOURCES 0 +#define wxUSE_CONSTRAINTS 0 +#define wxUSE_CLIPBOARD 0 +#define wxUSE_SPLINES 0 +#define wxUSE_DRAG_AND_DROP 0 +#define wxUSE_XPM_IN_MSW 0 +#define wxUSE_IMAGE_LOADING_IN_MSW 0 +#define wxUSE_RESOURCE_LOADING_IN_MSW 0 +#define wxUSE_WX_RESOURCES 0 +#define wxUSE_POSTSCRIPT 0 +#define wxUSE_AFM_FOR_POSTSCRIPT 0 +#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 +#define wxUSE_ODBC 0 +#define wxODBC_FWD_ONLY_CURSORS 0 +#define wxODBC_BACKWARD_COMPATABILITY 0 +#define REMOVE_UNUSED_ARG 1 +#define wxUSE_IOSTREAMH 0 +#define wxUSE_LIBPNG 0 +#define wxUSE_LIBJPEG 0 +#define wxUSE_LIBTIFF 0 +#define wxUSE_GIF 0 +#define wxUSE_PNM 0 +#define wxUSE_PCX 0 +#define wxUSE_MFC 0 +#define wxUSE_OLE 0 +#define wxUSE_CTL3D 0 +#define wxUSE_ITSY_BITSY 0 +#define wxUSE_DYNAMIC_CLASSES 1 + +#endif // _WX_UNIV_SETUP_H_ diff --git a/include/wx/univ/theme.h b/include/wx/univ/theme.h new file mode 100644 index 0000000000..ee51f43238 --- /dev/null +++ b/include/wx/univ/theme.h @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/univ/theme.h +// Purpose: wxTheme class manages all configurable aspects of the +// application including the look (wxRenderer), feel +// (wxInputHandler) and the colours (wxColourScheme) +// Author: Vadim Zeitlin +// Modified by: +// Created: 06.08.00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vadim Zeitlin +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_UNIX_THEME_H_ +#define _WX_UNIX_THEME_H_ + +// ---------------------------------------------------------------------------- +// wxTheme +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxRenderer; +class WXDLLEXPORT wxInputHandler; +class WXDLLEXPORT wxColourScheme; + +class WXDLLEXPORT wxTheme +{ +public: + virtual wxRenderer *GetRenderer() = 0; + virtual wxInputHandler *GetInputHandler() = 0; + virtual wxColourScheme *GetColourScheme() = 0; +}; + +// ---------------------------------------------------------------------------- +// global variables +// ---------------------------------------------------------------------------- + +extern WXDLLEXPORT_DATA(wxTheme *) wxTheTheme; + +#endif // _WX_UNIX_THEME_H_ + diff --git a/include/wx/univ/window.h b/include/wx/univ/window.h new file mode 100644 index 0000000000..095ddd45d0 --- /dev/null +++ b/include/wx/univ/window.h @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/univ/window.h +// Purpose: wxUniversalWindow class which is the base class for all +// wxUniv port controls, it supports the customization of the +// window drawing and input processing. +// Author: Vadim Zeitlin +// Modified by: +// Created: 06.08.00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vadim Zeitlin +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_UNIX_WINDOW_H_ +#define _WX_UNIX_WINDOW_H_ + +#ifdef __GNUG__ + #pragma interface "univwindow.h" +#endif + +class WXDLLEXPORT wxRenderer; + +// ---------------------------------------------------------------------------- +// wxUniversalWindow +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxUniversalWindow : public wxWindow +{ +public: + // ctor + wxUniversalWindow(wxWindowBase *parent, + wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxPanelNameStr) + : wxWindow(parent, id, pos, size, style, validator, name) + { } + +protected: + // draw the controls contents: the base class version draws the border as + // required (depending on the window style flags and enabled state) and + // adjusts the DC so that subsequent drawing is clipped to the area inside + // the border + virtual void DoDraw(wxDC& dc, wxRenderer *renderer); + + // event handlers + void OnPaint(wxPaintEvent& event); + +private: + DECLARE_EVENT_TABLE() +}; + +#endif // _WX_UNIX_WINDOW_H_ diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index 7a773543f0..4142ae4d6c 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -15,18 +15,17 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/module.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_MIMETYPE + #ifndef WX_PRECOMP - #include "wx/defs.h" + #include "wx/module.h" #endif -#if (wxUSE_FILE && wxUSE_TEXTFILE) || defined(__WXMSW__) - #ifndef WX_PRECOMP #include "wx/string.h" #if wxUSE_GUI @@ -34,9 +33,6 @@ #endif #endif //WX_PRECOMP -// Doesn't compile in WIN16 mode -#ifndef __WIN16__ - #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" @@ -361,19 +357,13 @@ public: void OnExit() { // this avoids false memory leak allerts: if (gs_mimeTypesManager.m_impl != NULL) - { - delete gs_mimeTypesManager.m_impl; - gs_mimeTypesManager.m_impl = NULL; - } + { + delete gs_mimeTypesManager.m_impl; + gs_mimeTypesManager.m_impl = NULL; + } } }; IMPLEMENT_DYNAMIC_CLASS(wxMimeTypeCmnModule, wxModule) - - -#endif - // wxUSE_FILE && wxUSE_TEXTFILE - -#endif - // __WIN16__ +#endif // wxUSE_MIMETYPE diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index e5b40ea968..f7ecd01084 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: bmpbuttn.cpp +// Name: src/msw/bmpbuttn.cpp // Purpose: wxBitmapButton // Author: Julian Smart // Modified by: @@ -17,9 +17,11 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_BMPBUTTN + #ifndef WX_PRECOMP #include "wx/bmpbuttn.h" #include "wx/log.h" @@ -384,3 +386,5 @@ void wxBitmapButton::SetDefault() { wxButton::SetDefault(); } + +#endif // wxUSE_BMPBUTTN diff --git a/src/msw/button.cpp b/src/msw/button.cpp index d58fda1ac6..1934af73b9 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_BMPBUTTN + #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/brush.h" @@ -524,3 +526,5 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) } #endif // __WIN32__ + +#endif // wxUSE_BMPBUTTN diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index c838a433cb..065120a8ef 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_CHECKBOX + #ifndef WX_PRECOMP #include "wx/checkbox.h" #include "wx/brush.h" @@ -269,3 +271,5 @@ void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap) { wxFAIL_MSG(wxT("not implemented")); } + +#endif // wxUSE_CHECKBOX diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 87f286d943..d32b2d6f94 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_CHOICE + #ifndef WX_PRECOMP #include "wx/choice.h" #include "wx/utils.h" @@ -370,4 +372,4 @@ WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, return (WXHBRUSH)brush->GetResourceHandle(); } - +#endif // wxUSE_CHOICE diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 656d3f45c2..52c54e546b 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: control.cpp +// Name: msw/control.cpp // Purpose: wxControl class // Author: Julian Smart // Modified by: @@ -10,20 +10,22 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "control.h" + #pragma implementation "control.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_CONTROLS + #ifndef WX_PRECOMP -#include "wx/event.h" -#include "wx/app.h" -#include "wx/dcclient.h" + #include "wx/event.h" + #include "wx/app.h" + #include "wx/dcclient.h" #endif #include "wx/control.h" @@ -297,3 +299,4 @@ void wxFindMaxSize(WXHWND wnd, RECT *rect) rect->bottom = bottom; } +#endif // wxUSE_CONTROLS diff --git a/src/msw/data.cpp b/src/msw/data.cpp index 0a9c7286a2..7e863a33d3 100644 --- a/src/msw/data.cpp +++ b/src/msw/data.cpp @@ -87,7 +87,10 @@ wxCursor *wxHOURGLASS_CURSOR = NULL; wxCursor *wxCROSS_CURSOR = NULL; // 'Null' objects +#if wxUSE_ACCEL wxAcceleratorTable wxNullAcceleratorTable; +#endif // wxUSE_ACCEL + wxBitmap wxNullBitmap; wxIcon wxNullIcon; wxCursor wxNullCursor; diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index fed0b69a8b..3ecc08798e 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -16,6 +16,7 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- + #ifdef __GNUG__ #pragma implementation "dirdlg.h" #endif @@ -27,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_DIRDLG + #if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) #ifndef WX_PRECOMP @@ -182,3 +185,5 @@ static void ItemListFree(LPITEMIDLIST pidl) #else #include "../generic/dirdlgg.cpp" #endif // compiler/platform on which the code here compiles + +#endif // wxUSE_DIRDLG diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index d60e69d885..7f4912030d 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -23,12 +23,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/msw/private.h" #ifdef __BORLANDC__ #pragma hdrstop #endif +#if wxUSE_DRAGIMAG + #if defined(__WIN95__) #ifndef WX_PRECOMP @@ -41,6 +42,7 @@ #include "wx/settings.h" #endif +#include "wx/msw/private.h" #include "wx/log.h" #include "wx/intl.h" #include "wx/frame.h" @@ -376,3 +378,4 @@ bool wxDragImage::Hide() #endif // __WIN95__ +#endif // wxUSE_DRAGIMAG diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index cf25db47e6..1c59258492 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_FILEDLG + #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/msgdlg.h" @@ -512,4 +514,5 @@ WXDLLEXPORT wxString wxSaveFileSelector(const wxChar *what, return wxDefaultFileSelector(FALSE, what, extension, default_name, parent); } +#endif // wxUSE_FILEDLG diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp index 75acaeeea3..e4ece8a233 100644 --- a/src/msw/fontdlg.cpp +++ b/src/msw/fontdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.cpp +// Name: src/msw/fontdlg.cpp // Purpose: wxFontDialog class // Author: Julian Smart // Modified by: @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_FONTDLG + #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/utils.h" @@ -156,3 +158,5 @@ int wxFontDialog::ShowModal() return wxID_CANCEL; } } + +#endif // wxUSE_FONTDLG diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index 1747efcaaf..93a0d4e742 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_FONTMAP + #ifndef WX_PRECOMP #include "wx/font.h" #endif @@ -258,3 +260,4 @@ int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm, return fontEnum->OnFont(lplf, lptm); } +#endif // wxUSE_FONTMAP diff --git a/src/msw/fontutil.cpp b/src/msw/fontutil.cpp index a5b4de99d7..2086026095 100644 --- a/src/msw/fontutil.cpp +++ b/src/msw/fontutil.cpp @@ -371,7 +371,9 @@ void wxFillLogFont(LOGFONT *logFont, const wxFont *font) wxFontEncoding encoding = font->GetEncoding(); if ( !wxGetNativeFontEncoding(encoding, &info) ) { +#if wxUSE_FONTMAP if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) ) +#endif // wxUSE_FONTMAP { // unsupported encoding, replace with the default info.charset = ANSI_CHARSET; diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 5b46e6c7c6..64820c7467 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -62,7 +62,10 @@ extern wxWindowList wxModelessWindows; extern wxList WXDLLEXPORT wxPendingDelete; extern const wxChar *wxFrameClassName; + +#if wxUSE_MENUS extern wxMenu *wxCurrentPopupMenu; +#endif // wxUSE_MENUS // ---------------------------------------------------------------------------- // event tables @@ -83,11 +86,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) // static class members // ---------------------------------------------------------------------------- -#if wxUSE_NATIVE_STATUSBAR - bool wxFrame::m_useNativeStatusBar = TRUE; -#else - bool wxFrame::m_useNativeStatusBar = FALSE; -#endif +#if wxUSE_STATUSBAR + #if wxUSE_NATIVE_STATUSBAR + bool wxFrame::m_useNativeStatusBar = TRUE; + #else + bool wxFrame::m_useNativeStatusBar = FALSE; + #endif +#endif // wxUSE_NATIVE_STATUSBAR // ---------------------------------------------------------------------------- // creation/destruction @@ -127,9 +132,15 @@ bool wxFrame::Create(wxWindow *parent, { SetName(name); m_windowStyle = style; +#if wxUSE_MENUS m_frameMenuBar = NULL; +#endif // wxUSE_MENUS +#if wxUSE_TOOLBAR m_frameToolBar = NULL; +#endif // wxUSE_TOOLBAR +#if wxUSE_STATUSBAR m_frameStatusBar = NULL; +#endif // wxUSE_STATUSBAR SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); @@ -417,15 +428,18 @@ void wxFrame::PositionStatusBar() void wxFrame::DetachMenuBar() { +#if wxUSE_MENUS if ( m_frameMenuBar ) { m_frameMenuBar->Detach(); m_frameMenuBar = NULL; } +#endif // wxUSE_MENUS } void wxFrame::SetMenuBar(wxMenuBar *menubar) { +#if wxUSE_MENUS if ( !menubar ) { DetachMenuBar(); @@ -461,6 +475,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menubar) m_frameMenuBar = menubar; menubar->Attach(this); } +#endif // wxUSE_MENUS } void wxFrame::InternalSetMenuBar() @@ -477,12 +492,14 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); Refresh(); +#if wxUSE_STATUSBAR if ( m_frameStatusBar ) { wxSysColourChangedEvent event2; event2.SetEventObject( m_frameStatusBar ); m_frameStatusBar->GetEventHandler()->ProcessEvent(event2); } +#endif // wxUSE_STATUSBAR // Propagate the event to the non-top-level children wxWindow::OnSysColourChanged(event); @@ -499,15 +516,10 @@ bool wxFrame::ShowFullScreen(bool show, long style) m_fsIsShowing = TRUE; m_fsStyle = style; +#if wxUSE_TOOLBAR wxToolBar *theToolBar = GetToolBar(); - wxStatusBar *theStatusBar = GetStatusBar(); - - int dummyWidth; - if (theToolBar) - theToolBar->GetSize(&dummyWidth, &m_fsToolBarHeight); - if (theStatusBar) - theStatusBar->GetSize(&dummyWidth, &m_fsStatusBarHeight); + theToolBar->GetSize(NULL, &m_fsToolBarHeight); // zap the toolbar, menubar, and statusbar @@ -516,10 +528,16 @@ bool wxFrame::ShowFullScreen(bool show, long style) theToolBar->SetSize(-1,0); theToolBar->Show(FALSE); } +#endif // wxUSE_TOOLBAR if (style & wxFULLSCREEN_NOMENUBAR) SetMenu((HWND)GetHWND(), (HMENU) NULL); +#if wxUSE_STATUSBAR + wxStatusBar *theStatusBar = GetStatusBar(); + if (theStatusBar) + theStatusBar->GetSize(NULL, &m_fsStatusBarHeight); + // Save the number of fields in the statusbar if ((style & wxFULLSCREEN_NOSTATUSBAR) && theStatusBar) { @@ -529,6 +547,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) } else m_fsStatusBarFields = 0; +#endif // wxUSE_STATUSBAR // zap the frame borders @@ -578,6 +597,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) m_fsIsShowing = FALSE; +#if wxUSE_TOOLBAR wxToolBar *theToolBar = GetToolBar(); // restore the toolbar, menubar, and statusbar @@ -586,12 +606,15 @@ bool wxFrame::ShowFullScreen(bool show, long style) theToolBar->SetSize(-1, m_fsToolBarHeight); theToolBar->Show(TRUE); } +#endif // wxUSE_TOOLBAR +#if wxUSE_STATUSBAR if ((m_fsStyle & wxFULLSCREEN_NOSTATUSBAR) && (m_fsStatusBarFields > 0)) { CreateStatusBar(m_fsStatusBarFields); PositionStatusBar(); } +#endif // wxUSE_STATUSBAR if ((m_fsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0)) SetMenu((HWND)GetHWND(), (HMENU)m_hMenu); @@ -799,7 +822,11 @@ void wxFrame::IconizeChildFrames(bool bIconize) // the child MDI frames are a special case and should not be touched by // the parent frame - instead, they are managed by the user wxFrame *frame = wxDynamicCast(win, wxFrame); - if ( frame && !wxDynamicCast(frame, wxMDIChildFrame) ) + if ( frame +#if wxUSE_MDI_ARCHITECTURE + && !wxDynamicCast(frame, wxMDIChildFrame) +#endif // wxUSE_MDI_ARCHITECTURE + ) { frame->Iconize(bIconize); } @@ -819,6 +846,7 @@ bool wxFrame::MSWTranslateMessage(WXMSG* pMsg) if ( wxWindow::MSWTranslateMessage(pMsg) ) return TRUE; +#if wxUSE_MENUS // try the menu bar accels wxMenuBar *menuBar = GetMenuBar(); if ( !menuBar ) @@ -826,6 +854,9 @@ bool wxFrame::MSWTranslateMessage(WXMSG* pMsg) const wxAcceleratorTable& acceleratorTable = menuBar->GetAccelTable(); return acceleratorTable.Translate(this, pMsg); +#else + return FALSE; +#endif // wxUSE_MENUS } // --------------------------------------------------------------------------- @@ -913,8 +944,13 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) if ( !m_iconized ) { +#if wxUSE_STATUSBAR PositionStatusBar(); +#endif // wxUSE_STATUSBAR + +#if wxUSE_TOOLBAR PositionToolBar(); +#endif // wxUSE_TOOLBAR wxSizeEvent event(wxSize(x, y), m_windowId); event.SetEventObject( this ); @@ -937,6 +973,7 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) // handle here commands from menus and accelerators if ( cmd == 0 || cmd == 1 ) { +#if wxUSE_MENUS if ( wxCurrentPopupMenu ) { wxMenu *popupMenu = wxCurrentPopupMenu; @@ -944,6 +981,7 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) return popupMenu->MSWCommand(cmd, id); } +#endif // wxUSE_MENUS if ( ProcessCommand(id) ) { @@ -968,6 +1006,7 @@ bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) } else { +#if wxUSE_STATUSBAR // don't give hints for separators (doesn't make sense) nor for the // items opening popup menus (they don't have them anyhow) but do clear // the status line - otherwise, we would be left with the help message @@ -977,6 +1016,7 @@ bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) { statbar->SetStatusText(wxEmptyString); } +#endif // wxUSE_STATUSBAR return FALSE; } diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 3594e49841..f4b4b0fe15 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: listbox.cpp +// Name: src/msw/listbox.cpp // Purpose: wxListBox // Author: Julian Smart // Modified by: Vadim Zeitlin (owner drawn stuff) @@ -20,8 +20,7 @@ #pragma hdrstop #endif -#include "wx/window.h" -#include "wx/msw/private.h" +#if wxUSE_LISTBOX #ifndef WX_PRECOMP #include "wx/listbox.h" @@ -32,6 +31,9 @@ #include "wx/utils.h" #endif +#include "wx/window.h" +#include "wx/msw/private.h" + #include #ifdef __WXWINE__ @@ -771,5 +773,6 @@ bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) (wxOwnerDrawn::wxODStatus)pStruct->itemState); } -#endif - // wxUSE_OWNER_DRAWN +#endif // wxUSE_OWNER_DRAWN + +#endif // wxUSE_LISTBOX diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index cbe91c8878..f0b061f43a 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -29,6 +29,8 @@ #pragma hdrstop #endif +#if wxUSE_LISTCTRL + #ifdef __WIN95__ #ifndef WX_PRECOMP @@ -1872,3 +1874,4 @@ wxListEvent::wxListEvent(wxEventType commandType, int id) #endif // __WIN95__ +#endif // wxUSE_LISTCTRL diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 48b0b30706..562da0ff58 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_MENUS + #ifndef WX_PRECOMP #include "wx/frame.h" #include "wx/menu.h" @@ -872,3 +874,4 @@ wxMenuItem *wxMenuBar::FindItem(int id, wxMenu **itemMenu) const return item; } +#endif // wxUSE_MENUS diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index e281013c2d..cdada0314a 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_MENUS + #ifndef WX_PRECOMP #include "wx/font.h" #include "wx/bitmap.h" @@ -272,3 +274,5 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, { return new wxMenuItem(parentMenu, id, name, help, isCheckable, subMenu); } + +#endif // wxUSE_MENUS diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 4ca0315ec2..d467a6b38d 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_MIMETYPE + // Doesn't compile in WIN16 mode #ifndef __WIN16__ @@ -443,3 +445,5 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) #endif // __WIN16__ + +#endif // wxUSE_MIMETYPE diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index b8ac425b2e..37518769d6 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -17,9 +17,11 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_NOTEBOOK + // wxWindows #ifndef WX_PRECOMP #include "wx/string.h" @@ -659,3 +661,5 @@ void wxNotebook::ChangePage(int nOldSel, int nSel) s_bInsideChangePage = FALSE; } + +#endif // wxUSE_NOTEBOOK diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index a5c49e721b..4a0cee54e0 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_OLE + #include "wx/defs.h" // Watcom C++ gives a linker error if this is compiled in. @@ -1171,3 +1173,4 @@ void ShowException(LPOLESTR szMember, HRESULT hr, EXCEPINFO *pexcep, unsigned in #endif // __WATCOMC__ +#endif // wxUSE_OLE diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 529c46dbd3..362638c1ac 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_RADIOBOX + #ifndef WX_PRECOMP #include "wx/bitmap.h" #include "wx/brush.h" @@ -1032,3 +1034,4 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, #endif // __WIN32__ +#endif // wxUSE_RADIOBOX diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index a9a7705f60..f8f1d8b12a 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.cpp +// Name: msw/radiobut.cpp // Purpose: wxRadioButton // Author: Julian Smart // Modified by: @@ -10,22 +10,22 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "radiobut.h" + #pragma implementation "radiobut.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_RADIOBTN + #ifndef WX_PRECOMP -#include -#include "wx/setup.h" -#include "wx/radiobut.h" -#include "wx/settings.h" -#include "wx/brush.h" + #include "wx/radiobut.h" + #include "wx/settings.h" + #include "wx/brush.h" #endif #include "wx/msw/private.h" @@ -270,3 +270,5 @@ bool wxBitmapRadioButton::GetValue(void) const } #endif + +#endif // wxUSE_RADIOBTN diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 007c98067f..c0daf19a96 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.cpp +// Name: msw/scrolbar.cpp // Purpose: wxScrollBar // Author: Julian Smart // Modified by: @@ -10,19 +10,20 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "scrolbar.h" + #pragma implementation "scrolbar.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_SCROLLBAR + #ifndef WX_PRECOMP -#include "wx/defs.h" -#include "wx/utils.h" + #include "wx/utils.h" #endif #include "wx/scrolbar.h" @@ -352,3 +353,5 @@ void wxScrollBar::OnScroll(wxScrollEvent& event) } } #endif + +#endif // wxUSE_SCROLLBAR diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 77cf291c9f..4a971cf9ba 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -20,8 +20,9 @@ #pragma hdrstop #endif +#if wxUSE_SLIDER + #ifndef WX_PRECOMP -#include #include "wx/utils.h" #include "wx/brush.h" #endif @@ -637,3 +638,4 @@ bool wxSlider95::Show(bool show) #endif // __WIN95__ +#endif // wxUSE_SLIDER diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index fd9dd5db30..f532e3b46f 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_STATBMP + #include "wx/window.h" #include "wx/msw/private.h" @@ -266,3 +268,4 @@ long wxStaticBitmap::MSWWindowProc(WXUINT nMsg, return wxWindow::MSWWindowProc(nMsg, wParam, lParam); } +#endif // wxUSE_STATBMP diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 40c1fc0aa4..85ed4a9ade 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_STATBOX + #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/dcclient.h" @@ -115,3 +117,4 @@ long wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) return wxControl::MSWWindowProc(nMsg, wParam, lParam); } +#endif // wxUSE_STATBOX diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index 82b2a21745..fe67293ab5 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_STATTEXT + #ifndef WX_PRECOMP #include "wx/event.h" #include "wx/app.h" @@ -158,4 +160,4 @@ long wxStaticText::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) return wxWindow::MSWWindowProc(nMsg, wParam, lParam); } - +#endif // wxUSE_STATTEXT diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 82f29026b7..63c217bdaf 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_TEXTCTRL + #ifndef WX_PRECOMP #include "wx/textctrl.h" #include "wx/settings.h" @@ -1253,3 +1255,4 @@ bool wxRichEditModule::Load(int version) #endif // wxUSE_RICHEDIT +#endif // wxUSE_TEXTCTRL diff --git a/src/msw/timer.cpp b/src/msw/timer.cpp index 7d994c9938..e999fd6924 100644 --- a/src/msw/timer.cpp +++ b/src/msw/timer.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_TIMER + #ifndef WX_PRECOMP #include "wx/setup.h" #include "wx/window.h" @@ -136,3 +138,5 @@ UINT WINAPI _EXPORT wxTimerProc(HWND WXUNUSED(hwnd), WORD, int idTimer, DWORD) return 0; } + +#endif // wxUSE_TIMER diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 80a4517527..449aaad4ae 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.cpp +// Name: src/msw/treectrl.cpp // Purpose: wxTreeCtrl // Author: Julian Smart // Modified by: Vadim Zeitlin to be less MSW-specific on 10.10.98 @@ -16,6 +16,7 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- + #ifdef __GNUG__ #pragma implementation "treectrl.h" #endif @@ -27,9 +28,12 @@ #pragma hdrstop #endif +#if wxUSE_TREECTRL + #include "wx/msw/private.h" -// Set this to 1 to be _absolutely_ sure that repainting will work for all comctl32.dll versions +// Set this to 1 to be _absolutely_ sure that repainting will work for all +// comctl32.dll versions #define wxUSE_COMCTL32_SAFELY 0 // Mingw32 is a bit mental even though this is done in winundef @@ -2332,3 +2336,4 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) #endif // __WIN95__ +#endif // wxUSE_TREECTRL diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 14346f1413..e6384f11d4 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -51,8 +51,6 @@ extern "C" { #include "wx/timer.h" -#include - #if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) #include @@ -90,15 +88,11 @@ extern "C" { #endif #endif -#include -#include -#include #ifndef __WATCOMC__ #if !(defined(_MSC_VER) && (_MSC_VER > 800)) #include #endif #endif -#include //// BEGIN for console support: VC++ only #ifdef __VISUALC__ @@ -109,13 +103,7 @@ extern "C" { #include "wx/ioswrap.h" -#if wxUSE_IOSTREAMH -// N.B. BC++ doesn't have istream.h, ostream.h -# include -# include -#else -# include -#endif +#include "wx/ioswrap.h" /* Need to undef new if including crtdbg.h */ # ifdef new @@ -632,10 +620,12 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn) #if wxUSE_GUI +#if wxUSE_TIMER + // Sleep for nSecs seconds. Attempt a Windows implementation using timers. static bool gs_inTimer = FALSE; -class wxSleepTimer: public wxTimer +class wxSleepTimer : public wxTimer { public: virtual void Notify() @@ -651,7 +641,7 @@ void wxUsleep(unsigned long milliseconds) { #ifdef __WIN32__ ::Sleep(milliseconds); -#else +#else // !Win32 if (gs_inTimer) return; @@ -665,7 +655,7 @@ void wxUsleep(unsigned long milliseconds) } delete wxTheSleepTimer; wxTheSleepTimer = NULL; -#endif +#endif // Win32/!Win32 } void wxSleep(int nSecs) @@ -691,6 +681,8 @@ void wxFlushEvents() // wxYield(); } +#endif // wxUSE_TIMER + #elif defined(__WIN32__) // wxUSE_GUI void wxUsleep(unsigned long milliseconds) diff --git a/src/msw/wave.cpp b/src/msw/wave.cpp index 675d15c9ae..ee3b0dc645 100644 --- a/src/msw/wave.cpp +++ b/src/msw/wave.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_WAVE + #ifndef WX_PRECOMP #include "wx/wx.h" #endif @@ -165,4 +167,4 @@ bool wxWave::Free() return FALSE; } - +#endif // wxUSE_WAVE diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 98979b0466..50f3d5e42e 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -110,7 +110,10 @@ // the last Windows message we got (MT-UNSAFE) extern MSG s_currentMsg; +#if wxUSE_MENUS wxMenu *wxCurrentPopupMenu = NULL; +#endif // wxUSE_MENUS + extern wxList WXDLLEXPORT wxPendingDelete; extern const wxChar *wxCanvasClassName; @@ -162,6 +165,7 @@ END_EVENT_TABLE() // Find an item given the MS Windows id wxWindow *wxWindow::FindItem(long id) const { +#if wxUSE_CONTROLS wxControl *item = wxDynamicCast(this, wxControl); if ( item ) { @@ -172,6 +176,7 @@ wxWindow *wxWindow::FindItem(long id) const return item; } } +#endif // wxUSE_CONTROLS wxWindowList::Node *current = GetChildren().GetFirst(); while (current) @@ -201,7 +206,11 @@ wxWindow *wxWindow::FindItemByHWND(WXHWND hWnd, bool controlOnly) const if ( wnd ) return wnd; - if ( !controlOnly || parent->IsKindOf(CLASSINFO(wxControl)) ) + if ( !controlOnly +#if wxUSE_CONTROLS + || parent->IsKindOf(CLASSINFO(wxControl)) +#endif // wxUSE_CONTROLS + ) { wxWindow *item = current->GetData(); if ( item->GetHWND() == hWnd ) @@ -881,7 +890,11 @@ WXDWORD wxWindow::Determine3DEffects(WXDWORD defaultBorderStyle, { // If matches certain criteria, then assume no 3D effects // unless specifically requested (dealt with in MakeExtendedStyle) - if ( !GetParent() || !IsKindOf(CLASSINFO(wxControl)) || (m_windowStyle & wxNO_BORDER) ) + if ( !GetParent() +#if wxUSE_CONTROLS + || !IsKindOf(CLASSINFO(wxControl)) +#endif // wxUSE_CONTROLS + || (m_windowStyle & wxNO_BORDER) ) { *want3D = FALSE; return MakeExtendedStyle(m_windowStyle, FALSE); @@ -1447,6 +1460,8 @@ void wxWindow::GetCaretPos(int *x, int *y) const // popup menu // --------------------------------------------------------------------------- +#if wxUSE_MENUS + bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) { menu->SetInvokingWindow(this); @@ -1468,6 +1483,8 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) return TRUE; } +#endif // wxUSE_MENUS + // =========================================================================== // pre/post message processing // =========================================================================== @@ -1558,6 +1575,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) // buttons want process Enter themselevs bProcess = FALSE; } +#if wxUSE_BUTTON else { wxPanel *panel = wxDynamicCast(this, wxPanel); @@ -1580,6 +1598,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) // it work like a TAB - and that's what we do. // Note that Ctrl-Enter always works this way. } +#endif // wxUSE_BUTTON } break; @@ -1596,12 +1615,14 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) if ( GetEventHandler()->ProcessEvent(event) ) { +#if wxUSE_BUTTON wxButton *btn = wxDynamicCast(FindFocus(), wxButton); if ( btn ) { // the button which has focus should be default btn->SetDefault(); } +#endif // wxUSE_BUTTON return TRUE; } @@ -1659,7 +1680,11 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) bool wxWindow::MSWTranslateMessage(WXMSG* pMsg) { +#if wxUSE_ACCEL return m_acceleratorTable.Translate(this, pMsg); +#else + return FALSE; +#endif // wxUSE_ACCEL } // --------------------------------------------------------------------------- @@ -2778,6 +2803,8 @@ bool wxWindow::HandleSetCursor(WXHWND hWnd, bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct) { #if wxUSE_OWNER_DRAWN + +#if wxUSE_MENUS // is it a menu item? if ( id == 0 ) { @@ -2800,12 +2827,16 @@ bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct) (wxOwnerDrawn::wxODStatus)pDrawStruct->itemState ); } +#endif // wxUSE_MENUS +#if wxUSE_CONTROLS wxWindow *item = FindItem(id); if ( item && item->IsKindOf(CLASSINFO(wxControl)) ) { return ((wxControl *)item)->MSWOnDraw(itemStruct); } +#endif // wxUSE_CONTROLS + #endif // USE_OWNER_DRAWN return FALSE; @@ -2861,12 +2892,14 @@ bool wxWindow::HandleCtlColor(WXHBRUSH *brush, { hBrush = OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam); } +#if wxUSE_CONTROLS else { wxControl *item = (wxControl *)FindItemByHWND(pWnd, TRUE); if ( item ) hBrush = item->OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam); } +#endif // wxUSE_CONTROLS if ( hBrush ) *brush = hBrush; @@ -3096,6 +3129,7 @@ void wxWindow::SendSizeEvent() bool wxWindow::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) { +#if wxUSE_MENUS if ( wxCurrentPopupMenu ) { wxMenu *popupMenu = wxCurrentPopupMenu; @@ -3103,6 +3137,7 @@ bool wxWindow::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) return popupMenu->MSWCommand(cmd, id); } +#endif // wxUSE_MENUS wxWindow *win = (wxWindow*) NULL; if ( cmd == 0 || cmd == 1 ) // menu or accel - use id diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp new file mode 100644 index 0000000000..fe3e1a67a2 --- /dev/null +++ b/src/univ/themes/win32.cpp @@ -0,0 +1,245 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: univ/themes/win32.cpp +// Purpose: wxUniversal theme implementing Win32-like LNF +// Author: Vadim Zeitlin +// Modified by: +// Created: 06.08.00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vadim Zeitlin +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +// =========================================================================== +// declarations +// =========================================================================== + +// --------------------------------------------------------------------------- +// headers +// --------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#endif // WX_PRECOMP + +// ---------------------------------------------------------------------------- +// private classes +// ---------------------------------------------------------------------------- + +class wxWin32Renderer : public wxRenderer +{ +public: + // implement the base class pure virtuals + virtual void DrawLabel(wxDC& dc, wxWindow *window); + virtual void DrawBorder(wxDC& dc, wxWindow *window); + +protected: + // DrawBorder() helpers: all of them shift and clip the DC after drawing + // the border + + // just draw a rectangle with the given pen + void DrawRect(wxDC& dc, wxCoord x, wxCoord y, const wxPen& pen); + + // draw the lower left part of rectangle + void DrawHalfRect(wxDC& dc, wxCoord x, wxCoord y, const wxPen& pen); + + // draw the rectange using the first brush for the left and top sides and + // the second one for the bottom and right ones + void DrawShadedRect(wxDC& dc, wxCoord x, wxCoord y, + const wxPen& pen1, const wxPen& pen2); + + // draw the normal 3D border + void DrawRaisedBorder(wxDC& dc, wxCoord x, wxCoord y); +}; + +class wxWin32Theme : public wxTheme +{ +public: + wxWin32Theme(); + + virtual wxRenderer *GetRenderer() { return m_renderer; } + virtual wxInputHandler *GetInputHandler() { return m_handler; } + virtual wxColourScheme *GetColourScheme() { return m_scheme; } + +private: + wxWin32Renderer *m_renderer; + wxWin32InputHandler *m_handler; + wxWin32ColourScheme *m_scheme; +}; + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// wxWin32Theme +// ---------------------------------------------------------------------------- + +wxWin32Theme::wxWin32Theme() +{ + m_renderer = new wxWin32Renderer; +} + +// ---------------------------------------------------------------------------- +// wxWin32Renderer +// ---------------------------------------------------------------------------- + +// construction +wxWin32Renderer::wxWin32Renderer() +{ + m_penBlack = new wxPen("BLACK"); + m_penDarkGrey = new wxPen("GREY"); + m_penLightGrey = new wxPen("LIGHT GREY"); + m_penWhite = new wxPen("WHITE"); +} + +/* + The normal (== raised) border in Win32 looks like this: + + WWWWWWWWWWWWWWWWWWWWWWB + W GB + W GB W = white (HILIGHT) + W GB H = light grey (LIGHT) + W GB G = dark grey (SHADOW) + W GB B = black (DKSHADOW) + W GB + W GB + WGGGGGGGGGGGGGGGGGGGGGB + BBBBBBBBBBBBBBBBBBBBBBB + + The sunken border looks like this: + + GGGGGGGGGGGGGGGGGGGGGGW + GBBBBBBBBBBBBBBBBBBBBHW + GB HW + GB HW + GB HW + GB HW + GB HW + GB HW + GHHHHHHHHHHHHHHHHHHHHHW + WWWWWWWWWWWWWWWWWWWWWWW + + The static border (used for the controls which don't get focus) is like + this: + + GGGGGGGGGGGGGGGGGGGGGGW + G W + G W + G W + G W + G W + G W + G W + WWWWWWWWWWWWWWWWWWWWWWW + + The most complicated is the double border: + + HHHHHHHHHHHHHHHHHHHHHHB + HWWWWWWWWWWWWWWWWWWWWGB + HWHHHHHHHHHHHHHHHHHHHGB + HWH HGB + HWH HGB + HWH HGB + HWH HGB + HWHHHHHHHHHHHHHHHHHHHGB + HGGGGGGGGGGGGGGGGGGGGGB + BBBBBBBBBBBBBBBBBBBBBBB + + And the simple border is, well, simple: + + BBBBBBBBBBBBBBBBBBBBBBB + B B + B B + B B + B B + B B + B B + B B + B B + BBBBBBBBBBBBBBBBBBBBBBB +*/ + +void wxWin32Renderer::DrawRect(wxDC& dc, wxCorod x, wxCoord y, const wxPen& pen) +{ + // draw + dc.SetPen(pen); + dc.DrawRectangle(0, 0, x, y); + + // adjust + dc.SetLogicalOrigin(1, 1); + dc.SetClippingRegion(0, 0, x - 1, y - 1); +} + +void wxWin32Renderer::DrawHalfRect(wxDC& dc, wxCorod x, wxCoord y, + const wxPen& pen) +{ + // draw the bottom and right sides + dc.SetPen(pen); + dc.DrawLine(1, y, x, y); + dc.DrawLine(x, 0, x, y - 1); + + // clip the DC + dc.SetClippingRegion(0, 0, x - 1, y - 1); +} + +void wxWin32Renderer::DrawShadedRect(wxDC& dc, wxCorod x, wxCoord y, + const wxPen& pen1, const wxPen& pen2) +{ + // draw the rectangle + dc.SetPen(pen1); + dc.DrawLine(0, 0, 0, y - 1); + dc.DrawLine(1, 0, x - 1, 0); + dc.SetPen(pen2); + dc.DrawLine(x, 0, x, y); + dc.DrawLine(0, y, x - 1, y); + + // shift the DC and clip it + dc.SetLogicalOrigin(1, 1); + dc.SetClippingRegion(0, 0, x - 1, y - 1); +} + +void wxWin32Renderer::DrawRaisedBorder(wxDC& dc, wxCoord x, wxCoord y) +{ + DrawShadedRect(dc, x--, y--, m_penWhite, m_penBlack); + DrawHalfRect(dc, x, y, m_penDarkGrey); +} + +void wxWin32Renderer::DrawBorder(wxDC& dc, wxWindow *window) +{ + wxCoord x, y; + window->GetClientSize(&x, &y); + long style = window->GetWindowStyle(); + if ( style & wxSUNKEN_BORDER ) + { + DrawShadedRect(dc, x--, y--, m_penDarkGrey, m_penWhite); + DrawShadedRect(dc, x, y, m_penBlack, m_penLightGrey); + } + else if ( style & wxSTATIC_BORDER ) + { + DrawShadedRect(dc, x, y, m_penDarkGrey, m_penWhite); + } + else if ( style & wxRAISED_BORDER ) + { + DrawRaisedBorder(dc, x, y); + } + else if ( style & wxDOUBLE_BORDER ) + { + DrawShadedRect(dc, x--, y--, m_penLightGrey, m_penBlack); + DrawShadedRect(dc, x--, y--, m_penWhite, m_penDarkGrey); + DrawRect(dc, x, y, m_penLightGrey); + } + else if ( style & wxSIMPLE_BORDER ) + { + DrawRect(dc, x, y, m_penBlack); + } +} + +void wxWin32Renderer::DrawLabel(wxDC& dc, wxWindow *window) +{ +} diff --git a/src/univ/window.cpp b/src/univ/window.cpp new file mode 100644 index 0000000000..22ffc2d8f7 --- /dev/null +++ b/src/univ/window.cpp @@ -0,0 +1,61 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: univ/window.cpp +// Purpose: wxUniversalWindow implementation +// Author: Vadim Zeitlin +// Modified by: +// Created: 06.08.00 +// RCS-ID: $Id$ +// Copyright: (c) 2000 Vadim Zeitlin +// Licence: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +// =========================================================================== +// declarations +// =========================================================================== + +// --------------------------------------------------------------------------- +// headers +// --------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "univwindow.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#endif // WX_PRECOMP + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// drawing +// ---------------------------------------------------------------------------- + +// the event handler executed when the window must be repainted +void wxUniversalWindow::OnPaint(wxPaintEvent& event) +{ + // get the renderer to use + wxRenderer *renderer = wxTheTheme->GetRenderer(); + + // draw the control + wxPaintDC dc(this); + DoDraw(dc, renderer); +} + +// draw the border +void DoDrawBorder(wxRenderer *renderer, wxDC& dc, const wxRect& rect) +{ + if ( !(m_windowStyle & wxNO_BORDER) ) + { + renderer->DrawBorder(dc, this); + } +} +