// Author: Jaakko Salli
// Modified by:
// Created: 2008-08-24
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) Jaakko Salli
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include "wx/intl.h"
#endif
-#include <wx/propgrid/property.h>
-#include <wx/propgrid/propgrid.h>
+#include "wx/propgrid/property.h"
+#include "wx/propgrid/propgrid.h"
const wxChar *wxPGTypeName_long = wxT("long");
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
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-void wxPropertyGridInterface::SetPropertiesFlag( const wxArrayPGProperty& srcArr,
- wxPGProperty::FlagType flags,
- bool inverse )
-{
- unsigned int i;
-
- for ( i=0; i<srcArr.size(); i++ )
- {
- wxPGProperty* property = srcArr[i];
-
- if ( !inverse )
- property->SetFlag(flags);
- else
- property->ClearFlag(flags);
- }
-
- // If collapsed flag or hidden was manipulated, we need to update virtual
- // size.
- wxPropertyGrid* pg = GetPropertyGrid();
- if ( flags & (wxPG_PROP_COLLAPSED|wxPG_PROP_HIDDEN) )
- {
- GetState()->VirtualHeightChanged();
- pg->RecalculateVirtualSize();
- }
-}
-
-// -----------------------------------------------------------------------
-
void wxPropertyGridInterface::SetBoolChoices( const wxString& trueChoice,
const wxString& falseChoice )
{
IMPLEMENT_GET_VALUE(long,long,Long,0)
IMPLEMENT_GET_VALUE(double,double,Double,0.0)
-IMPLEMENT_GET_VALUE(void,void*,VoidPtr,NULL)
bool wxPropertyGridInterface::IsPropertyExpanded( wxPGPropArg id ) 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("|");
}
}
}
}
+ 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;