X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50a2e26fd717e510a1beae2e1da2f93742907eba..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/osx/carbon/utils.cpp diff --git a/src/osx/carbon/utils.cpp b/src/osx/carbon/utils.cpp index a878933818..860f667d22 100644 --- a/src/osx/carbon/utils.cpp +++ b/src/osx/carbon/utils.cpp @@ -151,44 +151,6 @@ wxString wxMacFindFolder( short vol, #if wxUSE_GUI -// ---------------------------------------------------------------------------- -// Launch document with default app -// ---------------------------------------------------------------------------- - -bool wxLaunchDefaultApplication(const wxString& document, int flags) -{ - wxUnusedVar(flags); - - static const char * const OPEN_CMD = "/usr/bin/open"; - if ( wxFileExists(OPEN_CMD) && - wxExecute(wxString(OPEN_CMD) + " " + document) ) - return true; - - return false; -} - -// ---------------------------------------------------------------------------- -// Launch default browser -// ---------------------------------------------------------------------------- - -bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) -{ - wxUnusedVar(flags); - wxCFRef< CFURLRef > curl( CFURLCreateWithString( kCFAllocatorDefault, - wxCFStringRef( url ), NULL ) ); - OSStatus err = LSOpenCFURLRef( curl , NULL ); - - if (err == noErr) - { - return true; - } - else - { - wxLogDebug(wxT("Browser Launch error %d"), (int) err); - return false; - } -} - // ---------------------------------------------------------------------------- // Miscellaneous functions // ---------------------------------------------------------------------------- @@ -440,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 ); } @@ -929,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; @@ -957,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)