}\r
\r
char *defaultExt[] = { NULL, "pgn", "fen", "exe", "trn", "bin", "log", "ini" };\r
+HWND settingsDlg;\r
\r
LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
{\r
\r
// CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER));\r
SetOptionValues(hDlg, activeCps, activeList);\r
-\r
+ settingsDlg = hDlg;\r
SetFocus(GetDlgItem(hDlg, IDCANCEL));\r
\r
break;\r
case IDOK:\r
if(!GetOptionValues(hDlg, activeCps, activeList)) return FALSE;\r
EndDialog( hDlg, 0 );\r
- comboCallback = NULL; activeCps = NULL;\r
+ comboCallback = NULL; activeCps = NULL; settingsDlg = NULL;\r
return TRUE;\r
\r
case IDCANCEL:\r
EndDialog( hDlg, 1 );\r
- comboCallback = NULL; activeCps = NULL;\r
+ comboCallback = NULL; activeCps = NULL; settingsDlg = NULL;\r
return TRUE;\r
\r
default:\r
return;\r
}\r
\r
+void\r
+RefreshSettingsDialog (ChessProgramState *cps, int val)\r
+{\r
+ int isUp = (settingsDlg != NULL);\r
+ if(val == 1) {\r
+ if(activeCps == cps && isUp) SetOptionValues(settingsDlg, cps, activeList);\r
+ return;\r
+ }\r
+ if(settingsDlg) EndDialog(settingsDlg, 1);\r
+ comboCallback = NULL; activeCps = NULL; settingsDlg = NULL;\r
+ if(val == 3 || isUp) EngineOptionsPopup(hwndMain, cps);\r
+}\r
+\r
int EnterGroup P((HWND hDlg));\r
\r
static int engineNr, selected;\r