From d5da0ce7cb746318511b3974b7882c72c0de45e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 27 Apr 2006 12:47:14 +0000 Subject: [PATCH] Include wx/event.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/event.cpp | 3 +- src/common/gdicmn.cpp | 2 +- src/common/sckipc.cpp | 19 ++++--- src/common/socket.cpp | 2 +- src/common/textcmn.cpp | 10 +++- src/common/xtistrm.cpp | 6 +- src/common/xtixml.cpp | 5 +- src/mac/carbon/cfsocket.cpp | 2 +- src/mac/classic/data.cpp | 8 ++- src/mac/corefoundation/hidjoystick.cpp | 2 +- src/motif/evtloop.cpp | 3 +- src/msw/main.cpp | 10 ++-- src/msw/notebook.cpp | 2 +- src/msw/regconf.cpp | 2 +- src/os2/control.cpp | 27 +++++---- src/os2/notebook.cpp | 4 +- src/os2/stattext.cpp | 77 ++++++++++++-------------- src/palmos/main.cpp | 5 +- src/palmos/stattext.cpp | 14 ++--- src/unix/dialup.cpp | 2 +- src/unix/joystick.cpp | 5 +- src/xrc/xh_cald.cpp | 8 ++- 22 files changed, 115 insertions(+), 103 deletions(-) diff --git a/src/common/event.cpp b/src/common/event.cpp index e29dd4e6fb..ae1a10d709 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -24,6 +24,8 @@ #pragma hdrstop #endif +#include "wx/event.h" + #ifndef WX_PRECOMP #include "wx/list.h" #include "wx/app.h" @@ -36,7 +38,6 @@ #endif // wxUSE_GUI #endif -#include "wx/event.h" #include "wx/module.h" #if wxUSE_GUI diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index d04a4b4f42..db7616879a 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -24,9 +24,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/event.h" #endif -#include "wx/event.h" #include "wx/brush.h" #include "wx/pen.h" #include "wx/bitmap.h" diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 9787f76858..0ece73c6b0 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: sckipc.cpp +// Name: src/common/sckipc.cpp // Purpose: Interprocess communication implementation (wxSocket version) // Author: Julian Smart // Modified by: Guilhem Lavaux (big rewrite) May 1997, 1998 @@ -26,23 +26,24 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/log.h" + #pragma hdrstop #endif #if wxUSE_SOCKETS && wxUSE_IPC && wxUSE_STREAMS +#include "wx/sckipc.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/event.h" +#endif + #include #include #include #include "wx/socket.h" -#include "wx/sckipc.h" #include "wx/module.h" -#include "wx/event.h" // -------------------------------------------------------------------------- // macros and constants @@ -752,4 +753,4 @@ IMPLEMENT_DYNAMIC_CLASS(wxTCPEventHandlerModule, wxModule) #endif - // wxUSE_SOCKETS && wxUSE_IPC + // wxUSE_SOCKETS && wxUSE_IPC && wxUSE_STREAMS diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 43a51d19a1..96e97de4fb 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -29,6 +29,7 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/event.h" #endif #include "wx/app.h" @@ -36,7 +37,6 @@ #include "wx/timer.h" #include "wx/utils.h" #include "wx/module.h" -#include "wx/event.h" #include "wx/sckaddr.h" #include "wx/datetime.h" diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index a88d7f210b..f6d3bcb676 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: common/textcmn.cpp +// Name: src/common/textcmn.cpp // Purpose: implementation of platform-independent functions of wxTextCtrl // Author: Julian Smart // Modified by: @@ -20,12 +20,17 @@ #pragma hdrstop #endif +#ifndef WX_PRECOMP + #include "wx/event.h" +#endif // WX_PRECOMP + #if wxUSE_TEXTCTRL +#include "wx/textctrl.h" + #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" - #include "wx/textctrl.h" #endif // WX_PRECOMP #include "wx/ffile.h" @@ -517,7 +522,6 @@ wxTextCtrlBase::HitTest(const wxPoint& WXUNUSED(pt), // define this one even if !wxUSE_TEXTCTRL because it is also used by other // controls (wxComboBox and wxSpinCtrl) -#include "wx/event.h" DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED) diff --git a/src/common/xtistrm.cpp b/src/common/xtistrm.cpp index fee284e6cb..e304fd3fc2 100644 --- a/src/common/xtistrm.cpp +++ b/src/common/xtistrm.cpp @@ -18,16 +18,16 @@ #if wxUSE_EXTENDED_RTTI +#include "wx/xtistrm.h" + #ifndef WX_PRECOMP #include "wx/object.h" #include "wx/hash.h" + #include "wx/event.h" #endif #include "wx/tokenzr.h" #include "wx/txtstrm.h" -#include "wx/event.h" - -#include "wx/xtistrm.h" #include "wx/beforestd.h" #include diff --git a/src/common/xtixml.cpp b/src/common/xtixml.cpp index 7531d3df03..91b094d6eb 100644 --- a/src/common/xtixml.cpp +++ b/src/common/xtixml.cpp @@ -18,18 +18,19 @@ #if wxUSE_EXTENDED_RTTI +#include "wx/xtixml.h" + #ifndef WX_PRECOMP #include "wx/object.h" #include "wx/hash.h" + #include "wx/event.h" #endif #include "wx/xml/xml.h" #include "wx/tokenzr.h" #include "wx/txtstrm.h" -#include "wx/event.h" #include "wx/xtistrm.h" -#include "wx/xtixml.h" #include "wx/beforestd.h" #include diff --git a/src/mac/carbon/cfsocket.cpp b/src/mac/carbon/cfsocket.cpp index 531c538a34..0e21467d84 100644 --- a/src/mac/carbon/cfsocket.cpp +++ b/src/mac/carbon/cfsocket.cpp @@ -24,6 +24,7 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/event.h" #endif #include "wx/app.h" @@ -31,7 +32,6 @@ #include "wx/timer.h" #include "wx/utils.h" #include "wx/module.h" -#include "wx/event.h" #include "wx/sckaddr.h" #include "wx/mac/carbon/private.h" diff --git a/src/mac/classic/data.cpp b/src/mac/classic/data.cpp index 377b125d9a..eb8f97da01 100644 --- a/src/mac/classic/data.cpp +++ b/src/mac/classic/data.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: mac/data.cpp +// Name: src/mac/classic/data.cpp // Purpose: Various global Mac-specific data // Author: Stefan Csomor // Modified by: @@ -9,4 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include "wx/event.h" +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/event.h" +#endif diff --git a/src/mac/corefoundation/hidjoystick.cpp b/src/mac/corefoundation/hidjoystick.cpp index d3017da77c..ee7178d643 100644 --- a/src/mac/corefoundation/hidjoystick.cpp +++ b/src/mac/corefoundation/hidjoystick.cpp @@ -33,9 +33,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/event.h" //joystick wxEvents #endif -#include "wx/event.h" //joystick wxEvents #include "wx/joystick.h" //... #include "wx/thread.h" //wxThread for polling thread/ wxCriticalSection #include "wx/window.h" //for wxWindow to "capture" joystick diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index 424b96c5ab..d11b4d777f 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -26,10 +26,10 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP + #include "wx/event.h" #endif //WX_PRECOMP #include "wx/evtloop.h" -#include "wx/event.h" #include "wx/app.h" #include "wx/window.h" @@ -477,4 +477,3 @@ bool wxAddIdleCallback() return true; } - diff --git a/src/msw/main.cpp b/src/msw/main.cpp index c86c0909eb..4e89e478d0 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/main.cpp +// Name: src/msw/main.cpp // Purpose: WinMain/DllMain // Author: Julian Smart // Modified by: @@ -24,7 +24,10 @@ #pragma hdrstop #endif -#include "wx/event.h" +#ifndef WX_PRECOMP + #include "wx/event.h" +#endif //WX_PRECOMP + #include "wx/app.h" #include "wx/cmdline.h" #include "wx/scopeguard.h" @@ -247,7 +250,7 @@ static bool wxIsUnicodeAvailable() if ( wxGetOsVersion() != wxWINDOWS_NT ) { // we need to be built with MSLU support -#if !wxUSE_UNICODE_MSLU +#if !wxUSE_UNICODE_MSLU // note that we can use MessageBoxW() as it's implemented even under // Win9x - OTOH, we can't use wxGetTranslation() because the file APIs // used by wxLocale are not @@ -403,4 +406,3 @@ void wxSetInstance(HINSTANCE hInst) } #endif // wxUSE_BASE - diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 2cca530065..44de7957be 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -24,10 +24,10 @@ #include "wx/string.h" #include "wx/dc.h" #include "wx/log.h" + #include "wx/event.h" #endif // WX_PRECOMP #include "wx/imaglist.h" -#include "wx/event.h" #include "wx/control.h" #include "wx/app.h" #include "wx/sysopt.h" diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 1c9892c0b9..13807770df 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -24,9 +24,9 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/event.h" #endif //WX_PRECOMP -#include "wx/event.h" #include "wx/app.h" #include "wx/msw/registry.h" diff --git a/src/os2/control.cpp b/src/os2/control.cpp index 69a1a79243..f829123a94 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -13,12 +13,13 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include "wx/event.h" -#include "wx/app.h" -#include "wx/dcclient.h" -#include "wx/scrolwin.h" -#include "wx/log.h" + #include "wx/event.h" + #include "wx/app.h" + #include "wx/dcclient.h" + #include "wx/scrolwin.h" + #include "wx/log.h" #endif + #include "wx/os2/private.h" #include "wx/control.h" @@ -33,15 +34,13 @@ wxControl::wxControl() { } // end of wxControl::wxControl -bool wxControl::Create( - wxWindow* pParent -, wxWindowID vId -, const wxPoint& rPos -, const wxSize& rSize -, long lStyle -, const wxValidator& rValidator -, const wxString& rsName -) +bool wxControl::Create( wxWindow* pParent, + wxWindowID vId, + const wxPoint& rPos, + const wxSize& rSize, + long lStyle, + const wxValidator& rValidator, + const wxString& rsName ) { bool bRval = wxWindow::Create( pParent ,vId diff --git a/src/os2/notebook.cpp b/src/os2/notebook.cpp index b0765dd8e8..f518b1d11c 100644 --- a/src/os2/notebook.cpp +++ b/src/os2/notebook.cpp @@ -22,11 +22,11 @@ #include "wx/dcclient.h" #include "wx/string.h" #include "wx/settings.h" - #include "wx/log.h" + #include "wx/log.h" + #include "wx/event.h" #endif // WX_PRECOMP #include "wx/imaglist.h" -#include "wx/event.h" #include "wx/control.h" #include "wx/os2/private.h" diff --git a/src/os2/stattext.cpp b/src/os2/stattext.cpp index a344877e2b..d8af7b31c7 100644 --- a/src/os2/stattext.cpp +++ b/src/os2/stattext.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: stattext.cpp +// Name: src/os2/stattext.cpp // Purpose: wxStaticText // Author: David Webster // Modified by: @@ -13,10 +13,10 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include "wx/event.h" -#include "wx/app.h" -#include "wx/brush.h" -#include "wx/scrolwin.h" + #include "wx/event.h" + #include "wx/app.h" + #include "wx/brush.h" + #include "wx/scrolwin.h" #endif #include "wx/stattext.h" @@ -25,15 +25,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) -bool wxStaticText::Create( - wxWindow* pParent -, wxWindowID vId -, const wxString& rsLabel -, const wxPoint& rPos -, const wxSize& rSize -, long lStyle -, const wxString& rsName -) +bool wxStaticText::Create( wxWindow* pParent, + wxWindowID vId, + const wxString& rsLabel, + const wxPoint& rPos, + const wxSize& rSize, + long lStyle, + const wxString& rsName ) { SetName(rsName); if (pParent) @@ -42,19 +40,19 @@ bool wxStaticText::Create( SetBackgroundColour(pParent->GetBackgroundColour()) ; SetForegroundColour(pParent->GetForegroundColour()) ; - if ( vId == -1 ) + if ( vId == wxID_ANY ) m_windowId = (int)NewControlId(); else m_windowId = vId; - int nX = rPos.x; - int nY = rPos.y; - int nWidth = rSize.x; - int nHeight = rSize.y; + int nX = rPos.x; + int nY = rPos.y; + int nWidth = rSize.x; + int nHeight = rSize.y; m_windowStyle = lStyle; - long lSstyle = 0L; + long lSstyle = 0L; // Used to have DT_VCENTER but that doesn't work correctly with // multiline strings and DT_WORDBREAK. Accept a reasonable @@ -67,7 +65,7 @@ bool wxStaticText::Create( else lSstyle |= DT_LEFT; - wxString sLabel = ::wxPMTextToLabel(rsLabel); + wxString sLabel = ::wxPMTextToLabel(rsLabel); m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle ,WC_STATIC // Window class @@ -81,13 +79,9 @@ bool wxStaticText::Create( ,NULL // no Presentation parameters ); - wxCHECK_MSG(m_hWnd, FALSE, wxT("Failed to create static ctrl")); + wxCHECK_MSG(m_hWnd, false, wxT("Failed to create static ctrl")); - wxColour vColour; - - vColour.Set(wxString(wxT("BLACK"))); - - LONG lColor = (LONG)vColour.GetPixel(); + LONG lColor = (LONG)wxBLACK->GetPixel(); ::WinSetPresParam( m_hWnd ,PP_FOREGROUNDCOLOR @@ -106,24 +100,21 @@ bool wxStaticText::Create( SetFont(*wxSMALL_FONT); SetXComp(0); SetYComp(0); - SetSize( nX - ,nY - ,nWidth - ,nHeight - ); - return TRUE; + SetSize( nX, nY, nWidth, nHeight ); + + return true; } // end of wxStaticText::Create wxSize wxStaticText::DoGetBestSize() const { - wxString sText(wxGetWindowText(GetHWND())); - int nWidthTextMax = 0; - int nWidthLine = 0; - int nHeightTextTotal = 0; - int nHeightLineDefault = 0; - int nHeightLine = 0; - wxString sCurLine; - bool bLastWasTilde = FALSE; + wxString sText(wxGetWindowText(GetHWND())); + int nWidthTextMax = 0; + int nWidthLine = 0; + int nHeightTextTotal = 0; + int nHeightLineDefault = 0; + int nHeightLine = 0; + wxString sCurLine; + bool bLastWasTilde = false; for (const wxChar *pc = sText; ; pc++) { @@ -174,7 +165,7 @@ wxSize wxStaticText::DoGetBestSize() const { if (!bLastWasTilde) { - bLastWasTilde = TRUE; + bLastWasTilde = true; // // Skip the statement adding pc to curLine below @@ -185,7 +176,7 @@ wxSize wxStaticText::DoGetBestSize() const // // It is a literal tilde // - bLastWasTilde = FALSE; + bLastWasTilde = false; } sCurLine += *pc; } diff --git a/src/palmos/main.cpp b/src/palmos/main.cpp index aaf6f0ab51..c7658e324f 100644 --- a/src/palmos/main.cpp +++ b/src/palmos/main.cpp @@ -24,7 +24,10 @@ #pragma hdrstop #endif -#include "wx/event.h" +#ifndef WX_PRECOMP + #include "wx/event.h" +#endif //WX_PRECOMP + #include "wx/app.h" #include "wx/cmdline.h" diff --git a/src/palmos/stattext.cpp b/src/palmos/stattext.cpp index fd86cf5e86..413c259f14 100644 --- a/src/palmos/stattext.cpp +++ b/src/palmos/stattext.cpp @@ -13,19 +13,19 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_STATTEXT -#ifndef WX_PRECOMP -#include "wx/event.h" -#include "wx/app.h" -#include "wx/brush.h" -#endif - #include "wx/stattext.h" +#ifndef WX_PRECOMP + #include "wx/event.h" + #include "wx/app.h" + #include "wx/brush.h" +#endif + #include #if wxUSE_EXTENDED_RTTI diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index db1ad16b3b..c4f45c070e 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -20,9 +20,9 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/event.h" #endif // !PCH -#include "wx/event.h" #include "wx/timer.h" #include "wx/filefn.h" #include "wx/utils.h" diff --git a/src/unix/joystick.cpp b/src/unix/joystick.cpp index c60b06b758..6383d60124 100644 --- a/src/unix/joystick.cpp +++ b/src/unix/joystick.cpp @@ -16,6 +16,10 @@ #include "wx/joystick.h" +#ifndef WX_PRECOMP + #include "wx/event.h" +#endif //WX_PRECOMP + #include #include #include @@ -24,7 +28,6 @@ #include #include -#include "wx/event.h" #include "wx/window.h" #include "wx/unix/private.h" diff --git a/src/xrc/xh_cald.cpp b/src/xrc/xh_cald.cpp index 3259a04e1c..d6514cbe7e 100644 --- a/src/xrc/xh_cald.cpp +++ b/src/xrc/xh_cald.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: xh_cald.cpp +// Name: src/xrc/xh_cald.cpp // Purpose: XRC resource for wxCalendarCtrl // Author: Brian Gavin // Created: 2000/09/09 @@ -18,7 +18,11 @@ #if wxUSE_XRC && wxUSE_CALENDARCTRL #include "wx/xrc/xh_cald.h" -#include "wx/event.h" + +#ifndef WX_PRECOMP + #include "wx/event.h" +#endif //WX_PRECOMP + #include "wx/calctrl.h" IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrlXmlHandler, wxXmlResourceHandler)