X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/effb029c30207ced2f1ca28691dba068a28c26c5..357d2b88cb15fa0ad97b1676fdbc88c2abc85451:/src/propgrid/propgridiface.cpp diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 96fe84fdbb..43906487ab 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -4,7 +4,7 @@ // Author: Jaakko Salli // Modified by: // Created: 2008-08-24 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) Jaakko Salli // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -37,8 +37,8 @@ #include "wx/intl.h" #endif -#include -#include +#include "wx/propgrid/property.h" +#include "wx/propgrid/propgrid.h" const wxChar *wxPGTypeName_long = wxT("long"); @@ -475,6 +475,23 @@ void wxPropertyGridInterface::SetPropertyValueUnspecified( wxPGPropArg id ) p->GetParentState()->DoSetPropertyValueUnspecified(p); } +// ----------------------------------------------------------------------- + +void wxPropertyGridInterface::ClearModifiedStatus() +{ + unsigned int pageIndex = 0; + + for (;;) + { + wxPropertyGridPageState* page = GetPageState(pageIndex); + if ( !page ) break; + + page->DoGetRoot()->SetFlagRecursively(wxPG_PROP_MODIFIED, false); + + pageIndex++; + } +} + // ----------------------------------------------------------------------- // wxPropertyGridInterface property value setting and getting // ----------------------------------------------------------------------- @@ -995,6 +1012,12 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const else result += wxS("0;"); } + if ( includedStates & DescBoxState ) + { + wxVariant v = GetEditableStateItem(wxS("descboxheight")); + if ( !v.IsNull() ) + result += wxString::Format(wxS("descboxheight=%i;"), (int)v.GetLong()); + } result.RemoveLast(); // Remove last semicolon result += wxS("|"); } @@ -1132,6 +1155,21 @@ bool wxPropertyGridInterface::RestoreEditableState( const wxString& src, int res } } } + else if ( key == wxS("descboxheight") ) + { + if ( restoreStates & DescBoxState ) + { + long descBoxHeight; + if ( values.size() == 1 && values[0].ToLong(&descBoxHeight) ) + { + SetEditableStateItem(wxS("descboxheight"), descBoxHeight); + } + else + { + res = false; + } + } + } else { res = false;