Increas number of engine-defined variants to 15 (WB)
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 11 Jan 2016 23:01:31 +0000 (00:01 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 11 Jan 2016 23:01:31 +0000 (00:01 +0100)
The number of engine-defined variants that can be selected in WinBoard's
New Variant dialog is increased from 9 to 15 by adding some radio buttons.

winboard/winboard.rc
winboard/woptions.c

index 62ed079..2ea86ee 100644 (file)
@@ -696,7 +696,7 @@ BEGIN
     PUSHBUTTON      "Cancel",IDCANCEL,140,244,50,14\r
 END\r
 \r
-DLG_NewVariant DIALOG DISCARDABLE  0, 0, 224, 250\r
+DLG_NewVariant DIALOG DISCARDABLE  0, 0, 224, 270\r
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
 CAPTION "Variants"\r
 FONT 8, "MS Sans Serif"\r
@@ -774,21 +774,26 @@ BEGIN
     CONTROL         "",OPT_EngineVariant+4,"Button",BS_AUTORADIOBUTTON,80,144,70,10\r
     CONTROL         "",OPT_EngineVariant+5,"Button",BS_AUTORADIOBUTTON,154,144,70,10\r
     CONTROL         "",OPT_EngineVariant+6,"Button",BS_AUTORADIOBUTTON,9,154,70,10\r
-\r
     CONTROL         "",OPT_EngineVariant+7,"Button",BS_AUTORADIOBUTTON,80,154,70,10\r
     CONTROL         "",OPT_EngineVariant+8,"Button",BS_AUTORADIOBUTTON,154,154,70,10\r
-    GROUPBOX        "Variant",GPB_Variant,4,4,215,165\r
-    LTEXT           "Board size:",GPB_Board,10,183,40,8,WS_TABSTOP\r
-    LTEXT           "ranks",IDC_Height,77,183,38,8\r
-    EDITTEXT        IDC_Ranks,60,179,14,14,ES_AUTOHSCROLL\r
-    LTEXT           "files",IDC_Width,133,183,80,8\r
-    EDITTEXT        IDC_Files,116,179,14,14,ES_AUTOHSCROLL\r
-    LTEXT           "Holdings with room for:",IDC_Hand,10,201,90,8\r
-    EDITTEXT        IDC_Holdings,93,197,14,14,ES_AUTOHSCROLL\r
-    LTEXT           "pieces",IDC_Pieces,110,201,100,8\r
-    LTEXT           "('-1' means defaults for selected variant)",IDC_Def,10,217,210,8\r
-    DEFPUSHBUTTON   "OK",IDOK,114,232,50,14\r
-    PUSHBUTTON      "Cancel",IDCANCEL,170,232,50,14\r
+    CONTROL         "",OPT_EngineVariant+9,"Button",BS_AUTORADIOBUTTON,9,164,70,10\r
+    CONTROL         "",OPT_EngineVariant+10,"Button",BS_AUTORADIOBUTTON,80,164,70,10\r
+    CONTROL         "",OPT_EngineVariant+11,"Button",BS_AUTORADIOBUTTON,154,164,70,10\r
+    CONTROL         "",OPT_EngineVariant+12,"Button",BS_AUTORADIOBUTTON,9,174,70,10\r
+    CONTROL         "",OPT_EngineVariant+13,"Button",BS_AUTORADIOBUTTON,80,174,70,10\r
+    CONTROL         "",OPT_EngineVariant+14,"Button",BS_AUTORADIOBUTTON,154,174,70,10\r
+    GROUPBOX        "Variant",GPB_Variant,4,4,215,185\r
+    LTEXT           "Board size:",GPB_Board,10,203,40,8,WS_TABSTOP\r
+    LTEXT           "ranks",IDC_Height,77,203,38,8\r
+    EDITTEXT        IDC_Ranks,60,199,14,14,ES_AUTOHSCROLL\r
+    LTEXT           "files",IDC_Width,133,203,80,8\r
+    EDITTEXT        IDC_Files,116,199,14,14,ES_AUTOHSCROLL\r
+    LTEXT           "Holdings with room for:",IDC_Hand,10,221,90,8\r
+    EDITTEXT        IDC_Holdings,93,217,14,14,ES_AUTOHSCROLL\r
+    LTEXT           "pieces",IDC_Pieces,110,221,100,8\r
+    LTEXT           "('-1' means defaults for selected variant)",IDC_Def,10,237,210,8\r
+    DEFPUSHBUTTON   "OK",IDOK,114,252,50,14\r
+    PUSHBUTTON      "Cancel",IDCANCEL,170,252,50,14\r
 END\r
 \r
 DLG_Fonts DIALOG DISCARDABLE  0, 0, 266, 274\r
index a149b41..89f30f7 100644 (file)
@@ -883,7 +883,7 @@ VariantWhichRadio(HWND hDlg)
        if(IsDlgButtonChecked(hDlg, j) &&\r
           (appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1;\r
   }\r
-  for(i=0; i<9; i++) { // check for engine-defined variants\r
+  for(i=0; i<15; i++) { // check for engine-defined variants\r
     if(IsDlgButtonChecked(hDlg, OPT_EngineVariant+i) ) {\r
        GetDlgItemText(hDlg, OPT_EngineVariant+i, engineVariant, MSG_SIZ); // remember name, so we can resolve it later\r
        return VariantUnknown;\r
@@ -904,7 +904,7 @@ VariantShowRadio(HWND hDlg)
        EnableWindow(GetDlgItem(hDlg, j), appData.noChessProgram || strstr(first.variants, VariantName(i-1)));\r
   }\r
   *engineVariant = c;\r
-  for(i=0; i<9; i++) { // initialize engine-defined variants\r
+  for(i=0; i<15; i++) { // initialize engine-defined variants\r
     char *v = EngineDefinedVariant(&first, i); // get name of #i\r
     if(v) { // there is such a variant\r
        EnableWindow(GetDlgItem(hDlg, OPT_EngineVariant+i), TRUE);     // and enable the button\r