- if ( event.GetTimestamp() > m_lastTypeIn + 60 )
- {
- m_typeIn = wxEmptyString ;
- }
- m_lastTypeIn = event.GetTimestamp() ;
- m_typeIn += (char) event.GetKeyCode() ;
- int line = FindString(wxT("*")+m_typeIn+wxT("*")) ;
- if ( line >= 0 )
- {
- if ( GetSelection() != line )
- {
- SetSelection(line) ;
- wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId);
- event.SetEventObject( this );
-
- if ( HasClientObjectData() )
- event.SetClientObject( GetClientObject( line ) );
- else if ( HasClientUntypedData() )
- event.SetClientData( GetClientData(line) );
- event.SetString( GetString(line) );
-
- event.m_commandInt = line ;
-
- GetEventHandler()->ProcessEvent(event);
- }
- }
+ SetDataBrowserSortProperty( m_controlRef , kNumericOrderColumnId);
+ SetDataBrowserSortOrder( m_controlRef , kDataBrowserOrderIncreasing);
+ }
+
+ verify_noerr( AutoSizeColumns() );
+ verify_noerr( SetHiliteStyle(kDataBrowserTableViewFillHilite ) );
+ verify_noerr( SetHeaderButtonHeight( 0 ) );
+ err = SetHasScrollBars( (style & wxHSCROLL) != 0 , true );
+#if 0
+ // shouldn't be necessary anymore under 10.2
+ m_peer->SetData( kControlNoPart, kControlDataBrowserIncludesFrameAndFocusTag, (Boolean)false );
+ m_peer->SetNeedsFocusRect( true );
+#endif
+}
+
+wxMacDataBrowserListControl::~wxMacDataBrowserListControl()
+{
+}
+
+wxWindow * wxMacDataBrowserListControl::GetPeer() const
+{
+ return wxDynamicCast( wxMacControl::GetPeer() , wxWindow );
+}
+
+wxMacDataItem* wxMacDataBrowserListControl::CreateItem()
+{
+ return new wxMacListBoxItem();
+}
+
+#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
+ if ( !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 );