git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-21 14:25:20 +00:00
parent 2cd31b57b2
commit b3a7510d21
3 changed files with 60 additions and 28 deletions

View File

@@ -607,7 +607,8 @@ void wxTreeCtrl::Init()
m_dragCount = 0;
m_isDragging = FALSE;
m_dropTarget = (wxGenericTreeItem *)NULL;
m_dropTarget =
m_oldSelection = (wxGenericTreeItem *)NULL;
m_renameTimer = new wxTreeRenameTimer( this );
@@ -2143,6 +2144,22 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
// we're going to drag this item
m_isDragging = TRUE;
// remember the old cursor because we will change it while
// dragging
m_oldCursor = m_cursor;
// in a single selection control, hide the selection temporarily
if ( !(GetWindowStyleFlag() & wxTR_MULTIPLE) )
{
m_oldSelection = GetSelection().m_pItem;
if ( m_oldSelection )
{
m_oldSelection->SetHilight(FALSE);
RefreshLine(m_oldSelection);
}
}
CaptureMouse();
}
}
@@ -2178,9 +2195,16 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
m_isDragging = FALSE;
m_dropTarget = (wxGenericTreeItem *)NULL;
if ( m_oldSelection )
{
m_oldSelection->SetHilight(TRUE);
RefreshLine(m_oldSelection);
m_oldSelection = (wxGenericTreeItem *)NULL;
}
ReleaseMouse();
SetCursor(wxCURSOR_DEFAULT);
SetCursor(m_oldCursor);
wxYield();
}