user32: edit: Improve handling of WM_KEYDOWN VK_TAB in a dialog mode.

This commit is contained in:
Sergey Khodych 2009-08-24 01:47:15 +03:00 committed by Alexandre Julliard
parent 3b6ea11481
commit d4707dbb60
2 changed files with 31 additions and 1 deletions

View File

@ -3641,7 +3641,8 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
PostMessageW(es->hwndParent, WM_CLOSE, 0, 0);
break;
case VK_TAB:
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
if ((es->style & ES_MULTILINE) && EDIT_IsInsideDialog(es))
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
break;
}
return TRUE;

View File

@ -2192,12 +2192,36 @@ static void test_dialogmode(void)
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
msg.hwnd = hwEdit;
msg.message = WM_KEYDOWN;
msg.wParam = VK_TAB;
msg.lParam = 0xf0001;
r = SendMessage(hwEdit, WM_GETDLGCODE, VK_TAB, (LPARAM)&msg);
ok(0x89 == r, "expected 0x89, got 0x%x\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
destroy_child_editcontrol(hwEdit);
hwEdit = create_child_editcontrol(ES_MULTILINE, 0);
hwParent = GetParent(hwEdit);
SetWindowLongPtr(hwParent, GWLP_WNDPROC, (LONG_PTR)dialog_mode_wnd_proc);
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
msg.hwnd = hwEdit;
msg.message = WM_KEYDOWN;
msg.wParam = VK_ESCAPE;
@ -2212,6 +2236,11 @@ static void test_dialogmode(void)
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 1);
zero_dm_messages();
destroy_child_editcontrol(hwEdit);
}