From 5f0dc6cc0a6b5457e3142cb3ce76d529cf22cc6f Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 7 Nov 2021 22:09:05 +0100 Subject: [PATCH] Fix adding wxPGProperty to wxPropertyPageState in alphabetical mode If given wxPGProperty is a subproperty of another property (its parent is neither root nor category) it shouldn't be added directly to the alphabetical list. It should be just added as a child property. --- src/propgrid/propgridpagestate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 7b38a37562..ef8b03a752 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1705,9 +1705,11 @@ wxPGProperty* wxPropertyGridPageState::DoInsert( wxPGProperty* parent, int index else if ( parentIsRoot ) // Parent is root. m_regularArray.DoAddChild( property, -1, false ); + else + parent->DoAddChild(property, index, true); // Add to current mode - if ( !property->IsCategory() ) + if ( !property->IsCategory() && (parentIsCategory || parentIsRoot) ) m_abcArray->DoAddChild( property, index, true ); }