+wxNSComboBoxControl::wxNSComboBoxControl( wxWindow *wxPeer, WXWidget w ) : wxNSTextFieldControl(wxPeer, w)
+{
+ m_comboBox = (NSComboBox*)w;
+}
+
+wxNSComboBoxControl::~wxNSComboBoxControl()
+{
+}
+
+int wxNSComboBoxControl::GetSelectedItem() const
+{
+ return [m_comboBox indexOfSelectedItem];
+}
+
+void wxNSComboBoxControl::SetSelectedItem(int item)
+{
+ wxASSERT_MSG(item >= 0 && item < [m_comboBox numberOfItems], "Inavlid item index.");
+ SendEvents(false);
+ [m_comboBox selectItemAtIndex: item];
+ SendEvents(true);
+}
+
+int wxNSComboBoxControl::GetNumberOfItems() const
+{
+ return [m_comboBox numberOfItems];
+}
+
+void wxNSComboBoxControl::InsertItem(int pos, const wxString& item)
+{
+ [m_comboBox insertItemWithObjectValue:wxCFStringRef( item , m_wxPeer->GetFont().GetEncoding() ).AsNSString() atIndex:pos];
+}
+
+void wxNSComboBoxControl::RemoveItem(int pos)
+{
+ SendEvents(false);
+ [m_comboBox removeItemAtIndex:pos];
+ SendEvents(true);
+}
+
+void wxNSComboBoxControl::Clear()
+{
+ SendEvents(false);
+ [m_comboBox removeAllItems];
+ SendEvents(true);
+}
+
+wxString wxNSComboBoxControl::GetStringAtIndex(int pos) const
+{
+ return wxCFStringRef::AsString([m_comboBox itemObjectValueAtIndex:pos], m_wxPeer->GetFont().GetEncoding());
+}
+
+int wxNSComboBoxControl::FindString(const wxString& text) const
+{
+ int result = [m_comboBox indexOfItemWithObjectValue:wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
+ if (result == NSNotFound)
+ result = wxNOT_FOUND;
+ return result;
+}
+