]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/property.cpp
Large image-loading speedup and small attribute-loading speedup
[wxWidgets.git] / src / propgrid / property.cpp
index 333a27d0c8a7e8c673900d428b80559471095092..e759aa5d7288e5373eb80296d1c0543da8d598e4 100644 (file)
@@ -1492,6 +1492,31 @@ wxVariant wxPGProperty::GetDefaultValue() const
     return wxVariant();
 }
 
+void wxPGProperty::Enable( bool enable )
+{
+    wxPropertyGrid* pg = GetGrid();
+
+    // Preferably call the version in the owning wxPropertyGrid,
+    // since it handles the editor de-activation.
+    if ( pg )
+        pg->EnableProperty(this, enable);
+    else
+        DoEnable(enable);
+}
+
+void wxPGProperty::DoEnable( bool enable )
+{
+    if ( enable )
+        ClearFlag(wxPG_PROP_DISABLED);
+    else
+        SetFlag(wxPG_PROP_DISABLED);
+
+    // Apply same to sub-properties as well
+    unsigned int i;
+    for ( i = 0; i < GetChildCount(); i++ )
+        Item(i)->DoEnable( enable );
+}
+
 void wxPGProperty::EnsureCells( unsigned int column )
 {
     if ( column >= m_cells.size() )