Allow the user to cancel label editing with esc and confirm with return.

This commit is contained in:
Aric Stewart 2000-05-10 21:53:19 +00:00 committed by Alexandre Julliard
parent f9e280aab3
commit ebf34ae4ba
1 changed files with 12 additions and 0 deletions

View File

@ -2144,6 +2144,18 @@ TREEVIEW_Edit_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam,
return DLGC_WANTARROWS | DLGC_WANTALLKEYS; return DLGC_WANTARROWS | DLGC_WANTALLKEYS;
} }
case WM_KEYDOWN:
if (wParam == VK_ESCAPE)
{
TREEVIEW_EndEditLabelNow(GetParent(hwnd), (WPARAM)TRUE, 0);
return 1;
}
else if (wParam == VK_RETURN)
TREEVIEW_EndEditLabelNow(GetParent(hwnd), (WPARAM)FALSE, 0);
break;
default: default:
{ {
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd)); TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(GetParent(hwnd));