From 5bc020e84470a9cbd1383cd46d256d5693b53c5d Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 12 Feb 2020 17:09:25 +0100 Subject: [PATCH] Implement getters for members of wxPGWindowList There is no reason to expose wxPGWindowList member variables. They should be set in ctors and retrieved with getters. --- include/wx/propgrid/editors.h | 3 +++ interface/wx/propgrid/editors.h | 9 +++++++++ src/propgrid/advprops.cpp | 2 +- src/propgrid/editors.cpp | 2 +- src/propgrid/propgrid.cpp | 4 ++-- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/wx/propgrid/editors.h b/include/wx/propgrid/editors.h index 83e21b8da1..aa07e4c4c8 100644 --- a/include/wx/propgrid/editors.h +++ b/include/wx/propgrid/editors.h @@ -35,6 +35,9 @@ public: void SetSecondary(wxWindow* secondary) { m_secondary = secondary; } + wxWindow* GetPrimary() const { return m_primary; } + wxWindow* GetSecondary() const { return m_secondary; } + wxWindow* m_primary; wxWindow* m_secondary; }; diff --git a/interface/wx/propgrid/editors.h b/interface/wx/propgrid/editors.h index 269a8961bf..715cef2dc3 100644 --- a/interface/wx/propgrid/editors.h +++ b/interface/wx/propgrid/editors.h @@ -17,6 +17,15 @@ public: wxPGWindowList(wxWindow* primary, wxWindow* secondary = NULL); void SetSecondary(wxWindow* secondary); + + /** Gets window of primary editor. + @since 3.1.4 + */ + wxWindow* GetPrimary() const; + /** Gets window of secondary editor. + @since 3.1.4 + */ + wxWindow* GetSecondary() const; }; diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index ae33799869..0d545800d3 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -273,7 +273,7 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP wnd2 = NULL; } - wxWindow* wnd1 = wxPGTextCtrlEditor::CreateControls(propgrid, property, pos, tcSz).m_primary; + wxWindow* wnd1 = wxPGTextCtrlEditor::CreateControls(propgrid, property, pos, tcSz).GetPrimary(); #if wxUSE_VALIDATORS // Let's add validator to make sure only numbers can be entered wxTextValidator validator(wxFILTER_NUMERIC, &m_tempString); diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 08649e66fd..6d81d9bb6d 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1318,7 +1318,7 @@ wxPGWindowList wxPGChoiceAndButtonEditor::CreateControls( wxPropertyGrid* propGr #endif wxWindow* ch = wxPGChoiceEditor::CreateControls(propGrid,property, - pos,ch_sz).m_primary; + pos,ch_sz).GetPrimary(); #ifdef __WXMSW__ bt->Show(); diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index ef4e24f478..b31b49d42d 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4163,8 +4163,8 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) goodPos, grect.GetSize()); - m_wndEditor = wndList.m_primary; - m_wndEditor2 = wndList.m_secondary; + m_wndEditor = wndList.GetPrimary(); + m_wndEditor2 = wndList.GetSecondary(); // Remember actual positions within required cell. // These values can be used when there will be required // to reposition the cell.