// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "combobox.h"
#endif
+#include "wx/wxprec.h"
+
#include "wx/combobox.h"
#include "wx/button.h"
#include "wx/menu.h"
protected:
void OnChar( wxKeyEvent& event )
{
- // Allows processing the tab key to go to the next control
- if (event.GetKeyCode() == WXK_TAB)
- {
- wxNavigationKeyEvent NavEvent;
- NavEvent.SetEventObject(this);
- NavEvent.SetDirection(true);
- NavEvent.SetWindowChange(false);
-
- // Get the parent of the combo and have it process the navigation?
- if (m_cb->GetParent()->GetEventHandler()->ProcessEvent(NavEvent))
+ // Allows processing the tab key to go to the next control
+ if (event.GetKeyCode() == WXK_TAB)
+ {
+ wxNavigationKeyEvent NavEvent;
+ NavEvent.SetEventObject(this);
+ NavEvent.SetDirection(true);
+ NavEvent.SetWindowChange(false);
+
+ // Get the parent of the combo and have it process the navigation?
+ if (m_cb->GetParent()->GetEventHandler()->ProcessEvent(NavEvent))
return;
- }
+ }
if ( event.GetKeyCode() == WXK_RETURN )
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_cb->GetId());
// 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() );
bool wxComboBox::Enable(bool enable)
{
if ( !wxControl::Enable(enable) )
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
bool wxComboBox::Show(bool show)
{
if ( !wxControl::Show(show) )
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
void wxComboBox::SetFocus()
if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style ,
wxDefaultValidator, name) )
{
- return FALSE;
+ return false;
}
m_choice = new wxComboBoxChoice(this, style );
SetBestSize(size); // Needed because it is a wxControlWithItems
- return TRUE;
+ return true;
}
wxString wxComboBox::GetValue() const
return 0;
}
-long wxComboBox::GetLastPosition() const
+wxTextPos wxComboBox::GetLastPosition() const
{
// TODO
return 0;
if (s > -1)
{
SetSelection (s);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
void wxComboBox::SetString(int n, const wxString& s)
bool wxComboBox::IsEditable() const
{
- return m_text != NULL && !HasFlag(wxCB_READONLY);
+ return m_text != NULL && !HasFlag(wxCB_READONLY);
}
void wxComboBox::Undo()