// 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"
// 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() );
}
SetBestSize(size); // Needed because it is a wxControlWithItems
-
+ SetStringSelection(value);
+
return true;
}
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 ) ;
return noErr ;
}
+#endif