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
This commit is contained in:
Jaakko Salli
2010-06-06 09:35:06 +00:00
parent e9cc157957
commit 52999871ce

View File

@@ -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) )
{