From e5c6d13c4b6b683419f22274f9926cbee67d68f0 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 31 Jan 2011 23:03:05 +0100 Subject: [PATCH] Fix deselection of greyed-out variant button (WB) In Windows a disabled radiobutton refuses to deselect when you select another (enabled) button from the group. There are then 2 buttons checked, and the code to readout the buttons took the first one. Now it is changed to take the first enabled one. --- winboard/woptions.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/winboard/woptions.c b/winboard/woptions.c index 03210c4..cf5967d 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -807,7 +807,8 @@ VariantWhichRadio(HWND hDlg) int i=0, j; while((j = radioButton[i++]) != -2) { if(j == -1) continue; // no menu button - if(IsDlgButtonChecked(hDlg, j)) return (VariantClass) i-1; + if(IsDlgButtonChecked(hDlg, j) && + (appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1; } return gameInfo.variant; // If no button checked, keep old } -- 1.7.0.4