From a5b9e6d3e792c16e307e4f3f661960c353d0ff8c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 31 Oct 2023 01:03:46 +0100 Subject: [PATCH] Minimal changes to make wxPropertyGridXmlHandler compile again Just rename wxPropertyGridState to wxPropertyGridPageState and add make wxPropertyGridXmlHandler a friend of this class to allow it to use its protected methods. Also remove some preprocessor checks for non-existent symbols. --- include/wx/propgrid/propgridpagestate.h | 1 + include/wx/xrc/xh_propgrid.h | 2 +- src/xrc/xh_propgrid.cpp | 14 +++----------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/include/wx/propgrid/propgridpagestate.h b/include/wx/propgrid/propgridpagestate.h index 7c0576543c..502830f7ed 100644 --- a/include/wx/propgrid/propgridpagestate.h +++ b/include/wx/propgrid/propgridpagestate.h @@ -467,6 +467,7 @@ class WXDLLIMPEXP_PROPGRID wxPropertyGridPageState friend class wxPGProperty; friend class wxFlagsProperty; friend class wxPropertyGridIteratorBase; + friend class wxPropertyGridXmlHandler; public: // Default constructor. diff --git a/include/wx/xrc/xh_propgrid.h b/include/wx/xrc/xh_propgrid.h index 7d1eae6cca..fcab66a820 100644 --- a/include/wx/xrc/xh_propgrid.h +++ b/include/wx/xrc/xh_propgrid.h @@ -39,7 +39,7 @@ public: bool CanHandle(wxXmlNode *node) override; void InitPopulator(); - void PopulatePage( wxPropertyGridState* state ); + void PopulatePage( wxPropertyGridPageState* state ); void DonePopulator(); void HandlePropertyGridParams(); diff --git a/src/xrc/xh_propgrid.cpp b/src/xrc/xh_propgrid.cpp index c70ba4564f..6e78786bdd 100644 --- a/src/xrc/xh_propgrid.cpp +++ b/src/xrc/xh_propgrid.cpp @@ -66,9 +66,6 @@ wxPropertyGridXmlHandler::wxPropertyGridXmlHandler() XRC_ADD_STYLE(wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES); XRC_ADD_STYLE(wxPG_EX_NO_FLAT_TOOLBAR); XRC_ADD_STYLE(wxPG_EX_MODE_BUTTONS); -#if wxPG_COMPATIBILITY_1_2_0 - XRC_ADD_STYLE(wxPG_EX_TRADITIONAL_VALIDATORS); -#endif AddWindowStyles(); } @@ -106,7 +103,7 @@ void wxPropertyGridXmlHandler::InitPopulator() m_populator = populator; } -void wxPropertyGridXmlHandler::PopulatePage( wxPropertyGridState* state ) +void wxPropertyGridXmlHandler::PopulatePage( wxPropertyGridPageState* state ) { wxString sColumns(wxT("columns")); if ( HasParam(sColumns) ) @@ -253,7 +250,6 @@ wxObject *wxPropertyGridXmlHandler::DoCreateResource() if ( wxPropertyGridPopulator::ToLongPCT(s, &pos, m_pg->GetClientSize().x) ) m_populator->GetState()->DoSetSplitterPosition( pos, index, false ); } -#if wxPG_INCLUDE_MANAGER else if ( nodeName == wxT("page") ) { // page @@ -267,7 +263,7 @@ wxObject *wxPropertyGridXmlHandler::DoCreateResource() label = wxString::Format(_("Page %i"),(int)(m_manager->GetPageCount()+1)); m_manager->AddPage(label); - wxPropertyGridState* state = m_manager->GetPage(m_manager->GetPageCount()-1); + wxPropertyGridPageState* state = m_manager->GetPage(m_manager->GetPageCount()-1); PopulatePage(state); } else if( m_class == wxT("wxPropertyGridManager")) @@ -294,7 +290,6 @@ wxObject *wxPropertyGridXmlHandler::DoCreateResource() return control; } -#endif else { wxASSERT( false ); @@ -318,11 +313,8 @@ bool wxPropertyGridXmlHandler::CanHandle(wxXmlNode *node) ) ) || (m_manager && name == wxT("page")) || - (!m_populator && fOurClass(wxT("wxPropertyGrid"))) -#if wxPG_INCLUDE_MANAGER - || + (!m_populator && fOurClass(wxT("wxPropertyGrid"))) || (!m_populator && fOurClass(wxT("wxPropertyGridManager"))) -#endif ); }