+// DataBrowser-based implementation
+
+class wxMacDataBrowserListControl : public wxMacListControl
+{
+public:
+ wxMacDataBrowserListControl( wxListBox *peer, const wxPoint& pos, const wxSize& size, long style );
+ ~wxMacDataBrowserListControl();
+
+ void UpdateLine( int n );
+
+ void MacDelete( int n );
+ void MacInsert( int n, const wxString& item );
+ void MacInsert( int n, const wxArrayString& items );
+ void MacAppend( const wxString& item );
+ void MacSet( int n, const wxString& item );
+ void MacClear();
+ void MacDeselectAll();
+ void MacSetSelection( int n, bool select );
+ int MacGetSelection() const;
+ int MacGetSelections( wxArrayInt& aSelections ) const;
+ bool MacIsSelected( int n ) const;
+ void MacScrollTo( int n );
+
+ virtual OSStatus SetSelectionFlags( DataBrowserSelectionFlags );
+ virtual OSStatus AddListViewColumn( DataBrowserListViewColumnDesc *columnDesc,
+ DataBrowserTableViewColumnIndex position );
+ virtual OSStatus AutoSizeListViewColumns();
+ virtual OSStatus SetHasScrollBars( bool horiz, bool vert );
+ virtual OSStatus SetTableViewHiliteStyle( DataBrowserTableViewHiliteStyle hiliteStyle );
+ virtual OSStatus SetListViewHeaderBtnHeight( UInt16 height );
+ virtual OSStatus SetCallbacks( const DataBrowserCallbacks *callbacks );
+ virtual OSStatus UpdateItems( DataBrowserItemID container, UInt32 numItems,
+ const DataBrowserItemID *items,
+ DataBrowserPropertyID preSortProperty,
+ DataBrowserPropertyID propertyID );
+ virtual OSStatus AddItems( DataBrowserItemID container, UInt32 numItems,
+ const DataBrowserItemID *items,
+ DataBrowserPropertyID preSortProperty );
+ virtual OSStatus RemoveItems( DataBrowserItemID container, UInt32 numItems,
+ const DataBrowserItemID *items,
+ DataBrowserPropertyID preSortProperty );
+ virtual OSStatus RevealItem( DataBrowserItemID item,
+ DataBrowserPropertyID propertyID,
+ DataBrowserRevealOptions options );
+ virtual OSStatus GetSelectionAnchor( DataBrowserItemID *first, DataBrowserItemID *last ) const;
+ virtual bool IsItemSelected( DataBrowserItemID item ) const;
+ virtual OSStatus SetSelectedItems( UInt32 numItems,
+ const DataBrowserItemID *items,
+ DataBrowserSetOption operation );
+
+private:
+ // as we are getting the same events for human and API selection we have to suppress
+ // events in the latter case
+ bool MacSuppressSelection( bool suppress );
+ bool MacIsSelectionSuppressed() const { return m_suppressSelection; }
+
+ bool m_suppressSelection;
+
+#if TARGET_API_MAC_OSX
+ static pascal void DataBrowserItemNotificationProc(
+ ControlRef browser,
+ DataBrowserItemID itemID,
+ DataBrowserItemNotification message,
+ DataBrowserItemDataRef itemData );
+#else
+ static pascal void DataBrowserItemNotificationProc(
+ ControlRef browser,
+ DataBrowserItemID itemID,
+ DataBrowserItemNotification message );