mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 02:24:46 +00:00
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>
This commit is contained in:
parent
bf55f167b9
commit
b1b8fb77be
|
@ -1237,7 +1237,15 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg )
|
||||||
if (!(dlgCode & DLGC_WANTARROWS))
|
if (!(dlgCode & DLGC_WANTARROWS))
|
||||||
{
|
{
|
||||||
BOOL fPrevious = (msg->wParam == VK_LEFT || msg->wParam == VK_UP);
|
BOOL fPrevious = (msg->wParam == VK_LEFT || msg->wParam == VK_UP);
|
||||||
HWND hwndNext = GetNextDlgGroupItem (hwndDlg, GetFocus(), fPrevious );
|
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 );
|
SendMessageW( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7057,11 +7057,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);
|
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
|
||||||
ok_sequence(auto_radio_button_VK_DOWN_dialog, "IsDialogMessage(VK_DOWN)", TRUE);
|
ok_sequence(auto_radio_button_VK_DOWN_dialog, "IsDialogMessage(VK_DOWN)", TRUE);
|
||||||
|
|
||||||
todo_wine
|
|
||||||
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
||||||
|
|
||||||
hwnd = GetFocus();
|
hwnd = GetFocus();
|
||||||
todo_wine
|
|
||||||
ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
|
ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
|
||||||
GetWindowRect(radio1, &rc);
|
GetWindowRect(radio1, &rc);
|
||||||
|
|
||||||
|
@ -7076,11 +7074,9 @@ todo_wine
|
||||||
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
|
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
|
||||||
ok_sequence(auto_radio_button_VK_DOWN_radio3, "down to radio3", TRUE);
|
ok_sequence(auto_radio_button_VK_DOWN_radio3, "down to radio3", TRUE);
|
||||||
|
|
||||||
todo_wine
|
|
||||||
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
||||||
|
|
||||||
hwnd = GetFocus();
|
hwnd = GetFocus();
|
||||||
todo_wine
|
|
||||||
ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
|
ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
|
||||||
|
|
||||||
flush_events();
|
flush_events();
|
||||||
|
@ -7097,11 +7093,9 @@ todo_wine
|
||||||
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
|
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
|
||||||
ok_sequence(auto_radio_button_VK_UP_radio1, "up to radio1", TRUE);
|
ok_sequence(auto_radio_button_VK_UP_radio1, "up to radio1", TRUE);
|
||||||
|
|
||||||
todo_wine
|
|
||||||
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
||||||
|
|
||||||
hwnd = GetFocus();
|
hwnd = GetFocus();
|
||||||
todo_wine
|
|
||||||
ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
|
ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
|
||||||
|
|
||||||
flush_events();
|
flush_events();
|
||||||
|
@ -7119,7 +7113,6 @@ todo_wine
|
||||||
if (0) /* actual message sequence is different on every run in some Windows setups */
|
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);
|
ok_sequence(auto_radio_button_VK_UP_dialog, "IsDialogMessage(VK_UP) #3", FALSE);
|
||||||
/* what really matters is that nothing has changed */
|
/* what really matters is that nothing has changed */
|
||||||
todo_wine
|
|
||||||
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
test_radio(radio1, 1, radio2, 0, radio3, 0);
|
||||||
|
|
||||||
log_all_parent_messages--;
|
log_all_parent_messages--;
|
||||||
|
|
Loading…
Reference in a new issue