https://git.reactos.org/?p=reactos.git;a=commitdiff;h=048c8c1605e41600a2610c46b8d5eddca4e50c86

commit 048c8c1605e41600a2610c46b8d5eddca4e50c86
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun Mar 24 17:18:06 2019 +0100
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Mar 24 17:23:33 2019 +0100

    [USER32] Add support for navigating a group of radio buttons using a 
keyboard.
    
    Import Wine commit:
    
https://source.winehq.org/git/wine.git/commit/b1b8fb77be5dd9a8754b04b2ef9f703bbe393d59
    
    "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.
    "
    by Dmitry Timoshkov.
    See bug report https://bugs.winehq.org/show_bug.cgi?id=16845
---
 win32ss/user/user32/windows/dialog.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/win32ss/user/user32/windows/dialog.c 
b/win32ss/user/user32/windows/dialog.c
index 0fc31a71fe5..4770169e99a 100644
--- a/win32ss/user/user32/windows/dialog.c
+++ b/win32ss/user/user32/windows/dialog.c
@@ -2556,8 +2556,16 @@ IsDialogMessageW(
              if (!(dlgCode & DLGC_WANTARROWS))
              {
                  BOOL fPrevious = (lpMsg->wParam == VK_LEFT || lpMsg->wParam 
== VK_UP);
-                 HWND hwndNext = GetNextDlgGroupItem (hDlg, GetFocus(), 
fPrevious );
-                 SendMessageW( hDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 );
+                 HWND hwndNext = GetNextDlgGroupItem( hDlg, lpMsg->hwnd, 
fPrevious );
+                 if (hwndNext && SendMessageW( hwndNext, WM_GETDLGCODE, 
lpMsg->wParam, (LPARAM)lpMsg ) == (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( hDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 );
                  return TRUE;
              }
              break;

Reply via email to