+void wxListBox::SetupColours()
+{
+ SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
+ SetForegroundColour(GetParent()->GetForegroundColour());
+}
+
+void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
+{
+ // Set up port
+ WindowRef rootwindow = GetMacRootWindow() ;
+ wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
+ wxMacDrawingHelper focus( wxrootwindow );
+
+ UMADrawControl(m_macControl);
+}
+
+#if wxUSE_OWNER_DRAWN
+
+class wxListBoxItem : public wxOwnerDrawn
+{
+public:
+ wxListBoxItem(const wxString& str = "");
+};
+
+wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE)
+{
+ // no bitmaps/checkmarks
+ SetMarginWidth(0);
+}
+
+wxOwnerDrawn *wxListBox::CreateItem(size_t n)
+{
+ return new wxListBoxItem();
+}
+
+#endif //USE_OWNER_DRAWN
+
+// ============================================================================
+// list box control implementation
+// ============================================================================
+
+void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon)
+{
+ wxListBox* list;
+ // typecast our refCon
+ list = (wxListBox*)refCon;
+
+ MoveTo(cellRect->left + 4 , cellRect->top + 10 );
+ const wxString text = list->m_stringArray[lCell.v] ;
+ ::TextFont( kFontIDMonaco ) ;
+ ::TextSize( 9 );
+ ::TextFace( 0 ) ;
+ DrawText(text, 0 , text.Length());
+
+}
+
+void wxListBox::MacDelete( int N )
+{
+ LDelRow( 1 , N , m_macList) ;
+ Refresh();
+}
+
+void wxListBox::MacInsert( int n , const char * text)
+{
+ Cell cell = { 0 , 0 } ;
+ cell.v = n ;
+ LAddRow( 1 , cell.v , m_macList ) ;
+// LSetCell(text, strlen(text), cell, m_macList);
+ Refresh();
+}
+
+void wxListBox::MacAppend( const char * text)
+{
+ Cell cell = { 0 , 0 } ;
+ cell.v = (**m_macList).dataBounds.bottom ;
+ LAddRow( 1 , cell.v , m_macList ) ;
+ // LSetCell(text, strlen(text), cell, m_macList);
+ Refresh();
+}
+
+void wxListBox::MacClear()
+{
+ LDelRow( (**m_macList).dataBounds.bottom , 0 , m_macList ) ;
+ Refresh();
+}
+
+void wxListBox::MacSetSelection( int n , bool select )
+{
+ Cell cell = { 0 , 0 } ;
+ if ( ! (m_windowStyle & wxLB_MULTIPLE) )
+ {
+ if ( LGetSelect( true , &cell , m_macList ) )
+ {
+ LSetSelect( false , cell , m_macList ) ;