From cf65ad8db9230c7aad6409c7de69aa2cfb220074 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Nov 1998 22:33:23 +0000 Subject: [PATCH] moved common code from ctor and Create() to a separate Init() function git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/window.h | 1 + src/msw/window.cpp | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index f688f4fe1d..b02d8e4298 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -96,6 +96,7 @@ public: long style = 0, const wxString& name = wxPanelNameStr) { + Init(); Create(parent, id, pos, size, style, name); } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 32eb0c46bf..3fde173b1f 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -95,17 +95,16 @@ wxWindow *wxFindWinFromHandle(WXHWND hWnd); #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler) +#endif BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler) -EVT_CHAR(wxWindow::OnChar) -EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground) -EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged) -EVT_INIT_DIALOG(wxWindow::OnInitDialog) -EVT_IDLE(wxWindow::OnIdle) + EVT_CHAR(wxWindow::OnChar) + EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground) + EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged) + EVT_INIT_DIALOG(wxWindow::OnInitDialog) + EVT_IDLE(wxWindow::OnIdle) END_EVENT_TABLE() -#endif - // Find an item given the MS Windows id wxWindow *wxWindow::FindItem(int id) const { @@ -364,8 +363,6 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id, long style, const wxString& name) { - Init(); - wxCHECK_MSG( parent, FALSE, "can't create wxWindow without parent" ); parent->AddChild(this); @@ -1590,7 +1587,8 @@ long wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam) if ( win ) { - win->MSWNotify(wParam, lParam, &result); + if ( win->MSWNotify(wParam, lParam, &result) ) + return result; } else { @@ -1601,14 +1599,17 @@ long wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam) { wxWindow *child = (wxWindow *)node->Data(); if ( child->MSWNotify(wParam, lParam, &result) ) - break; + return result; node = node->Next(); } - } - return result; + // finally try this window too (catches toolbar case) + if ( MSWNotify(wParam, lParam, &result) ) + return result; + } #endif // Win95 + // not processed return FALSE; } -- 2.45.2