X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2bc1d69812f8fc3f6ae24508a9d007ad5d00ede..c147c966dfcb12b72185f1e41dbeaa3ef99288be:/src/mac/carbon/utils.cpp diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 2bcb67b33c..33f2e098ce 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -1870,7 +1870,7 @@ void wxMacDataItemBrowserControl::UpdateItems(const wxMacDataItem *container, } void wxMacDataItemBrowserControl::InsertColumn(int colId, DataBrowserPropertyType colType, - const wxString& title, SInt16 just, int minWidth, int maxWidth) + const wxString& title, SInt16 just, int defaultWidth) { DataBrowserListViewColumnDesc columnDesc; columnDesc.headerBtnDesc.titleOffset = 0; @@ -1894,25 +1894,23 @@ void wxMacDataItemBrowserControl::InsertColumn(int colId, DataBrowserPropertyTyp wxMacCFStringHolder cfTitle; cfTitle.Assign( title, enc ); columnDesc.headerBtnDesc.titleString = cfTitle; - - int colMinWidth = 0; - if (minWidth != -1) - colMinWidth = minWidth; - columnDesc.headerBtnDesc.minimumWidth = colMinWidth; - - int colMaxWidth = 500; - if (maxWidth != -1) - colMaxWidth = maxWidth; - columnDesc.headerBtnDesc.maximumWidth = colMaxWidth; + + columnDesc.headerBtnDesc.minimumWidth = 0; + columnDesc.headerBtnDesc.maximumWidth = 30000; columnDesc.propertyDesc.propertyID = (kMinColumnId + colId); columnDesc.propertyDesc.propertyType = colType; - columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewDefaultColumnFlags | kDataBrowserListViewNoGapForIconInHeaderButton; -#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2 - columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn; + columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewSortableColumn | kDataBrowserListViewTypeSelectColumn; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton; #endif verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) ); + + if (defaultWidth > 0){ + SetColumnWidth(colId, defaultWidth); + } + } void wxMacDataItemBrowserControl::SetColumnWidth(int colId, int width)