}
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;
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)