]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix completely wrong logic for veto checking in generic wxDVC.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Aug 2011 15:11:22 +0000 (15:11 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Aug 2011 15:11:22 +0000 (15:11 +0000)
The code sending the event must check whether the event was vetoed or not, not
whether it was skipped or not. This is the minimal change resulting in correct
behaviour even if an event handler does skip the event.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datavgen.cpp

index 7cebed518a7dffea5a019ab1c4b2740e9804d1e0..15d51d7992a1bb2a8e0f478a8d7bdff339e987f8 100644 (file)
@@ -2959,7 +2959,7 @@ void wxDataViewMainWindow::Expand( unsigned int row )
                     SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, node->GetItem());
 
                 // Check if the user prevent expanding
-                if( e.GetSkipped() )
+                if( !e.IsAllowed() )
                     return;
 
                 node->ToggleOpen();
@@ -3013,7 +3013,7 @@ void wxDataViewMainWindow::Collapse(unsigned int row)
         {
             wxDataViewEvent e =
                 SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING,node->GetItem());
-            if( e.GetSkipped() )
+            if( !e.IsAllowed() )
                 return;
 
             // Find out if there are selected items below the current node.