]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/databrow.cpp
fix warning about not enough parameters for WX_DEFINE_GLOBAL_CONV2 with VC6
[wxWidgets.git] / src / mac / carbon / databrow.cpp
index fa3d7556f012c481ff7c04036be433cad5a90ed3..4902c5d72ace1507e312bf9d6e94ead10a5e7dc8 100644 (file)
@@ -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<wxDataViewCtrl*>(this->GetPeer()));
+
+        wxCHECK_RET(dataViewCtrlPtr != NULL,_("Pointer to data view control not set correctly"));
+       // 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:
         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<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) ||
@@ -1020,5 +1034,5 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
 } /* wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(DataBrowserItemID, DataBrowserItemNotification, DataBrowserItemDataRef) */
 
 
-#endif
- // wxUSE_GENERICDATAVIEWCTRL
+#endif // wxUSE_DATAVIEWCTRL
+#endif // wxUSE_GENERICDATAVIEWCTRL