]> git.saurik.com Git - wxWidgets.git/commitdiff
Try to make SetupChildEventHandling() more foolproof
authorJaakko Salli <jaakko.salli@dnainternet.net>
Tue, 30 Sep 2008 16:33:43 +0000 (16:33 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Tue, 30 Sep 2008 16:33:43 +0000 (16:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
src/propgrid/propgrid.cpp

index c535312ef7cafc7d82d78e443ab92e20545fdd20..9f82cfbe6840d849426cd3731d6f6a8472616e2b 100644 (file)
@@ -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 );
 
index 8ad70459c6ac6523305efbc39e7decdc724ef1c9..c96523b26195dd58411e7cfb394a0129982cde2a 100644 (file)
@@ -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.