Attempted to fix splittree problem by not pushing event handler

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-12-01 12:26:27 +00:00
parent 38058a49c6
commit 13ff9344d6
9 changed files with 112 additions and 65 deletions

View File

@@ -402,29 +402,33 @@ void wxScrollHelper::SetWindow(wxWindow *win)
m_win = win;
DoSetTargetWindow(win);
DoSetTargetWindow(win, TRUE);
}
void wxScrollHelper::DoSetTargetWindow(wxWindow *target)
void wxScrollHelper::DoSetTargetWindow(wxWindow *target, bool pushEventHandler)
{
m_targetWindow = target;
// install the event handler which will intercept the events we're
// interested in
m_handler = new wxScrollHelperEvtHandler(this);
m_targetWindow->PushEventHandler(m_handler);
if (pushEventHandler)
{
m_handler = new wxScrollHelperEvtHandler(this);
m_targetWindow->PushEventHandler(m_handler);
}
}
void wxScrollHelper::SetTargetWindow( wxWindow *target )
void wxScrollHelper::SetTargetWindow( wxWindow *target, bool pushEventHandler )
{
wxCHECK_RET( target, wxT("target window must not be NULL") );
if ( target == m_targetWindow )
return;
DeleteEvtHandler();
if (pushEventHandler)
DeleteEvtHandler();
DoSetTargetWindow(target);
DoSetTargetWindow(target, pushEventHandler);
}
wxWindow *wxScrollHelper::GetTargetWindow() const