X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ea5af9c5356676a5c4d81b4d4915ad32ca3c9c6e..7448d67c492d4e397e6de9d25955cab074ce6c14:/src/propgrid/manager.cpp diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 4952520bbc..c156cb3281 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -41,9 +41,9 @@ // This define is necessary to prevent macro clearing #define __wxPG_SOURCE_FILE__ -#include +#include "wx/propgrid/propgrid.h" -#include +#include "wx/propgrid/manager.h" #define wxPG_MAN_ALTERNATE_BASE_ID 11249 // Needed for wxID_ANY madnesss @@ -72,7 +72,7 @@ // wxPropertyGridManager // ----------------------------------------------------------------------- -const wxChar *wxPropertyGridManagerNameStr = wxT("wxPropertyGridManager"); +const char wxPropertyGridManagerNameStr[] = "wxPropertyGridManager"; // Categoric Mode Icon @@ -259,7 +259,7 @@ wxPropertyGridManager::wxPropertyGridManager( wxWindow *parent, const wxPoint& pos, const wxSize& size, long style, - const wxChar* name ) + const wxString& name ) : wxPanel() { Init1(); @@ -273,7 +273,7 @@ bool wxPropertyGridManager::Create( wxWindow *parent, const wxPoint& pos, const wxSize& size, long style, - const wxChar* name ) + const wxString& name ) { bool res = wxPanel::Create( parent, id, pos, size, @@ -371,7 +371,7 @@ void wxPropertyGridManager::Init2( int style ) #ifdef __WXMAC__ // Smaller controls on Mac SetWindowVariant(wxWINDOW_VARIANT_SMALL); -#endif +#endif // Create propertygrid. m_pPropGrid->Create(this,baseId,wxPoint(0,0),csz, @@ -512,7 +512,7 @@ void wxPropertyGridManager::SetWindowStyleFlag( long style ) (style&wxPG_MAN_PASS_FLAGS_MASK) ); // Need to re-position windows? - if ( (oldWindowStyle & (wxPG_TOOLBAR|wxPG_DESCRIPTION)) != + if ( (oldWindowStyle & (wxPG_TOOLBAR|wxPG_DESCRIPTION)) != (style & (wxPG_TOOLBAR|wxPG_DESCRIPTION)) ) { RecreateControls(); @@ -1287,6 +1287,8 @@ void wxPropertyGridManager::RecreateControls() wxEmptyString,wxDefaultPosition,wxDefaultSize,wxALIGN_LEFT|wxST_NO_AUTORESIZE); m_pTxtHelpContent->SetCursor ( *wxSTANDARD_CURSOR ); } + + SetDescribedProperty(GetSelection()); } else { @@ -1361,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 {