+ if ( ! changeValue )
+ {
+ switch (property)
+ {
+
+ case kTextColumnId:
+ {
+ long ref = GetControlReference( browser ) ;
+ if ( ref )
+ {
+ wxListBox* list = wxDynamicCast( (wxObject*) ref , wxListBox ) ;
+ int i = itemID - 1 ;
+ if (i >= 0 && i < list->GetCount() )
+ {
+ wxMacCFStringHolder cf( list->GetString(i) , list->GetFont().GetEncoding() ) ;
+ verify_noerr( ::SetDataBrowserItemDataText( itemData , cf ) ) ;
+ err = noErr ;
+ }
+ }
+ }
+ break;
+
+ default:
+
+ break;
+ }
+ }
+
+ return err;
+}
+
+static pascal void ListBoxDrawProc( ControlRef browser , DataBrowserItemID item , DataBrowserPropertyID property ,
+ DataBrowserItemState itemState , const Rect *itemRect , SInt16 depth , Boolean isColorDevice )
+{
+
+ CFStringRef cfString;
+ long systemVersion;
+
+ cfString = CFStringCreateWithFormat( NULL, NULL, CFSTR("Row %d"), item );
+
+ ThemeDrawingState themeState ;
+ GetThemeDrawingState( &themeState ) ;
+
+ if ( itemState == kDataBrowserItemIsSelected ) // In this sample we handle the "selected" state, all others fall through to our "active" state
+ {
+ Gestalt( gestaltSystemVersion, &systemVersion );
+ if ( (systemVersion >= 0x00001030) && (IsControlActive( browser ) == false) ) // Panther DB starts using kThemeBrushSecondaryHighlightColor for inactive browser hilighting
+ SetThemePen( kThemeBrushSecondaryHighlightColor, 32, true );
+ else
+ SetThemePen( kThemeBrushPrimaryHighlightColor, 32, true );
+
+ PaintRect( itemRect ); // First paint the hilite rect, then the text on top
+ SetThemeDrawingState( themeState , false ) ;
+ }
+ DrawThemeTextBox( cfString, kThemeApplicationFont, kThemeStateActive, true, itemRect, teFlushDefault, NULL );
+ if ( cfString != NULL )
+ CFRelease( cfString );
+ SetThemeDrawingState( themeState , true ) ;
+}