From: Jaakko Salli Date: Sun, 6 Jun 2010 09:35:06 +0000 (+0000) Subject: In wxComboCtrlBase::DoShowPopup(), if the popup window is a generic TLW or a 'perfect... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/52999871ced63078110ace34fc5d3abc9af0be6a In wxComboCtrlBase::DoShowPopup(), if the popup window is a generic TLW or a 'perfect' wxPopupWindow, then try to set focus to the popup control at the end of show git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index a050bd6cf2..a256b660c4 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -221,6 +221,26 @@ enum #endif +// Returns true if given popup window type can be classified as perfect +// on this platform. +static inline bool IsPopupWinTypePerfect( wxByte popupWinType ) +{ +#if POPUPWIN_IS_PERFECT && TRANSIENT_POPUPWIN_IS_PERFECT + wxUnusedVar(popupWinType); + return true; +#else + return ( popupWinType == POPUPWIN_GENERICTLW + #if POPUPWIN_IS_PERFECT + || popupWinType == POPUPWIN_WXPOPUPWINDOW + #endif + #if TRANSIENT_POPUPWIN_IS_PERFECT + || popupWinType == POPUPWIN_WXPOPUPTRANSIENTWINDOW + #endif + ); +#endif +} + + // // ** TODO ** // * wxComboPopupWindow for external use (ie. replace old wxUniv wxPopupComboWindow) @@ -2288,6 +2308,13 @@ void wxComboCtrlBase::DoShowPopup( const wxRect& rect, int WXUNUSED(flags) ) winPopup->Show(); m_popupWinState = Visible; + + // If popup window was a generic top-level window, or the + // wxPopupWindow implemenation on this platform is classified as + // perfect, then we should be able to safely set focus to the popup + // control. + if ( IsPopupWinTypePerfect(m_popupWinType) ) + m_popup->SetFocus(); } else if ( IsPopupWindowState(Hidden) ) {