diff --git a/include/wx/propgrid/manager.h b/include/wx/propgrid/manager.h index c93c669420..de264eecae 100644 --- a/include/wx/propgrid/manager.h +++ b/include/wx/propgrid/manager.h @@ -607,8 +607,12 @@ protected: // Subclassing helpers // - /** Creates property grid for the manager. Override to use subclassed - wxPropertyGrid. + /** + Creates property grid for the manager. Reimplement in derived class to + use subclassed wxPropertyGrid. However, if you you do this then you + must also use the two-step construction (ie. default constructor and + Create() instead of constructor with arguments) when creating the + manager. */ virtual wxPropertyGrid* CreatePropertyGrid() const; diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 1b2e3a14cd..f867108b36 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -463,8 +463,11 @@ protected: // /** - Creates property grid for the manager. - Override to use subclassed wxPropertyGrid. + Creates property grid for the manager. Reimplement in derived class to + use subclassed wxPropertyGrid. However, if you you do this then you + must also use the two-step construction (ie. default constructor and + Create() instead of constructor with arguments) when creating the + manager. */ virtual wxPropertyGrid* CreatePropertyGrid() const; }; diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 27f4e81ac7..72c53ff64f 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -281,6 +281,8 @@ bool wxPropertyGridManager::Create( wxWindow *parent, long style, const wxString& name ) { + if ( !m_pPropGrid ) + m_pPropGrid = CreatePropertyGrid(); bool res = wxPanel::Create( parent, id, pos, size, (style&0xFFFF0000)|wxWANTS_CHARS, @@ -298,8 +300,7 @@ bool wxPropertyGridManager::Create( wxWindow *parent, void wxPropertyGridManager::Init1() { - //m_pPropGrid = NULL; - m_pPropGrid = CreatePropertyGrid(); + m_pPropGrid = NULL; #if wxUSE_TOOLBAR m_pToolbar = NULL;