From b64aa2460ed5118dfdb03a2bd9fb6052046b64a8 Mon Sep 17 00:00:00 2001
From: Susan Farley <sfarley@codeweavers.com>
Date: Fri, 12 May 2000 21:51:09 +0000
Subject: [PATCH] Like the AUTORADIOBUTTON, the parent of a RADIOBUTTON style
 button should be sent a BN_CLICKED when it receives the focus.

---
 controls/button.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/controls/button.c b/controls/button.c
index de52ff86394..747b73238f2 100644
--- a/controls/button.c
+++ b/controls/button.c
@@ -236,12 +236,13 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
         return infoPtr->hFont;
 
     case WM_SETFOCUS:
-        if ((style == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) &&
+        if ((style == BS_RADIOBUTTON || style == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) &&
             !(SendMessageA(hWnd, BM_GETCHECK, 0, 0) & BST_CHECKED))
 	{
             /* The notification is sent when the button (BS_AUTORADIOBUTTON) 
                is unckecked and the focus was not given by a mouse click. */
-            SendMessageA( hWnd, BM_SETCHECK, TRUE, 0 );
+	    if (style == BS_AUTORADIOBUTTON)
+		    SendMessageA( hWnd, BM_SETCHECK, BUTTON_CHECKED, 0 );
             SendMessageA( GetParent(hWnd), WM_COMMAND,
                           MAKEWPARAM( wndPtr->wIDmenu, BN_CLICKED ), hWnd);
         }
-- 
GitLab