From f1e01716310cb6e3bfcf5894b442d277bc32789a Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 17 May 2006 09:07:47 +0000 Subject: [PATCH] Include wx/button.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/button.mm | 3 ++- src/common/dlgcmn.cpp | 3 +-- src/generic/dirctrlg.cpp | 2 +- src/generic/logg.cpp | 10 ++++------ src/gtk/tglbtn.cpp | 10 ++++++---- src/gtk1/tglbtn.cpp | 10 ++++++---- src/mac/carbon/app.cpp | 2 +- src/mac/carbon/combobox.cpp | 6 +++++- src/mac/carbon/combobxc.cpp | 6 +++++- src/mac/carbon/control.cpp | 2 +- src/mac/carbon/listbox.cpp | 2 +- src/mac/carbon/textctrl.cpp | 2 +- src/mac/carbon/window.cpp | 2 +- src/mac/classic/app.cpp | 6 +++--- src/mac/classic/combobox.cpp | 8 +++++++- src/mac/classic/control.cpp | 2 +- src/mac/classic/listbox.cpp | 2 +- src/mac/classic/textctrl.cpp | 2 +- src/mac/classic/window.cpp | 2 +- src/motif/window.cpp | 2 +- src/msw/button.cpp | 14 +++++++------- src/msw/tglbtn.cpp | 9 ++++----- src/os2/button.cpp | 7 ++++--- src/os2/tglbtn.cpp | 7 +++---- src/palmos/button.cpp | 4 ++-- src/palmos/control.cpp | 4 ++-- src/palmos/tglbtn.cpp | 5 ++--- src/palmos/toplevel.cpp | 2 +- src/x11/window.cpp | 2 +- src/xrc/xh_bttn.cpp | 7 +++++-- 30 files changed, 81 insertions(+), 64 deletions(-) diff --git a/src/cocoa/button.mm b/src/cocoa/button.mm index 63ec84d602..0485809e1b 100644 --- a/src/cocoa/button.mm +++ b/src/cocoa/button.mm @@ -11,8 +11,9 @@ #include "wx/wxprec.h" +#include "wx/button.h" + #ifndef WX_PRECOMP - #include "wx/button.h" #include "wx/log.h" #endif diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 64011f46c7..5a1693a6a9 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/dlgcmn.cpp +// Name: src/common/dlgcmn.cpp // Purpose: common (to all ports) wxDialog functions // Author: Vadim Zeitlin // Modified by: @@ -32,7 +32,6 @@ #include "wx/settings.h" #include "wx/stattext.h" #include "wx/sizer.h" - #include "wx/button.h" #include "wx/containr.h" #endif diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 1de7b93bdf..b74aeec22a 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -25,10 +25,10 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/utils.h" + #include "wx/button.h" #endif #include "wx/module.h" -#include "wx/button.h" #include "wx/layout.h" #include "wx/msgdlg.h" #include "wx/textctrl.h" diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index fd7f2a25b2..b776065130 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -22,7 +22,7 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP @@ -37,7 +37,6 @@ #include "wx/textctrl.h" #include "wx/sizer.h" #include "wx/statbmp.h" - #include "wx/button.h" #include "wx/settings.h" #endif // WX_PRECOMP @@ -49,12 +48,12 @@ #include "wx/artprov.h" #ifdef __WXMSW__ - // for OutputDebugString() - #include "wx/msw/private.h" + // for OutputDebugString() + #include "wx/msw/private.h" #endif // Windows #ifdef __WXPM__ - #include + #include #endif #if wxUSE_LOG_DIALOG @@ -1217,4 +1216,3 @@ void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) } #endif // wxUSE_LOG && wxUSE_TEXTCTRL - diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 9b9d064259..abadbcc404 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/gtk/tglbtn.cpp +// Name: src/gtk/tglbtn.cpp // Purpose: Definition of the wxToggleButton class, which implements a // toggle button under wxGTK. // Author: John Norris, minor changes by Axel Schlueter @@ -13,10 +13,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_TOGGLEBTN + #include "wx/tglbtn.h" -#include "wx/button.h" -#if wxUSE_TOGGLEBTN +#ifndef WX_PRECOMP + #include "wx/button.h" +#endif // FIXME: Use GtkImage instead of GtkPixmap. #include @@ -362,4 +365,3 @@ wxToggleButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) } #endif // wxUSE_TOGGLEBTN - diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp index d8696cb8a5..78b4a596c9 100644 --- a/src/gtk1/tglbtn.cpp +++ b/src/gtk1/tglbtn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/gtk1/tglbtn.cpp +// Name: src/gtk1/tglbtn.cpp // Purpose: Definition of the wxToggleButton class, which implements a // toggle button under wxGTK. // Author: John Norris, minor changes by Axel Schlueter @@ -13,10 +13,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_TOGGLEBTN + #include "wx/tglbtn.h" -#include "wx/button.h" -#if wxUSE_TOGGLEBTN +#ifndef WX_PRECOMP + #include "wx/button.h" +#endif #include "wx/gtk1/private.h" @@ -358,4 +361,3 @@ wxToggleButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) } #endif // wxUSE_TOGGLEBTN - diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index d293624354..2527374184 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -20,9 +20,9 @@ #include "wx/window.h" #include "wx/frame.h" #include "wx/dc.h" + #include "wx/button.h" #endif -#include "wx/button.h" #include "wx/gdicmn.h" #include "wx/pen.h" #include "wx/brush.h" diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 35a4521168..54d864df0e 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -14,7 +14,11 @@ #if wxUSE_COMBOBOX #include "wx/combobox.h" -#include "wx/button.h" + +#ifndef WX_PRECOMP + #include "wx/button.h" +#endif + #include "wx/menu.h" #include "wx/containr.h" #include "wx/mac/uma.h" diff --git a/src/mac/carbon/combobxc.cpp b/src/mac/carbon/combobxc.cpp index f5ba7c6f31..b5d1bffd67 100644 --- a/src/mac/carbon/combobxc.cpp +++ b/src/mac/carbon/combobxc.cpp @@ -12,7 +12,11 @@ #include "wx/wxprec.h" #include "wx/combobox.h" -#include "wx/button.h" + +#ifndef WX_PRECOMP + #include "wx/button.h" +#endif + #include "wx/menu.h" #include "wx/mac/uma.h" #if TARGET_API_MAC_OSX diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index 417c018cda..5fa7444139 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -18,6 +18,7 @@ #include "wx/panel.h" #include "wx/dc.h" #include "wx/dcclient.h" + #include "wx/button.h" #endif // WX_PRECOMP #include "wx/notebook.h" @@ -25,7 +26,6 @@ #include "wx/radiobox.h" #include "wx/spinbutt.h" #include "wx/scrolbar.h" -#include "wx/button.h" #include "wx/dialog.h" #include "wx/statbox.h" #include "wx/sizer.h" diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 1b54683f4e..6076e3400a 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -20,9 +20,9 @@ #include "wx/log.h" #include "wx/app.h" #include "wx/utils.h" + #include "wx/button.h" #endif -#include "wx/button.h" #include "wx/settings.h" #include "wx/toplevel.h" diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 276ee3a62a..687f527adb 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -20,6 +20,7 @@ #include "wx/app.h" #include "wx/utils.h" #include "wx/dc.h" + #include "wx/button.h" #endif #ifdef __DARWIN__ @@ -39,7 +40,6 @@ #endif #endif -#include "wx/button.h" #include "wx/toplevel.h" #include "wx/settings.h" #include "wx/filefn.h" diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 736d80406d..d6fe9edd1e 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -21,6 +21,7 @@ #include "wx/frame.h" #include "wx/dc.h" #include "wx/dcclient.h" + #include "wx/button.h" #endif #include "wx/menu.h" @@ -28,7 +29,6 @@ #include "wx/dialog.h" #include "wx/scrolbar.h" #include "wx/statbox.h" -#include "wx/button.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/tooltip.h" diff --git a/src/mac/classic/app.cpp b/src/mac/classic/app.cpp index 6d7e25c1ce..4fe7e37496 100644 --- a/src/mac/classic/app.cpp +++ b/src/mac/classic/app.cpp @@ -24,9 +24,9 @@ #include "wx/window.h" #include "wx/frame.h" #include "wx/dc.h" + #include "wx/button.h" #endif -#include "wx/button.h" #include "wx/gdicmn.h" #include "wx/pen.h" #include "wx/brush.h" @@ -346,7 +346,7 @@ MenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) // VZ: we could find the menu from its handle here by examining all // the menus in the menu bar recursively but knowing that neither // wxMSW nor wxGTK do it why bother... - #if 0 +#if 0 MenuRef menuRef; GetEventParameter(event, @@ -354,7 +354,7 @@ MenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) typeMenuRef, NULL, sizeof(menuRef), NULL, &menuRef); - #endif // 0 +#endif // 0 wxEventType type=0; MenuCommand cmd=0; diff --git a/src/mac/classic/combobox.cpp b/src/mac/classic/combobox.cpp index d81d07e32b..5af51c8fa8 100644 --- a/src/mac/classic/combobox.cpp +++ b/src/mac/classic/combobox.cpp @@ -9,8 +9,14 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + #include "wx/combobox.h" -#include "wx/button.h" + +#ifndef WX_PRECOMP + #include "wx/button.h" +#endif + #include "wx/menu.h" #include "wx/mac/uma.h" diff --git a/src/mac/classic/control.cpp b/src/mac/classic/control.cpp index 9e8e3660f6..1599c395c5 100644 --- a/src/mac/classic/control.cpp +++ b/src/mac/classic/control.cpp @@ -22,6 +22,7 @@ #include "wx/panel.h" #include "wx/dc.h" #include "wx/dcclient.h" + #include "wx/button.h" #endif // WX_PRECOMP #include "wx/notebook.h" @@ -29,7 +30,6 @@ #include "wx/radiobox.h" #include "wx/spinbutt.h" #include "wx/scrolbar.h" -#include "wx/button.h" #include "wx/dialog.h" #include "wx/statbox.h" #include "wx/sizer.h" diff --git a/src/mac/classic/listbox.cpp b/src/mac/classic/listbox.cpp index 303848e70c..bf6bbdf7cc 100644 --- a/src/mac/classic/listbox.cpp +++ b/src/mac/classic/listbox.cpp @@ -20,9 +20,9 @@ #include "wx/log.h" #include "wx/app.h" #include "wx/utils.h" + #include "wx/button.h" #endif -#include "wx/button.h" #include "wx/settings.h" #include "wx/toplevel.h" diff --git a/src/mac/classic/textctrl.cpp b/src/mac/classic/textctrl.cpp index e12535f5d8..5c028e05f2 100644 --- a/src/mac/classic/textctrl.cpp +++ b/src/mac/classic/textctrl.cpp @@ -23,6 +23,7 @@ #include "wx/app.h" #include "wx/utils.h" #include "wx/dc.h" + #include "wx/button.h" #endif #ifdef __DARWIN__ @@ -42,7 +43,6 @@ #endif #endif -#include "wx/button.h" #include "wx/toplevel.h" #include "wx/notebook.h" #include "wx/tabctrl.h" diff --git a/src/mac/classic/window.cpp b/src/mac/classic/window.cpp index 12059e5f2d..6d8165101a 100644 --- a/src/mac/classic/window.cpp +++ b/src/mac/classic/window.cpp @@ -21,6 +21,7 @@ #include "wx/frame.h" #include "wx/dc.h" #include "wx/dcclient.h" + #include "wx/button.h" #endif #include "wx/menu.h" @@ -29,7 +30,6 @@ #include "wx/listbox.h" #include "wx/scrolbar.h" #include "wx/statbox.h" -#include "wx/button.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/notebook.h" diff --git a/src/motif/window.cpp b/src/motif/window.cpp index f3b68b1d3f..c82cadf8bf 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -34,11 +34,11 @@ #include "wx/frame.h" #include "wx/dc.h" #include "wx/dcclient.h" + #include "wx/button.h" #endif #include "wx/menu.h" #include "wx/layout.h" -#include "wx/button.h" #include "wx/settings.h" #include "wx/scrolwin.h" #include "wx/module.h" diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 6b6f67aa65..ad0fbede21 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/button.cpp +// Name: src/msw/button.cpp // Purpose: wxButton // Author: Julian Smart // Modified by: @@ -26,9 +26,10 @@ #if wxUSE_BUTTON +#include "wx/button.h" + #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/button.h" #include "wx/brush.h" #include "wx/panel.h" #include "wx/bmpbuttn.h" @@ -132,16 +133,16 @@ bool wxButton::Create(wxWindow *parent, { // On Windows, some buttons aren't supposed to have // mnemonics, so strip them out. - - label = wxGetStockLabel(id + + label = wxGetStockLabel(id #if defined(__WXMSW__) || defined(__WXWINCE__) , ( id != wxID_OK && id != wxID_CANCEL && id != wxID_CLOSE ) #endif ); - } - + } + if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return false; @@ -729,4 +730,3 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) #endif // __WIN32__ #endif // wxUSE_BUTTON - diff --git a/src/msw/tglbtn.cpp b/src/msw/tglbtn.cpp index d9c7fd1245..e3e986fe8c 100644 --- a/src/msw/tglbtn.cpp +++ b/src/msw/tglbtn.cpp @@ -2,8 +2,8 @@ // Name: src/msw/tglbtn.cpp // Purpose: Definition of the wxToggleButton class, which implements a // toggle button under wxMSW. -// Author: John Norris, minor changes by Axel Schlueter -// and William Gallafent. +// Author: John Norris, minor changes by Axel Schlueter +// and William Gallafent. // Modified by: // Created: 08.02.01 // RCS-ID: $Id$ @@ -25,10 +25,10 @@ #pragma hdrstop #endif -#include "wx/tglbtn.h" - #if wxUSE_TOGGLEBTN +#include "wx/tglbtn.h" + #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/brush.h" @@ -164,4 +164,3 @@ void wxToggleButton::Command(wxCommandEvent & event) } #endif // wxUSE_TOGGLEBTN - diff --git a/src/os2/button.cpp b/src/os2/button.cpp index 3e831bcf91..2e9a10d578 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: button.cpp +// Name: src/os2/button.cpp // Purpose: wxButton // Author: David Webster // Modified by: @@ -12,9 +12,10 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/button.h" + #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/button.h" #include "wx/brush.h" #include "wx/panel.h" #include "wx/bmpbuttn.h" @@ -89,7 +90,7 @@ bool wxButton::Create( wxWindow* pParent, ); if (m_hWnd == 0) { - return FALSE; + return false; } // diff --git a/src/os2/tglbtn.cpp b/src/os2/tglbtn.cpp index ef7907c38a..6269009481 100644 --- a/src/os2/tglbtn.cpp +++ b/src/os2/tglbtn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/tglbtn.cpp +// Name: src/os2/tglbtn.cpp // Purpose: Definition of the wxToggleButton class, which implements a // toggle button under wxMSW. // Author: John Norris, minor changes by Axel Schlueter @@ -25,10 +25,10 @@ #pragma hdrstop #endif -#include "wx/tglbtn.h" - #if wxUSE_TOGGLEBTN +#include "wx/tglbtn.h" + #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/brush.h" @@ -152,4 +152,3 @@ void wxToggleButton::Command(wxCommandEvent & event) } #endif // wxUSE_TOGGLEBTN - diff --git a/src/palmos/button.cpp b/src/palmos/button.cpp index b2b7b6ef30..2e036b19aa 100644 --- a/src/palmos/button.cpp +++ b/src/palmos/button.cpp @@ -26,9 +26,10 @@ #if wxUSE_BUTTON +#include "wx/button.h" + #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/button.h" #include "wx/brush.h" #include "wx/panel.h" #include "wx/bmpbuttn.h" @@ -234,4 +235,3 @@ void wxButton::Command(wxCommandEvent &event) } #endif // wxUSE_BUTTON - diff --git a/src/palmos/control.cpp b/src/palmos/control.cpp index 4cda57075f..fea796246a 100644 --- a/src/palmos/control.cpp +++ b/src/palmos/control.cpp @@ -32,11 +32,11 @@ #include "wx/dcclient.h" #include "wx/log.h" #include "wx/settings.h" + #include "wx/button.h" #endif #include "wx/control.h" #include "wx/toplevel.h" -#include "wx/button.h" #include "wx/checkbox.h" #include "wx/tglbtn.h" #include "wx/radiobut.h" @@ -390,7 +390,7 @@ void wxControl::SetFieldLabel(const wxString& label) if(field==NULL) return; - uint16_t newSize = label.Length() + 1; + uint16_t newSize = label.length() + 1; MemHandle strHandle = FldGetTextHandle(field); FldSetTextHandle(field, NULL ); if (strHandle) diff --git a/src/palmos/tglbtn.cpp b/src/palmos/tglbtn.cpp index d9de36c03f..3f75361d7e 100644 --- a/src/palmos/tglbtn.cpp +++ b/src/palmos/tglbtn.cpp @@ -26,6 +26,8 @@ #if wxUSE_TOGGLEBTN +#include "wx/tglbtn.h" + #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/brush.h" @@ -35,8 +37,6 @@ #include "wx/log.h" #endif // WX_PRECOMP -#include "wx/tglbtn.h" - #include // ---------------------------------------------------------------------------- @@ -101,4 +101,3 @@ void wxToggleButton::Command(wxCommandEvent & event) } #endif // wxUSE_TOGGLEBTN - diff --git a/src/palmos/toplevel.cpp b/src/palmos/toplevel.cpp index 2e0f479cbc..8be56e16f5 100644 --- a/src/palmos/toplevel.cpp +++ b/src/palmos/toplevel.cpp @@ -33,13 +33,13 @@ #include "wx/intl.h" #include "wx/frame.h" #include "wx/containr.h" // wxSetFocusToChild() + #include "wx/button.h" #endif //WX_PRECOMP #include "wx/module.h" #include "wx/display.h" // controls for sending select event -#include "wx/button.h" #include "wx/checkbox.h" #include "wx/radiobut.h" #include "wx/tglbtn.h" diff --git a/src/x11/window.cpp b/src/x11/window.cpp index a027babec6..c185b0e9e0 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -35,13 +35,13 @@ #include "wx/frame.h" #include "wx/dc.h" #include "wx/dcclient.h" + #include "wx/button.h" #endif #include "wx/menu.h" #include "wx/layout.h" #include "wx/dialog.h" #include "wx/listbox.h" -#include "wx/button.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/scrolwin.h" diff --git a/src/xrc/xh_bttn.cpp b/src/xrc/xh_bttn.cpp index ed74f1d3a1..397c6dbe47 100644 --- a/src/xrc/xh_bttn.cpp +++ b/src/xrc/xh_bttn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: xh_bttn.cpp +// Name: src/xrc/xh_bttn.cpp // Purpose: XRC resource for buttons // Author: Vaclav Slavik // Created: 2000/03/05 @@ -18,7 +18,10 @@ #if wxUSE_XRC #include "wx/xrc/xh_bttn.h" -#include "wx/button.h" + +#ifndef WX_PRECOMP + #include "wx/button.h" +#endif IMPLEMENT_DYNAMIC_CLASS(wxButtonXmlHandler, wxXmlResourceHandler) -- 2.47.2