+ str = wxMacMakeMacStringFromPC( s ) ;
+ }
+ else
+ str = s ;
+ m_stringArray[N] = str ;
+ MacSet( N , s ) ;
+}
+
+wxSize wxListBox::DoGetBestSize() const
+{
+ return wxSize(100, 100);
+}
+
+int wxListBox::GetCount() const
+{
+ return m_noItems;
+}
+
+void wxListBox::SetupColours()
+{
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
+ SetForegroundColour(GetParent()->GetForegroundColour());
+}
+
+void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
+{
+ wxControl::Refresh( eraseBack , rect ) ;
+// MacRedrawControl() ;
+}
+
+#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 , (ListHandle)m_macList) ;
+ Refresh();
+}
+
+void wxListBox::MacInsert( int n , const char * text)
+{
+ Cell cell = { 0 , 0 } ;
+ cell.v = n ;
+ LAddRow( 1 , cell.v , (ListHandle)m_macList ) ;
+// LSetCell(text, strlen(text), cell, m_macList);
+ Refresh();
+}
+
+void wxListBox::MacAppend( const char * text)
+{
+ Cell cell = { 0 , 0 } ;
+ cell.v = (**(ListHandle)m_macList).dataBounds.bottom ;
+ LAddRow( 1 , cell.v , (ListHandle)m_macList ) ;
+ // LSetCell(text, strlen(text), cell, m_macList);
+ Refresh();
+}
+
+void wxListBox::MacClear()
+{
+ LDelRow( (**(ListHandle)m_macList).dataBounds.bottom , 0 ,(ListHandle) m_macList ) ;
+ Refresh();
+}