Implement searching games in Game List for a position
[xboard.git] / winboard / wsettings.c
index ae0f99c..11de72b 100644 (file)
@@ -425,7 +425,7 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
 //        CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER));\r
        SetOptionValues(hDlg, activeCps, activeList);\r
 \r
-//        SetFocus(GetDlgItem(hDlg, IDC_NFG_Edit));\r
+        SetFocus(GetDlgItem(hDlg, IDCANCEL));\r
 \r
         break;\r
 \r
@@ -535,7 +535,7 @@ void AddOption(int x, int y, Control type, int i)
            break;\r
        case Label:\r
            extra = activeList[layoutList[i/2]].value;\r
-           AddControl(x+extra, y+1, 290-extra, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i);\r
+           AddControl(x+extra, y+1, 290-extra, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i);\r
            break;\r
        case FileName:\r
        case PathName:\r
@@ -555,7 +555,7 @@ void AddOption(int x, int y, Control type, int i)
        case Button:\r
        case ResetButton:\r
        case SaveButton:\r
-           AddControl(x-2, y, 65, 13, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD, i);\r
+           AddControl(x-2, y, 65, 13, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i);\r
        case Message:\r
        default:\r
            break;\r
@@ -566,7 +566,7 @@ void AddOption(int x, int y, Control type, int i)
 void\r
 CreateDialogTemplate(int *layoutList, int nr, Option *optionList)\r
 {\r
-    int i, j, x=1, y=0, buttonRows, breakPoint = -1, k=0;\r
+    int i, ii, j, x=1, y=0, buttonRows, breakPoint = -1, k=0;\r
 \r
     template.header.cdit = 0;\r
     template.header.cx = 307;\r
@@ -576,31 +576,32 @@ CreateDialogTemplate(int *layoutList, int nr, Option *optionList)
        template.header.cx = 625;\r
     }\r
 \r
-    for(i=0; i<nr; i++) {\r
-       if(k < groups && i == boxList[k]) {\r
+    for(ii=0; ii<nr; ii++) {\r
+       i = ii^1; if(i == nr) i = ii; // if two on one line, swap order of treatment, to get good (left to right) tabbing order.\r
+       if(k < groups && ii == boxList[k]) {\r
            y += 10;\r
            AddControl(x+2, y+13*(i>>1)-2, 301, 13*(boxList[k+1]-boxList[k]>>1)+8,\r
                                                0x0082, WS_VISIBLE | WS_CHILD | SS_BLACKFRAME, 2400);\r
            AddControl(x+60, y+13*(i>>1)-6, 10*groupNameList[k]/3, 10,\r
-                                               0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, 2*(i+MAX_OPTIONS));\r
+                                               0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, 2*(ii+MAX_OPTIONS));\r
        }\r
        j = layoutList[i];\r
        if(j >= 0)\r
            AddOption(x+155-150*(i&1), y+13*(i>>1)+5, optionList[j].type, 2*i);\r
-       if(k < groups && i+1 == boxList[k+1]) {\r
+       if(k < groups && ii+1 == boxList[k+1]) {\r
            k += 2; y += 4;\r
        }\r
-       if(i+1 == breakPoint) { x += 318; y = -13*(breakPoint>>1); }\r
+       if(ii+1 == breakPoint) { x += 318; y = -13*(breakPoint>>1); }\r
     }\r
     // add butons at the bottom of dialog window\r
     y += 13*(nr>>1)+5;\r
 \r
-    AddControl(x+225, y+18*(buttonRows-1), 30, 15, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD, IDOK-2000);\r
-    AddControl(x+260, y+18*(buttonRows-1), 40, 15, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD, IDCANCEL-2000);\r
     for(i=0; i<buttons; i++) {\r
-       AddControl(x+70*(i%4)+5, y+18*(i/4), 65, 15, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD, 2*(nr+i));\r
+       AddControl(x+70*(i%4)+5, y+18*(i/4), 65, 15, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 2*(nr+i));\r
        layoutList[nr+i] = buttonList[i];\r
     }\r
+    AddControl(x+225, y+18*(buttonRows-1), 30, 15, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, IDOK-2000);\r
+    AddControl(x+260, y+18*(buttonRows-1), 40, 15, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, IDCANCEL-2000);\r
     template.title[8] = optionList == first.option ? '1' :  '2';\r
     template.header.cy = y += 18*buttonRows+2;\r
     template.header.style &= ~WS_VSCROLL;\r