cancel dragging if Esc is pressed (patch 1733657) [backport from HEAD]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-06-09 10:54:00 +00:00
parent d6518e3ef7
commit 112ef6914c

View File

@@ -2396,6 +2396,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);
}