#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
// ----------------------------------------------------------------------------
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 );
}
return SetDataBrowserListViewDisclosureColumn( m_controlRef, property, expandableRows);
}
+OSStatus wxMacDataBrowserControl::GetItemPartBounds( DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserPropertyPart part, Rect * bounds )
+{
+ return GetDataBrowserItemPartBounds( m_controlRef, item, property, part, bounds);
+}
+
// ============================================================================
// Higher-level Databrowser
// ============================================================================
{
wxMacDataItem* itemOne = (wxMacDataItem*) itemOneID;
wxMacDataItem* itemTwo = (wxMacDataItem*) itemTwoID;
- return CompareItems( itemOne , itemTwo , sortProperty );
-}
-Boolean wxMacDataItemBrowserControl::CompareItems(const wxMacDataItem* itemOne,
- const wxMacDataItem* itemTwo,
- DataBrowserPropertyID sortProperty)
-{
Boolean retval = false;
if ( itemOne != NULL )
retval = itemOne->IsLessThan( this , itemTwo , sortProperty);
Boolean changeValue )
{
wxMacDataItem* item = (wxMacDataItem*) itemID;
- return GetSetItemData(item, property, itemData , changeValue );
-}
-
-OSStatus wxMacDataItemBrowserControl::GetSetItemData(
- wxMacDataItem* item,
- DataBrowserPropertyID property,
- DataBrowserItemDataRef itemData,
- Boolean changeValue )
-{
OSStatus err = errDataBrowserPropertyNotSupported;
switch( property )
{
DataBrowserItemDataRef itemData)
{
wxMacDataItem* item = (wxMacDataItem*) itemID;
- ItemNotification( item , message, itemData);
-}
-
-void wxMacDataItemBrowserControl::ItemNotification(
- const wxMacDataItem* item,
- DataBrowserItemNotification message,
- DataBrowserItemDataRef itemData)
-{
if (item != NULL)
item->Notification( this, message, itemData);
}
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;
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)
void wxMacDataItemBrowserControl::RemoveAllItems(wxMacDataItem *container)
{
+ SetScrollPosition(0, 0);
OSStatus err = wxMacDataBrowserControl::RemoveItems( (DataBrowserItemID)container, 0 , NULL , kDataBrowserItemNoProperty );
verify_noerr( err );
}
{
if ( m_sortOrder == SortOrder_None )
{
-
+
// increase the order of the lines to be shifted
unsigned int lines = MacGetCount();
for ( unsigned int i = n; i < lines; ++i)
wxMacDataItem* iter = (wxMacDataItem*) GetItemFromLine(i);
iter->SetOrder( iter->GetOrder() + 1 );
}
-
+
#if 0
// I don't understand what this code is supposed to do, RR.
SInt32 frontLineOrder = 0;
wxMacDataItem* iter = (wxMacDataItem*) GetItemFromLine(n-1);
frontLineOrder = iter->GetOrder()+1;
}
-#else
+#else
item->SetOrder( n );
#endif
}