]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed a bug: Disabling a property didn't work properly if a child item was selected.
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 9 May 2011 19:44:40 +0000 (19:44 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 9 May 2011 19:44:40 +0000 (19:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/propgrid/property.h
src/propgrid/property.cpp
src/propgrid/propgrid.cpp

index aa234eac28ed59d31d2f0cd452975f2a0547720b..7adc9b89308efd2b167f4a9f2aaaf5e74a388981 100644 (file)
@@ -526,6 +526,8 @@ All (GUI):
 - Added support for saving TGA files.
 - Added wxArtProvider returning higher quality icons from Tango project.
 - wxPropertyGrid: Added "HasAlpha" attribute for wxColourProperty.
+- wxPropertyGrid: Disabling a property didn't work properly if a child item
+  was selected (Sébastien Gallou).
 - Added support for saving PNG files with palette (troelsk).
 - Added support for saving as GIF and animated GIF (troelsk).
 - Fix wxWrapSizer minimal size calculation (Catalin Raceanu).
index 106e6ee0f1c6aed71a12aa016b01ec0aab899f15..101cb91e6025ae132b7f2d75ccb81761678adc07 100644 (file)
@@ -2387,6 +2387,11 @@ protected:
     void InitAfterAdded( wxPropertyGridPageState* pageState,
                          wxPropertyGrid* propgrid );
 
+    /**
+        Returns true if child property is selected.
+    */
+    bool IsChildSelected() const;
+
     // Removes child property with given pointer. Does not delete it.
     void RemoveChild( wxPGProperty* p );
 
index 6a35823d037c726b9b706605af91225d367a84e6..3ec89352ebdd7b2b9539c7fad7cf718e407ff179 100644 (file)
@@ -2569,6 +2569,18 @@ void wxPGProperty::DeleteChildren()
     }
 }
 
+bool wxPGProperty::IsChildSelected() const
+{
+    size_t i;
+    for ( i = 0; i < GetChildCount(); i++ )
+    {
+        if ( m_parentState->DoIsPropertySelected( Item(i) ) )
+            return true;
+    }
+
+    return false;
+}
+
 wxVariant wxPGProperty::ChildChanged( wxVariant& WXUNUSED(thisValue),
                                       int WXUNUSED(childIndex),
                                       wxVariant& WXUNUSED(childValue) ) const
index 26a550223a3fd8b616109d8ded2222536a1a9b00..71a918aef1740d0ddac18ff50a7c9f967a3bc4d3 100644 (file)
@@ -2600,7 +2600,7 @@ void wxPropertyGrid::DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 )
 
 void wxPropertyGrid::RefreshProperty( wxPGProperty* p )
 {
-    if ( m_pState->DoIsPropertySelected(p) )
+    if ( m_pState->DoIsPropertySelected(p) || p->IsChildSelected() )
     {
         // NB: We must copy the selection.
         wxArrayPGProperty selection = m_pState->m_selection;