X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f54075053e041086bb71f107c3d70faedf0d9b9..a7d354c6d75a32033f62b8ecadd837519b35b3ef:/src/common/combocmn.cpp?ds=sidebyside diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 10f41f8473..898cbfd08c 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -904,6 +904,7 @@ wxComboCtrlBase::CreateTextCtrl(int style, const wxValidator& validator) m_text->Create(this, wxID_ANY, m_valueString, wxDefaultPosition, wxSize(10,-1), style, validator); + m_text->SetHint(m_hintText); } } @@ -1774,9 +1775,13 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event) } else // no popup { - if ( GetParent()->HasFlag(wxTAB_TRAVERSAL) && - HandleAsNavigationKey(event) ) - return; + wxWindow* mainCtrl = GetMainWindowOfCompositeControl(); + + if ( mainCtrl->GetParent()->HasFlag(wxTAB_TRAVERSAL) ) + { + if ( mainCtrl->HandleAsNavigationKey(event) ) + return; + } if ( IsKeyPopupToggle(event) ) { @@ -2021,7 +2026,8 @@ void wxComboCtrlBase::ShowPopup() // that if transient popup is open, then tab traversal is to be ignored. // However, I think this code would still be needed for cases where // transient popup doesn't work yet (wxWinCE?). - wxWindow* parent = GetParent(); + wxWindow* mainCtrl = GetMainWindowOfCompositeControl(); + wxWindow* parent = mainCtrl->GetParent(); int parentFlags = parent->GetWindowStyle(); if ( parentFlags & wxTAB_TRAVERSAL ) { @@ -2539,4 +2545,19 @@ void wxComboCtrlBase::Undo() m_text->Undo(); } +bool wxComboCtrlBase::SetHint(const wxString& hint) +{ + m_hintText = hint; + bool res = true; + if ( m_text ) + res = m_text->SetHint(hint); + Refresh(); + return res; +} + +wxString wxComboCtrlBase::GetHint() const +{ + return m_hintText; +} + #endif // wxUSE_COMBOCTRL