]> git.saurik.com Git - wxWidgets.git/commitdiff
In wxPropertyGridManager, alphabetic mode is now sorted even if wxPG_AUTO_SORT flag...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 19 Oct 2008 11:29:36 +0000 (11:29 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 19 Oct 2008 11:29:36 +0000 (11:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
src/propgrid/manager.cpp

index 2c583841e6f3bfa8bbc1baf9cc28b2d02a0bbfa4..ac5d71c0184863d1f3530118e5990c1266cf1a69 100644 (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
index 34d7a7f3a98b5aaeedd900755eed7605805f973c..5a1b675206a7c2c08cc0a61465374e98b20f9f0e 100644 (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
         {