m_noItems --;
MacDelete( N ) ;
- SetHorizontalExtent("");
}
int wxListBox::DoAppend(const wxString& item)
m_noItems ++;
MacAppend( item ) ;
- SetHorizontalExtent(item);
-
return index ;
}
m_stringArray.Empty() ;
m_dataArray.Empty() ;
MacClear() ;
- SetHorizontalExtent();
}
void wxListBox::SetSelection(int N, bool select)
return (void *)m_dataArray[N];
}
+wxClientData *wxListBox::DoGetItemClientObject(int N) const
+{
+ return (wxClientData *) DoGetItemClientData( N ) ;
+}
+
void wxListBox::DoSetItemClientData(int N, void *Client_data)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
return wxSize(100, 100);
}
+int wxListBox::GetCount() const
+{
+ return m_noItems;
+}
+
+void wxListBox::SetupColours()
+{
+ SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
+ SetForegroundColour(GetParent()->GetForegroundColour());
+}
+
+#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
int n, count = GetSelections(aSelections);
if ( count > 0 )
{
- event.m_commandInt = aSelections[0] ;
- if ( HasClientObjectData() )
+ n = aSelections[0];
+ if ( HasClientObjectData() )
event.SetClientObject( GetClientObject(n) );
else if ( HasClientUntypedData() )
event.SetClientData( GetClientData(n) );