From c1e56e2c29e7504eb3864b367c194a1e94ef4631 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 19 Jun 2000 10:21:17 +0000 Subject: [PATCH] allow dragging the divider line outside the window git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index f1d8176443..c530cc1830 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1300,30 +1300,36 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event ) if (m_isDragging) { - // erase the line - DrawCurrent(); + // we don't draw the line beyond our window, but we allow dragging it + // there + int w = 0; + GetClientSize( &w, NULL ); +#if wxUSE_GENERIC_LIST_EXTENSIONS + m_owner->CalcUnscrolledPosition(w, 0, &w, NULL); +#endif // wxUSE_GENERIC_LIST_EXTENSIONS + w -= 6; + + // erase the line if it was drawn + if ( m_currentX < w ) + DrawCurrent(); if (event.ButtonUp()) { ReleaseMouse(); m_isDragging = FALSE; m_dirty = TRUE; - m_owner->SetColumnWidth( m_column, m_currentX-m_minX ); + m_owner->SetColumnWidth( m_column, m_currentX - m_minX ); } else { - int w = 0; - GetClientSize( &w, NULL ); if (x > m_minX + 7) m_currentX = x; else m_currentX = m_minX + 7; - if ( m_currentX > w - 7 ) - m_currentX = w - 7; - // draw in the new location - DrawCurrent(); + if ( m_currentX < w ) + DrawCurrent(); } } else // not dragging