+
+
+// These implement functions needed by wxControlWithItems.
+// Unfortunately, they're not all implemented yet.
+
+int wxChoice::GetCount() const
+{
+ return Number();
+}
+
+int wxChoice::DoAppend(const wxString& item)
+{
+ Append(item);
+ return GetCount() - 1;
+}
+
+// Just appends, doesn't yet insert
+void wxChoice::DoInsertItems(const wxArrayString& items, int WXUNUSED(pos))
+{
+ size_t nItems = items.GetCount();
+
+ for ( size_t n = 0; n < nItems; n++ )
+ {
+ Append( items[n]);
+ }
+}
+
+void wxChoice::DoSetItems(const wxArrayString& items, void **WXUNUSED(clientData))
+{
+ Clear();
+ size_t nItems = items.GetCount();
+
+ for ( size_t n = 0; n < nItems; n++ )
+ {
+ Append(items[n]);
+ }
+}
+
+void wxChoice::DoSetFirstItem(int WXUNUSED(n))
+{
+ wxFAIL_MSG( wxT("wxChoice::DoSetFirstItem not implemented") );
+}
+
+void wxChoice::DoSetItemClientData(int n, void* clientData)
+{
+ wxNode *node = m_clientList.Nth( n );
+ wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientData") );
+
+ node->SetData( (wxObject*) clientData );
+}
+
+void* wxChoice::DoGetItemClientData(int n) const
+{
+ wxNode *node = m_clientList.Nth( n );
+ wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetItemClientData") );
+
+ return node->Data();
+}
+
+void wxChoice::DoSetItemClientObject(int n, wxClientData* clientData)
+{
+ wxNode *node = m_clientList.Nth( n );
+ wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") );
+
+ wxClientData *cd = (wxClientData*) node->Data();
+ delete cd;
+
+ node->SetData( (wxObject*) clientData );
+}
+
+wxClientData* wxChoice::DoGetItemClientObject(int n) const
+{
+ wxNode *node = m_clientList.Nth( n );
+ wxCHECK_MSG( node, (wxClientData *)NULL,
+ wxT("invalid index in wxChoice::DoGetItemClientObject") );
+
+ return (wxClientData*) node->Data();
+}
+
+void wxChoice::Select(int n)
+{
+ SetSelection(n);
+}
+
+void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s))
+{
+ wxFAIL_MSG( wxT("wxChoice::SetString not implemented") );
+}