Module: wine Branch: oldstable Commit: d771676872f23a0f26cdd0d27d3de2a52a3467e4 URL: https://source.winehq.org/git/wine.git/?a=commit;h=d771676872f23a0f26cdd0d27...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Tue Nov 27 09:11:17 2018 +0300
user32: Add support for navigating a group of radio buttons using a keyboard.
The patch approximates the behaviour observed in the message tests but still doesn't make the message tests pass without failures.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit b1b8fb77be5dd9a8754b04b2ef9f703bbe393d59) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/user32/dialog.c | 12 ++++++++++-- dlls/user32/tests/msg.c | 7 ------- 2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index ff1cc95..f6d4a86 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -1239,8 +1239,16 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg ) if (!(dlgCode & DLGC_WANTARROWS)) { BOOL fPrevious = (msg->wParam == VK_LEFT || msg->wParam == VK_UP); - HWND hwndNext = GetNextDlgGroupItem (hwndDlg, GetFocus(), fPrevious ); - SendMessageW( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 ); + HWND hwndNext = GetNextDlgGroupItem( hwndDlg, msg->hwnd, fPrevious ); + if (hwndNext && SendMessageW( hwndNext, WM_GETDLGCODE, msg->wParam, (LPARAM)msg ) == (DLGC_BUTTON | DLGC_RADIOBUTTON)) + { + SetFocus( hwndNext ); + if ((GetWindowLongW( hwndNext, GWL_STYLE ) & BS_TYPEMASK) == BS_AUTORADIOBUTTON && + SendMessageW( hwndNext, BM_GETCHECK, 0, 0 ) != BST_CHECKED) + SendMessageW( hwndNext, BM_CLICK, 1, 0 ); + } + else + SendMessageW( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 ); return TRUE; } break; diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 1dfc3d5..c28085c 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -6987,11 +6987,9 @@ if (0) /* actual message sequence is different on every run in some Windows setu while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(auto_radio_button_VK_DOWN_dialog, "IsDialogMessage(VK_DOWN)", TRUE);
-todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0);
hwnd = GetFocus(); -todo_wine ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd); GetWindowRect(radio1, &rc);
@@ -7006,11 +7004,9 @@ todo_wine while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(auto_radio_button_VK_DOWN_radio3, "down to radio3", TRUE);
-todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0);
hwnd = GetFocus(); -todo_wine ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
flush_events(); @@ -7027,11 +7023,9 @@ todo_wine while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(auto_radio_button_VK_UP_radio1, "up to radio1", TRUE);
-todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0);
hwnd = GetFocus(); -todo_wine ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
flush_events(); @@ -7049,7 +7043,6 @@ todo_wine if (0) /* actual message sequence is different on every run in some Windows setups */ ok_sequence(auto_radio_button_VK_UP_dialog, "IsDialogMessage(VK_UP) #3", FALSE); /* what really matters is that nothing has changed */ -todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0);
log_all_parent_messages--;