X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/96dfe7577ab7b85ba774a87fc2bc82c0f85025a4..c26400bd067ce812a7dd3b090dce0928b8b0e80e:/src/osx/combobox_osx.cpp diff --git a/src/osx/combobox_osx.cpp b/src/osx/combobox_osx.cpp index 22ae6a9256..214bdbdff4 100644 --- a/src/osx/combobox_osx.cpp +++ b/src/osx/combobox_osx.cpp @@ -72,8 +72,10 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, Append(n, choices); - // Set the first item as being selected - if (n > 0) + // Set up the initial value, by default the first item is selected. + if ( !value.empty() ) + SetValue(value); + else if (n > 0) SetSelection( 0 ); // Needed because it is a wxControlWithItems @@ -145,7 +147,6 @@ void wxComboBox::DoDeleteOneItem(unsigned int n) void wxComboBox::DoClear() { GetComboPeer()->Clear(); - SetValue(wxEmptyString); } void wxComboBox::GetSelection(long *from, long *to) const @@ -202,7 +203,8 @@ void wxComboBox::SetString(unsigned int n, const wxString& s) void wxComboBox::EnableTextChangedEvents(bool WXUNUSED(enable)) { - wxFAIL_MSG("Method Not Implemented."); + // nothing to do here, events are never generated when we change the + // control value programmatically anyhow by Cocoa } bool wxComboBox::OSXHandleClicked( double WXUNUSED(timestampsec) ) @@ -215,11 +217,6 @@ bool wxComboBox::OSXHandleClicked( double WXUNUSED(timestampsec) ) return true; } -wxTextWidgetImpl* wxComboBox::GetTextPeer() const -{ - return dynamic_cast (m_peer); -} - wxComboWidgetImpl* wxComboBox::GetComboPeer() const { return dynamic_cast (m_peer);