X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0c133e13b36a923c65f94499554e432bc3a0daa..a43a9e5521440dbb28037646ed4a07125c8823a9:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index ee46f58349..8d3fa0af2c 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -72,16 +72,6 @@ #include "wx/sysopt.h" #endif -// For reporting compile- and runtime version of GTK+ in the ctrl+alt+mclick dialog. -// The gtk includes don't pull any other headers in, at least not on my system - MR -#ifdef __WXGTK__ - #ifdef __WXGTK20__ - #include - #else - #include - #endif -#endif - #include "wx/platinfo.h" // Windows List @@ -112,6 +102,7 @@ BEGIN_EVENT_TABLE(wxWindowBase, wxEvtHandler) EVT_HELP(wxID_ANY, wxWindowBase::OnHelp) #endif // wxUSE_HELP + EVT_SIZE(wxWindowBase::InternalOnSize) END_EVENT_TABLE() // ============================================================================ @@ -227,17 +218,6 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, const wxValidator& wxVALIDATOR_PARAM(validator), const wxString& name) { -#if wxUSE_STATBOX - // wxGTK doesn't allow to create controls with static box as the parent so - // this will result in a crash when the program is ported to wxGTK so warn - // the user about it - - // if you get this assert, the correct solution is to create the controls - // as siblings of the static box - wxASSERT_MSG( !parent || !wxDynamicCast(parent, wxStaticBox), - _T("wxStaticBox can't be used as a window parent!") ); -#endif // wxUSE_STATBOX - // ids are limited to 16 bits under MSW so if you care about portability, // it's not a good idea to use ids out of this range (and negative ids are // reserved for wxWidgets own usage) @@ -484,7 +464,7 @@ void wxWindowBase::FitInside() } // On Mac, scrollbars are explicitly children. -#ifdef __WXMAC__ +#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__) static bool wxHasRealChildren(const wxWindowBase* win) { int realChildCount = 0; @@ -560,7 +540,7 @@ wxSize wxWindowBase::DoGetBestSize() const } #endif // wxUSE_CONSTRAINTS else if ( !GetChildren().empty() -#ifdef __WXMAC__ +#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__) && wxHasRealChildren(this) #endif ) @@ -1162,19 +1142,22 @@ void wxWindowBase::PushEventHandler(wxEvtHandler *handlerToPush) SetEventHandler(handlerToPush); -#ifdef __WXDEBUG__ +#if wxDEBUG_LEVEL // final checks of the operations done above: wxASSERT_MSG( handlerToPush->GetPreviousHandler() == NULL, - "the first handler of the wxWindow stack should have no previous handlers set" ); + "the first handler of the wxWindow stack should " + "have no previous handlers set" ); wxASSERT_MSG( handlerToPush->GetNextHandler() != NULL, - "the first handler of the wxWindow stack should have non-NULL next handler" ); + "the first handler of the wxWindow stack should " + "have non-NULL next handler" ); wxEvtHandler* pLast = handlerToPush; - while (pLast && pLast != this) + while ( pLast && pLast != this ) pLast = pLast->GetNextHandler(); wxASSERT_MSG( pLast->GetNextHandler() == NULL, - "the last handler of the wxWindow stack should have this window as next handler" ); -#endif + "the last handler of the wxWindow stack should " + "have this window as next handler" ); +#endif // wxDEBUG_LEVEL } wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler) @@ -2113,6 +2096,14 @@ bool wxWindowBase::Layout() return true; } +void wxWindowBase::InternalOnSize(wxSizeEvent& event) +{ + if ( GetAutoLayout() ) + Layout(); + + event.Skip(); +} + #if wxUSE_CONSTRAINTS // first phase of the constraints evaluation: set our own constraints @@ -2871,7 +2862,7 @@ bool wxWindowBase::UnregisterHotKey(int WXUNUSED(hotkeyId)) // event processing // ---------------------------------------------------------------------------- -bool wxWindowBase::TryValidator(wxEvent& wxVALIDATOR_PARAM(event)) +bool wxWindowBase::TryBefore(wxEvent& event) { #if wxUSE_VALIDATORS // Can only use the validator of the window which @@ -2886,10 +2877,10 @@ bool wxWindowBase::TryValidator(wxEvent& wxVALIDATOR_PARAM(event)) } #endif // wxUSE_VALIDATORS - return false; + return wxEvtHandler::TryBefore(event); } -bool wxWindowBase::TryParent(wxEvent& event) +bool wxWindowBase::TryAfter(wxEvent& event) { // carry on up the parent-child hierarchy if the propagation count hasn't // reached zero yet @@ -2911,7 +2902,7 @@ bool wxWindowBase::TryParent(wxEvent& event) } } - return wxEvtHandler::TryParent(event); + return wxEvtHandler::TryAfter(event); } // ----------------------------------------------------------------------------