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
This commit is contained in:
@@ -1300,7 +1300,17 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
|||||||
|
|
||||||
if (m_isDragging)
|
if (m_isDragging)
|
||||||
{
|
{
|
||||||
// erase the line
|
// 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();
|
DrawCurrent();
|
||||||
|
|
||||||
if (event.ButtonUp())
|
if (event.ButtonUp())
|
||||||
@@ -1308,21 +1318,17 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
|||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
m_isDragging = FALSE;
|
m_isDragging = FALSE;
|
||||||
m_dirty = TRUE;
|
m_dirty = TRUE;
|
||||||
m_owner->SetColumnWidth( m_column, m_currentX-m_minX );
|
m_owner->SetColumnWidth( m_column, m_currentX - m_minX );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int w = 0;
|
|
||||||
GetClientSize( &w, NULL );
|
|
||||||
if (x > m_minX + 7)
|
if (x > m_minX + 7)
|
||||||
m_currentX = x;
|
m_currentX = x;
|
||||||
else
|
else
|
||||||
m_currentX = m_minX + 7;
|
m_currentX = m_minX + 7;
|
||||||
|
|
||||||
if ( m_currentX > w - 7 )
|
|
||||||
m_currentX = w - 7;
|
|
||||||
|
|
||||||
// draw in the new location
|
// draw in the new location
|
||||||
|
if ( m_currentX < w )
|
||||||
DrawCurrent();
|
DrawCurrent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user