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
This commit is contained in:
Jaakko Salli
2008-10-19 11:29:36 +00:00
parent c904964610
commit 9bc1121429
2 changed files with 14 additions and 2 deletions

View File

@@ -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

View File

@@ -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
{