]> git.saurik.com Git - wxWidgets.git/commitdiff
Patch from Hartwig wrt SELECTION_CHANGE event
authorRobert Roebling <robert@roebling.de>
Fri, 14 Sep 2007 19:50:35 +0000 (19:50 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 14 Sep 2007 19:50:35 +0000 (19:50 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/databrow.cpp

index 4902c5d72ace1507e312bf9d6e94ead10a5e7dc8..7152558b24108c1d6141f00888bef45a728ddf02 100644 (file)
@@ -918,22 +918,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
       } /* block */
       break;
     case kDataBrowserItemDeselected:
-      {
-       // variable definitions:
-        wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast<wxDataViewCtrl*>(this->GetPeer()));
-        
-        if (dataViewCtrlPtr != NULL) // can become NULL if an item is still selected while removing the data browser
-        {
-         // initialize wxWidget event:
-          wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_DESELECTED,dataViewCtrlPtr->GetId()); // variable definition
-          
-          dataViewEvent.SetEventObject(dataViewCtrlPtr);
-          dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
-         // finally send the equivalent wxWidget event:
-          dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
-        } /* if */
-      } /* block */
-      break;
+      break; // not implemented by wxWidgets; see kDataBrowserSelectionSetChanged
     case kDataBrowserItemDoubleClicked:
       {
        // variable definitions:
@@ -967,22 +952,22 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
       } /* block */
       break;
     case kDataBrowserItemSelected:
+      break; // not implemented by wxWidgets; see kDataBrowserSelectionSetChanged
+    case kDataBrowserSelectionSetChanged:
       {
        // variable definitions:
         wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast<wxDataViewCtrl*>(this->GetPeer()));
         
         wxCHECK_RET(dataViewCtrlPtr != NULL,_("Pointer to data view control not set correctly."));
        // initialize wxWidget event:
-        wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_SELECTED,dataViewCtrlPtr->GetId()); // variable definition
+        wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED,dataViewCtrlPtr->GetId()); // variable definition
 
         dataViewEvent.SetEventObject(dataViewCtrlPtr);
-        dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
+        dataViewEvent.SetModel      (dataViewCtrlPtr->GetModel());
        // finally send the equivalent wxWidget event:
         dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
       } /* block */
       break;
-    case kDataBrowserSelectionSetChanged:
-      break;
     case kDataBrowserUserStateChanged:
       {
        // variable definitions and initialization: