From dc76287dcd3e940a68d00b9c425e6b1fe56431d5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 23 Sep 2003 23:48:17 +0000 Subject: [PATCH] Allow derived classes to prevent default focus handling (by not calling Skip) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index dc42f4b08a..19808a23fd 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -3328,6 +3328,14 @@ void wxListMainWindow::SetFocus() void wxListMainWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) ) { + if ( GetParent() ) + { + wxFocusEvent event( wxEVT_SET_FOCUS, GetParent()->GetId() ); + event.SetEventObject( GetParent() ); + if ( GetParent()->GetEventHandler()->ProcessEvent( event) ) + return; + } + // wxGTK sends us EVT_SET_FOCUS events even if we had never got // EVT_KILL_FOCUS before which means that we finish by redrawing the items // which are already drawn correctly resulting in horrible flicker - avoid @@ -3338,19 +3346,18 @@ void wxListMainWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) ) RefreshSelected(); } - - if ( !GetParent() ) - return; - - wxFocusEvent event( wxEVT_SET_FOCUS, GetParent()->GetId() ); - event.SetEventObject( GetParent() ); - GetParent()->GetEventHandler()->ProcessEvent( event ); } void wxListMainWindow::OnKillFocus( wxFocusEvent &WXUNUSED(event) ) { + if ( GetParent() ) + { + wxFocusEvent event( wxEVT_KILL_FOCUS, GetParent()->GetId() ); + event.SetEventObject( GetParent() ); + if ( GetParent()->GetEventHandler()->ProcessEvent( event) ) + return; + } m_hasFocus = FALSE; - RefreshSelected(); } -- 2.45.2