if ( m_focus )
{
+#ifndef __WXX11__
if ( !m_focus->RemoveEventHandler(m_handlerFocus) )
{
// see above
m_handlerFocus = NULL;
}
-
+#endif
m_focus = NULL;
}
}
m_focus = winFocus ? winFocus : this;
m_focus->SetFocus();
+#ifndef __WXX11__
+
#ifdef __WXMSW__
// MSW doesn't allow to set focus to the popup window, but we need to
// subclass the window which has the focus, and not winFocus passed in or
m_focus->PushEventHandler(m_handlerFocus);
}
+
+#endif
}
void wxPopupTransientWindow::Dismiss()
{
wxWindow *win = control->GetInputWindow();
- if ( wxWindow::FindFocus() != control->GetInputWindow() )
+ if (( wxWindow::FindFocus() != control->GetInputWindow() ) &&
+ ( win->AcceptsFocus() ) )
{
win->SetFocus();
g_nextFocus = win;
win->SetFocus();
- // return TRUE;
}
}
Window xwindow = (Window) GetMainWindow();
wxCHECK_RET( xwindow, wxT("invalid window") );
-
+
+ wxCHECK_RET( AcceptsFocus(), wxT("set focus on window that doesn't accept the focus") );
+
+#if 0
+ if (GetName() == "scrollBar")
+ {
+ char *crash = NULL;
+ *crash = 0;
+ }
+#endif
+
if (wxWindowIsVisible(xwindow))
{
XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );