From: Jaakko Salli Date: Tue, 30 Sep 2008 16:33:43 +0000 (+0000) Subject: Try to make SetupChildEventHandling() more foolproof X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/28fb19ef292aa124e964b405f9b75e92f22035b0 Try to make SetupChildEventHandling() more foolproof git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index c535312ef7..9f82cfbe68 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1803,7 +1803,7 @@ protected: int CacheColour( const wxColour& colour ); // Sets up basic event handling for child control - void SetupChildEventHandling( wxWindow* wnd, int id ); + void SetupChildEventHandling( wxWindow* wnd ); void CustomSetCursor( int type, bool override = false ); diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 8ad70459c6..c96523b261 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3403,8 +3403,10 @@ void wxPropertyGrid::CustomSetCursor( int type, bool override ) // ----------------------------------------------------------------------- // Setups event handling for child control -void wxPropertyGrid::SetupChildEventHandling( wxWindow* argWnd, int id ) +void wxPropertyGrid::SetupChildEventHandling( wxWindow* argWnd ) { + wxWindowID id = argWnd->GetId(); + if ( argWnd == m_wndEditor ) { this->Connect(id, wxEVT_MOTION, @@ -3685,7 +3687,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) #endif wxWindow* primaryCtrl = GetEditorControl(); - SetupChildEventHandling(primaryCtrl, wxPG_SUBID1); + SetupChildEventHandling(primaryCtrl); // Focus and select all (wxTextCtrl, wxComboBox etc) if ( flags & wxPG_SEL_FOCUS ) @@ -3725,7 +3727,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) #endif m_wndEditor2->Show(); - SetupChildEventHandling(m_wndEditor2,wxPG_SUBID2); + SetupChildEventHandling(m_wndEditor2); // If no primary editor, focus to button to allow // it to interprete ENTER etc.