+
+wxString wxMacDataBrowserListControl::MacGetString( unsigned int n ) const
+{
+ wxMacListBoxItem * item = (wxMacListBoxItem*) GetItemFromLine( n );
+ return item->GetLabel();
+}
+
+void wxMacDataBrowserListControl::MacSetClientData( unsigned int n, void * data)
+{
+ wxMacListBoxItem* item = (wxMacListBoxItem*) GetItemFromLine( n);
+ item->SetData( data );
+ // not displayed, therefore no Update infos to DataBrowser
+}
+
+void * wxMacDataBrowserListControl::MacGetClientData( unsigned int n) const
+{
+ wxMacListBoxItem * item = (wxMacListBoxItem*) GetItemFromLine( n );
+ return item->GetData();
+}
+
+void wxMacDataBrowserListControl::MacScrollTo( unsigned int n )
+{
+ RevealItem( GetItemFromLine( n) , kDataBrowserRevealWithoutSelecting );
+}
+
+#if 0
+
+// in case we need that one day
+
+// ============================================================================
+// HIView owner-draw-based implementation
+// ============================================================================
+
+static pascal void ListBoxDrawProc(
+ ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property,
+ DataBrowserItemState itemState, const Rect *itemRect, SInt16 depth, Boolean isColorDevice )
+{
+ CFStringRef cfString;
+ ThemeDrawingState themeState;
+ long systemVersion;
+
+ GetThemeDrawingState( &themeState );
+ cfString = CFStringCreateWithFormat( NULL, NULL, CFSTR("Row %d"), item );
+
+ // In this sample we handle the "selected" state; all others fall through to our "active" state
+ if ( itemState == kDataBrowserItemIsSelected )
+ {
+ ThemeBrush colorBrushID;
+
+ // TODO: switch over to wxSystemSettingsNative::GetColour() when kThemeBrushSecondaryHighlightColor
+ // is incorporated Panther DB starts using kThemeBrushSecondaryHighlightColor
+ // for inactive browser highlighting
+ Gestalt( gestaltSystemVersion, &systemVersion );
+ if ( (systemVersion >= 0x00001030) && !IsControlActive( browser ) )
+ colorBrushID = kThemeBrushSecondaryHighlightColor;
+ else
+ colorBrushID = kThemeBrushPrimaryHighlightColor;
+
+ // First paint the hilite rect, then the text on top
+ SetThemePen( colorBrushID, 32, true );
+ PaintRect( itemRect );
+ SetThemeDrawingState( themeState, false );
+ }
+
+ DrawThemeTextBox( cfString, kThemeApplicationFont, kThemeStateActive, true, itemRect, teFlushDefault, NULL );
+ SetThemeDrawingState( themeState, true );
+
+ if ( cfString != NULL )
+ CFRelease( cfString );
+}
+
+#endif
+
+
+#endif // wxUSE_LISTBOX