X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68d9be05da24cc556a124ee8b0dae93ead726243..9cf58b6979fdccf6fb9e32858d0b0cd357e75b72:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 8b3b1a2f57..fac8ddbaee 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -934,7 +934,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) { if ( item == m_idEdited ) { - ::SetWindowText(hwndEdit, text); + ::SetWindowText(hwndEdit, text.wx_str()); } } } @@ -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); }