don't check whether the window is shown and enabled in AcceptsFocus() itself

as it makes overriding it in derived classes problematic; provide a separate
non virtual CanAcceptFocus() method checking whether the window accepts focus
and if it can accept it now and use it instead of AcceptsFocus(); documented
AcceptsFocus() and AcceptsFocusFromKeyboard()


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-25 22:36:24 +00:00
parent 4542739ccb
commit ad02525dad
14 changed files with 52 additions and 17 deletions

View File

@@ -3196,10 +3196,9 @@ bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
// clicking on the control gives it focus
if ( event.ButtonDown() )
{
wxWindow *win = control->GetInputWindow();
wxWindow * const win = control->GetInputWindow();
if ( (wxWindow::FindFocus() != control->GetInputWindow()) &&
win->AcceptsFocus() )
if ( win->CanAcceptFocus() && wxWindow::FindFocus() != win )
{
win->SetFocus();