From: Jaakko Salli Date: Sun, 19 Oct 2008 11:29:36 +0000 (+0000) Subject: In wxPropertyGridManager, alphabetic mode is now sorted even if wxPG_AUTO_SORT flag... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9bc11214291c792335fc7820d57d799f61d63943 In wxPropertyGridManager, alphabetic mode is now sorted even if wxPG_AUTO_SORT flag is absent (fixes wxPG sf bug #2162053) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 2c583841e6..ac5d71c018 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -488,8 +488,8 @@ enum wxPG_KEYBOARD_ACTIONS #define wxPG_FL_SPLITTER_PRE_SET 0x00400000 // Validation failed. Clear on modify event. #define wxPG_FL_VALIDATION_FAILED 0x00800000 -// Set if selected is fully painted (ie. both image and text) -//#define wxPG_FL_SELECTED_IS_FULL_PAINT 0x01000000 +// Auto sort is enabled (for categorized mode) +#define wxPG_FL_CATMODE_AUTO_SORT 0x01000000 // Set after page has been inserted to manager #define wxPG_MAN_FL_PAGE_INSERTED 0x02000000 // Active editor control is abnormally large diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 34d7a7f3a9..5a1b675206 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -1363,13 +1363,25 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event ) { // Categorized mode. if ( m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES ) + { + if ( !m_pPropGrid->HasInternalFlag(wxPG_FL_CATMODE_AUTO_SORT) ) + m_pPropGrid->m_windowStyle &= ~wxPG_AUTO_SORT; m_pPropGrid->EnableCategories( true ); + } } else if ( id == ( baseId + ID_ADVTBITEMSBASE_OFFSET + 1 ) ) { // Alphabetic mode. if ( !(m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES) ) + { + if ( m_pPropGrid->HasFlag(wxPG_AUTO_SORT) ) + m_pPropGrid->SetInternalFlag(wxPG_FL_CATMODE_AUTO_SORT); + else + m_pPropGrid->ClearInternalFlag(wxPG_FL_CATMODE_AUTO_SORT); + + m_pPropGrid->m_windowStyle |= wxPG_AUTO_SORT; m_pPropGrid->EnableCategories( false ); + } } else {