From: Robert Roebling Date: Fri, 14 Sep 2007 19:50:35 +0000 (+0000) Subject: Patch from Hartwig wrt SELECTION_CHANGE event X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/041a0e26bbe2864268a4305d15f569b91fe26fa3 Patch from Hartwig wrt SELECTION_CHANGE event git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/databrow.cpp b/src/mac/carbon/databrow.cpp index 4902c5d72a..7152558b24 100644 --- a/src/mac/carbon/databrow.cpp +++ b/src/mac/carbon/databrow.cpp @@ -918,22 +918,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da } /* block */ break; case kDataBrowserItemDeselected: - { - // variable definitions: - wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(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(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(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(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: