- wxDataViewColumn* columnPtr;
- wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast<wxDataViewCtrl*>(this->GetPeer()));
-
- wxCHECK_RET(dataViewCtrlPtr != NULL,_("Pointer to data vie wcontrol not set correctly."));
- columnPtr = dataViewCtrlPtr->GetColumn(columnIndex);
- // check if the sort order has changed:
- if ( columnPtr->IsSortOrderAscending() && (sortOrder == kDataBrowserOrderDecreasing) ||
- !(columnPtr->IsSortOrderAscending()) && (sortOrder == kDataBrowserOrderIncreasing))
+ DataBrowserTableViewColumnIndex columnIndex;
+
+ 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->HandleWindowEvent(dataViewEvent);
+ } /* block */
+ break;
+ case kDataBrowserItemAdded:
+ break; // not used anymore
+ case kDataBrowserItemDeselected:
+ break; // not implemented by wxWidgets; see kDataBrowserSelectionSetChanged
+ 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->HandleWindowEvent(dataViewEvent);
+ } /* block */
+ break;
+ case kDataBrowserItemRemoved:
+ break; // not used anymore
+ 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->HandleWindowEvent(dataViewEvent);
+ } /* block */
+ break;
+ case kDataBrowserUserStateChanged:
+ {
+ // 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 order status:
+ 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))