X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ee5edc7997cc58d93e4d32be8177041eac19abc..02b94f4e73cd7423b27aafb388179a8c7e856df1:/src/osx/carbon/utils.cpp?ds=sidebyside diff --git a/src/osx/carbon/utils.cpp b/src/osx/carbon/utils.cpp index e22569821c..860f667d22 100644 --- a/src/osx/carbon/utils.cpp +++ b/src/osx/carbon/utils.cpp @@ -144,8 +144,17 @@ wxString wxMacFindFolder( short vol, #endif // wxUSE_BASE + +// ============================================================================ +// GUI-only functions from now on +// ============================================================================ + #if wxUSE_GUI +// ---------------------------------------------------------------------------- +// Miscellaneous functions +// ---------------------------------------------------------------------------- + void wxGetMousePosition( int* x, int* y ) { Point pt; @@ -393,7 +402,8 @@ OSStatus wxMacDataBrowserControl::AddColumn( DataBrowserListViewColumnDesc *colu return AddDataBrowserListViewColumn( m_controlRef, columnDesc, position ); } -OSStatus wxMacDataBrowserControl::GetColumnIDFromIndex( DataBrowserTableViewColumnIndex position, DataBrowserTableViewColumnID* id ){ +OSStatus wxMacDataBrowserControl::GetColumnIDFromIndex( DataBrowserTableViewColumnIndex position, DataBrowserTableViewColumnID* id ) +{ return GetDataBrowserTableViewColumnProperty( m_controlRef, position, id ); } @@ -679,11 +689,10 @@ bool wxMacDataItem::IsLessThan(wxMacDataItemBrowserControl *WXUNUSED(owner) , const wxMacDataItem* rhs, DataBrowserPropertyID sortProperty) const { - const wxMacDataItem* otherItem = wx_const_cast(wxMacDataItem*,rhs); bool retval = false; if ( sortProperty == kNumericOrderColumnId ) - retval = m_order < otherItem->m_order; + retval = m_order < rhs->m_order; return retval; } @@ -883,7 +892,9 @@ void wxMacDataItemBrowserControl::UpdateItems(const wxMacDataItem *container, delete [] items; } -void wxMacDataItemBrowserControl::InsertColumn(int colId, DataBrowserPropertyType colType, +static int column_id_counter = 0; + +void wxMacDataItemBrowserControl::InsertColumn(int col, DataBrowserPropertyType colType, const wxString& title, SInt16 just, int defaultWidth) { DataBrowserListViewColumnDesc columnDesc; @@ -911,18 +922,20 @@ void wxMacDataItemBrowserControl::InsertColumn(int colId, DataBrowserPropertyTyp columnDesc.headerBtnDesc.minimumWidth = 0; columnDesc.headerBtnDesc.maximumWidth = 30000; - columnDesc.propertyDesc.propertyID = (kMinColumnId + colId); + DataBrowserPropertyID id = kMinColumnId + column_id_counter; + column_id_counter++; + + columnDesc.propertyDesc.propertyID = id; columnDesc.propertyDesc.propertyType = colType; columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewSortableColumn; columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn; columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton; - verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) ); + verify_noerr( AddColumn( &columnDesc, col ) ); if (defaultWidth > 0){ - SetColumnWidth(colId, defaultWidth); + SetColumnWidth(col, defaultWidth); } - } void wxMacDataItemBrowserControl::SetColumnWidth(int colId, int width)