cancel dragging if Esc is pressed (patch 1733657)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-06-09 10:50:40 +00:00
parent 1fc10687bf
commit c4cd8712cd

View File

@@ -2335,6 +2335,24 @@ wxTreeCtrl::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
if ( wParam == VK_SPACE || wParam == VK_RETURN )
return 0;
}
#if wxUSE_DRAGIMAGE
else if ( nMsg == WM_KEYDOWN )
{
if ( wParam == VK_ESCAPE )
{
if ( m_dragImage )
{
m_dragImage->EndDrag();
delete m_dragImage;
m_dragImage = NULL;
// if we don't do it, the tree seems to think that 2 items
// are selected simultaneously which is quite weird
TreeView_SelectDropTarget(GetHwnd(), 0);
}
}
}
#endif // wxUSE_DRAGIMAGE
return wxControl::MSWDefWindowProc(nMsg, wParam, lParam);
}