Implement searching games in Game List for a position
[xboard.git] / winboard / woptions.c
index a48b924..94da5b8 100644 (file)
@@ -2391,6 +2391,15 @@ CommPortOptionsPopup(HWND hwnd)
  *\r
 \*---------------------------------------------------------------------------*/\r
 \r
+int\r
+LoadOptionsWhichRadio(HWND hDlg)\r
+{\r
+  return (IsDlgButtonChecked(hDlg, OPT_Exact) ? 1 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Subset) ? 2 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Struct) ? 3 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Material) ? 4 : -1))));\r
+}\r
+\r
 VOID\r
 SetLoadOptionEnables(HWND hDlg)\r
 {\r
@@ -2406,6 +2415,7 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 {\r
   char buf[MSG_SIZ];\r
   float fnumber;\r
+  int ok;\r
 \r
   switch (message) {\r
   case WM_INITDIALOG: /* message: initialize dialog box */\r
@@ -2421,6 +2431,23 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       CheckDlgButton(hDlg, OPT_Autostep, FALSE);\r
     }\r
     SetLoadOptionEnables(hDlg);\r
+    SetDlgItemInt(hDlg, OPT_elo1, appData.eloThreshold1, FALSE);\r
+    SetDlgItemInt(hDlg, OPT_elo2, appData.eloThreshold2, FALSE);\r
+    SetDlgItemInt(hDlg, OPT_date, appData.dateThreshold, FALSE);\r
+    switch (appData.searchMode) {\r
+    case 1:\r
+      CheckDlgButton(hDlg, OPT_Exact, TRUE);\r
+      break;\r
+    case 2:\r
+      CheckDlgButton(hDlg, OPT_Subset, TRUE);\r
+      break;\r
+    case 3:\r
+      CheckDlgButton(hDlg, OPT_Struct, TRUE);\r
+      break;\r
+    case 4:\r
+      CheckDlgButton(hDlg, OPT_Material, TRUE);\r
+      break;\r
+    }\r
     return TRUE;\r
 \r
   case WM_COMMAND: /* message: received a command */\r
@@ -2438,6 +2465,10 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       } else {\r
        appData.timeDelay = (float) -1.0;\r
       }\r
+      appData.eloThreshold1 = GetDlgItemInt(hDlg, OPT_elo1, &ok, FALSE);\r
+      appData.eloThreshold2 = GetDlgItemInt(hDlg, OPT_elo2, &ok, FALSE);\r
+      appData.dateThreshold = GetDlgItemInt(hDlg, OPT_date, &ok, FALSE);\r
+      appData.searchMode = LoadOptionsWhichRadio(hDlg);\r
       EndDialog(hDlg, TRUE);\r
       return TRUE;\r
 \r