+ wxCHECK_RET(this->GetColumnIndex(propertyID,&columnIndex),_("Column index not found."));
+ dataViewEvent.SetColumn(columnIndex);
+ dataViewEvent.SetDataViewColumn(dataViewCtrlPtr->GetColumnPtr(propertyID));
+ } /* if */
+ // finally send the equivalent wxWidget event:
+ dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+ } /* block */
+ break;
+ case kDataBrowserItemAdded:
+ dataViewCtrlPtr->FinishCustomItemEditing();
+ break;
+ case kDataBrowserItemDeselected:
+ dataViewCtrlPtr->FinishCustomItemEditing();
+ break;
+ case kDataBrowserItemDoubleClicked:
+ {
+ // initialize wxWidget event:
+ wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED,dataViewCtrlPtr->GetId()); // variable definition
+
+ dataViewEvent.SetEventObject(dataViewCtrlPtr);
+ dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
+ // finally send the equivalent wxWidget event:
+ dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+ } /* block */
+ break;
+ case kDataBrowserItemRemoved:
+ dataViewCtrlPtr->FinishCustomItemEditing(); // stop editing of a custom item first (if necessary)
+ break;
+ case kDataBrowserItemSelected:
+ break; // not implemented by wxWidgets; see kDataBrowserSelectionSetChanged
+ case kDataBrowserSelectionSetChanged:
+ {
+ // initialize wxWidget event:
+ wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED,dataViewCtrlPtr->GetId()); // variable definition
+
+ dataViewEvent.SetEventObject(dataViewCtrlPtr);
+ dataViewEvent.SetModel (dataViewCtrlPtr->GetModel());
+ // finally send the equivalent wxWidget event:
+ dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+ } /* block */
+ break;
+ case kDataBrowserTargetChanged: // no idea if this notification is ever sent
+ break;
+ case kDataBrowserUserStateChanged:
+ {
+ // finish custom item editing if necessary:
+ dataViewCtrlPtr->FinishCustomItemEditing();
+ // update column widths:
+ for (size_t i=0; i<dataViewCtrlPtr->GetColumnCount(); ++i)
+ {
+ // constant definition for abbreviational purposes:
+ wxDataViewColumn* const columnPtr = dataViewCtrlPtr->GetColumn(i);
+ // variable definition:
+ UInt16 columnWidth;
+
+ wxCHECK_RET(this->GetColumnWidth(columnPtr->GetPropertyID(),&columnWidth) == noErr,_("Column width could not be determined"));
+ columnPtr->SetWidthVariable(columnWidth);
+ } /* for */
+ // update sorting orders:
+ DataBrowserPropertyID propertyID; // variable definition
+
+ if ((this->GetSortProperty(&propertyID) == noErr) && (propertyID >= kMinPropertyID))
+ {
+ DataBrowserSortOrder sortOrder;
+ DataBrowserTableViewColumnIndex columnIndex;
+
+ if ((this->GetSortOrder(&sortOrder) == noErr) && (this->GetColumnIndex(propertyID,&columnIndex) == noErr))
+ {
+ // variable definition and initialization:
+ wxDataViewColumn* columnPtr;
+ columnPtr = dataViewCtrlPtr->GetColumn(columnIndex);
+ // check if the sort order has changed:
+ if ( columnPtr->IsSortOrderAscending() && (sortOrder == kDataBrowserOrderDecreasing) ||
+ !(columnPtr->IsSortOrderAscending()) && (sortOrder == kDataBrowserOrderIncreasing))
+ {
+ columnPtr->SetSortOrder(!(columnPtr->IsSortOrderAscending()));
+ // initialize wxWidget event:
+ wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED,dataViewCtrlPtr->GetId()); // variable defintion
+
+ dataViewEvent.SetEventObject(dataViewCtrlPtr);
+ dataViewEvent.SetColumn(columnIndex);
+ dataViewEvent.SetDataViewColumn(columnPtr);
+ // finally send the equivalent wxWidget event:
+ dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+ } /* if */
+ } /* if */
+ } /* if */
+ } /* block */
+ break;
+ } /* switch */
+} /* wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(DataBrowserItemID, DataBrowserItemNotification, DataBrowserItemDataRef) */
+
+void wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice)
+{
+ DataBrowserTableViewColumnIndex columnIndex;