X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c17b2e31516424a77fd54b8fc192eac133269ce4..e1079eda55ffb8d535615040d881d840b4410142:/src/mac/carbon/databrow.cpp diff --git a/src/mac/carbon/databrow.cpp b/src/mac/carbon/databrow.cpp index fa3d7556f0..4902c5d72a 100644 --- a/src/mac/carbon/databrow.cpp +++ b/src/mac/carbon/databrow.cpp @@ -20,6 +20,8 @@ #include "wx/wxprec.h" +#if wxUSE_DATAVIEWCTRL + #include "wx/utils.h" #ifndef WX_PRECOMP @@ -983,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; @@ -994,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) || @@ -1020,5 +1034,5 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da } /* wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(DataBrowserItemID, DataBrowserItemNotification, DataBrowserItemDataRef) */ -#endif - // wxUSE_GENERICDATAVIEWCTRL +#endif // wxUSE_DATAVIEWCTRL +#endif // wxUSE_GENERICDATAVIEWCTRL