Don't call SetFocus() for popups not using wxPU_CONTAINS_CONTROLS
Under MSW only popup windows with wxPU_CONTAINS_CONTROLS can have focus, attempting to set it to a [child of a] popup without it will just result in a debug error message from wxWindow::SetFocus() and nothing else, so just avoid doing it entirely.
This commit is contained in:
@@ -180,10 +180,10 @@ void wxPopupTransientWindow::Popup(wxWindow* focus)
|
|||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
// We can only set focus to one of our children as setting it to another
|
// We can only set focus when using wxPU_CONTAINS_CONTROLS and then only to
|
||||||
// window would result in an immediate loss of activation and popup
|
// one of our children as setting it to another window would result in an
|
||||||
// disappearance.
|
// immediate loss of activation and popup disappearance.
|
||||||
if ( focus && IsDescendant(focus) )
|
if ( HasFlag(wxPU_CONTAINS_CONTROLS) && focus && IsDescendant(focus) )
|
||||||
focus->SetFocus();
|
focus->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user