X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/150e31d2088687cbfbab548f9e98918f8683d9b5..71cc158eaabaeac51b6219a9df8eac06b96c794b:/src/mac/carbon/combobox.cpp diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 070285404f..7e6da680cf 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -9,10 +9,12 @@ // 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" @@ -68,18 +70,18 @@ public: 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()); @@ -119,7 +121,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() ); @@ -269,17 +271,17 @@ void wxComboBox::DoMoveWindow(int x, int y, int width, int height) 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() @@ -330,7 +332,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style , wxDefaultValidator, name) ) { - return FALSE; + return false; } m_choice = new wxComboBoxChoice(this, style ); @@ -358,7 +360,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, SetBestSize(size); // Needed because it is a wxControlWithItems - return TRUE; + return true; } wxString wxComboBox::GetValue() const @@ -452,7 +454,7 @@ long wxComboBox::GetInsertionPoint() const return 0; } -long wxComboBox::GetLastPosition() const +wxTextPos wxComboBox::GetLastPosition() const { // TODO return 0; @@ -569,10 +571,10 @@ bool wxComboBox::SetStringSelection(const wxString& sel) if (s > -1) { SetSelection (s); - return TRUE; + return true; } else - return FALSE; + return false; } void wxComboBox::SetString(int n, const wxString& s) @@ -582,7 +584,7 @@ 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()