X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3fd36e7c3ec8f9ee727e203a68286f4b763593f..e1079eda55ffb8d535615040d881d840b4410142:/src/mac/carbon/databrow.cpp?ds=sidebyside diff --git a/src/mac/carbon/databrow.cpp b/src/mac/carbon/databrow.cpp index e3e4610a48..4902c5d72a 100644 --- a/src/mac/carbon/databrow.cpp +++ b/src/mac/carbon/databrow.cpp @@ -985,8 +985,23 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da break; case kDataBrowserUserStateChanged: { + // variable definitions and initialization: DataBrowserPropertyID propertyID; - + wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->GetPeer())); + + wxCHECK_RET(dataViewCtrlPtr != NULL,_("Pointer to data view control not set correctly")); + // update column widths: + for (size_t i=0; iGetColumnCount(); ++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: if ((this->GetSortProperty(&propertyID) == noErr) && (propertyID >= kMinPropertyID)) { DataBrowserSortOrder sortOrder; @@ -996,9 +1011,6 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da { // variable definition and initialization: wxDataViewColumn* columnPtr; - wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(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) ||