]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgridpagestate.cpp
Remove the extra margins when checking owner drawn menu icons size.
[wxWidgets.git] / src / propgrid / propgridpagestate.cpp
index 5571a46b5b0ce24c1d8be979800fdb3982242872..cf059678a0ab08cda76ca38f74d7713e0b63522c 100644 (file)
@@ -1866,6 +1866,18 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
             pg->m_deletedProperties.push_back(item);
         else
             pg->m_removedProperties.push_back(item);
+
+        // Rename the property so it won't remain in the way
+        // of the user code.
+
+        // Let's trust that no sane property uses prefix like
+        // this. It would be anyway fairly inconvenient (in
+        // current code) to check whether a new name is used
+        // by another property with parent (due to the child
+        // name notation).
+        wxString newName = wxS("_&/_%$") + item->GetBaseName();
+        DoSetPropertyName(item, newName);
+
         return;
     }
 
@@ -1967,6 +1979,10 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
     if ( pg && pg->m_propHover == item )
         pg->m_propHover = NULL;
 
+    // Mark the property as 'unattached'
+    item->m_parentState = NULL;
+    item->m_parent = NULL;
+
     // We can actually delete it now
     if ( doDelete )
         delete item;