+int wxComboBox::DoAppend(const wxString& item)
+{
+ wxXmString str( item.c_str() );
+ XmComboBoxAddItem((Widget) m_mainWidget, str(), 0);
+ m_stringList.Add(item);
+ m_noStrings ++;
+
+ return GetCount() - 1;
+}
+
+void wxComboBox::Delete(int n)
+{
+ XmComboBoxDeletePos((Widget) m_mainWidget, n+1);
+ wxStringList::Node *node = m_stringList.Item(n);
+ if (node)
+ {
+ delete[] node->GetData();
+ delete node;
+ }
+ m_clientDataDict.Delete(n, HasClientObjectData());
+ m_noStrings--;
+}
+
+void wxComboBox::Clear()
+{
+ XmComboBoxDeleteAllItems((Widget) m_mainWidget);
+ m_stringList.Clear();
+
+ if ( HasClientObjectData() )
+ m_clientDataDict.DestroyData();
+ m_noStrings = 0;
+}
+
+void wxComboBox::SetSelection (int n)
+{
+ XmComboBoxSelectPos((Widget) m_mainWidget, n+1, False);
+}
+
+int wxComboBox::GetSelection (void) const
+{
+ int sel = XmComboBoxGetSelectedPos((Widget) m_mainWidget);
+ if (sel == 0)
+ return -1;
+ else
+ return sel - 1;
+}
+
+wxString wxComboBox::GetString(int n) const
+{
+ wxStringList::Node *node = m_stringList.Item(n);
+ if (node)
+ return wxString(node->GetData ());
+ else
+ return wxEmptyString;
+}
+
+int wxComboBox::FindString(const wxString& s) const
+{
+ int *pos_list = NULL;
+ int count = 0;
+ wxXmString text( s );
+ bool found = (XmComboBoxGetMatchPos((Widget) m_mainWidget,
+ text(), &pos_list, &count) != 0);
+
+ if (found && count > 0)
+ {
+ int pos = pos_list[0] - 1;
+ free(pos_list);
+ return pos;
+ }
+
+ return -1;
+}
+