X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7d8268a1d64de58aab194e4d8ae800c755990aad..132422c4b93a0fe5d4f313350adf2c13423c07ac:/src/mac/carbon/combobox.cpp diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 2b758e3fb0..110daa1c21 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -9,10 +9,14 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "combobox.h" #endif +#include "wx/wxprec.h" + +#if wxUSE_COMBOBOX + #include "wx/combobox.h" #include "wx/button.h" #include "wx/menu.h" @@ -119,7 +123,7 @@ protected: // but this is less complicated than dealing with idle-ness, and is much better than nothing void OnKeyUp( wxKeyEvent& event ) { - if ( event.GetKeyCode() != WXK_RETURN ) + if ( event.GetKeyCode() != WXK_RETURN && event.GetKeyCode() != WXK_TAB ) { wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_cb->GetId()); event.SetString( GetValue() ); @@ -357,7 +361,8 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, } SetBestSize(size); // Needed because it is a wxControlWithItems - + SetStringSelection(value); + return true; } @@ -563,18 +568,6 @@ wxString wxComboBox::GetStringSelection() const return wxEmptyString; } -bool wxComboBox::SetStringSelection(const wxString& sel) -{ - int s = FindString (sel); - if (s > -1) - { - SetSelection (s); - return true; - } - else - return false; -} - void wxComboBox::SetString(int n, const wxString& s) { m_choice->SetString( n , s ) ; @@ -654,3 +647,4 @@ wxInt32 wxComboBox::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR return noErr ; } +#endif