+
+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 ) ;
+}
+
+// Listbox item
+wxListBox::wxListBox()
+{
+ m_noItems = 0;
+ m_selected = 0;
+ m_macList = NULL ;
+ m_suppressSelection = false ;
+}
+
+bool wxListBox::Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos,
+ const wxSize& size,
+ const wxArrayString& choices,
+ long style,
+ const wxValidator& validator,
+ const wxString& name)
+{
+ wxCArrayString chs(choices);
+
+ return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
+ style, validator, name);
+}
+