+ OSStatus err = noErr;
+ m_clientDataItemsType = wxClientData_None;
+ if ( style & wxLB_SORT )
+ m_sortOrder = SortOrder_Text_Ascending;
+
+ DataBrowserSelectionFlags options = kDataBrowserDragSelect;
+ if ( style & wxLB_MULTIPLE )
+ {
+ options |= kDataBrowserAlwaysExtendSelection | kDataBrowserCmdTogglesSelection;
+ }
+ else if ( style & wxLB_EXTENDED )
+ {
+ options |= kDataBrowserCmdTogglesSelection;
+ }
+ else
+ {
+ options |= kDataBrowserSelectOnlyOne;
+ }
+ err = SetSelectionFlags( options );
+ verify_noerr( err );
+
+ DataBrowserListViewColumnDesc columnDesc;
+ columnDesc.headerBtnDesc.titleOffset = 0;
+ columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc;
+
+ columnDesc.headerBtnDesc.btnFontStyle.flags =
+ kControlUseFontMask | kControlUseJustMask;
+
+ columnDesc.headerBtnDesc.btnContentInfo.contentType = kControlNoContent;
+ columnDesc.headerBtnDesc.btnFontStyle.just = teFlushDefault;
+ columnDesc.headerBtnDesc.btnFontStyle.font = kControlFontViewSystemFont;
+ columnDesc.headerBtnDesc.btnFontStyle.style = normal;
+ columnDesc.headerBtnDesc.titleString = NULL;
+
+ columnDesc.headerBtnDesc.minimumWidth = 0;
+ columnDesc.headerBtnDesc.maximumWidth = 10000;
+
+ columnDesc.propertyDesc.propertyID = kTextColumnId;
+ columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
+ columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn;
+ columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
+
+ verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) );
+
+ columnDesc.headerBtnDesc.minimumWidth = 0;
+ columnDesc.headerBtnDesc.maximumWidth = 0;
+ columnDesc.propertyDesc.propertyID = kNumericOrderColumnId;
+ columnDesc.propertyDesc.propertyType = kDataBrowserPropertyRelevanceRankPart;
+ columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn;
+ columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
+
+ verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) );
+
+ SetDataBrowserSortProperty( m_controlRef , kTextColumnId);
+ if ( m_sortOrder == SortOrder_Text_Ascending )
+ {
+ SetDataBrowserSortProperty( m_controlRef , kTextColumnId);
+ SetDataBrowserSortOrder( m_controlRef , kDataBrowserOrderIncreasing);
+ }
+ else
+ {
+ 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