/*\r
* woptions.h -- Options dialog box routines for WinBoard\r
*\r
- * Copyright 2003, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.\r
+ * Copyright 2003, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free\r
+ * Software Foundation, Inc.\r
*\r
* ------------------------------------------------------------------------\r
*\r
}\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
int extra, num = ES_NUMBER;\r
\r
switch(type) {\r
-// case Slider+100:\r
-// num = 0; // needs text control for accepting negative numbers\r
+ case Spin+100:\r
+ num = 0; // needs text control for accepting negative numbers\r
case Slider:\r
case Spin:\r
AddControl(x, y+1, 95, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i);\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
\r
void PseudoOK(HWND hDlg)\r
{\r
+ if(matchMode) return;\r
okFunc = 0;\r
GetOptionValues(hDlg, activeCps, activeList);\r
EndDialog( hDlg, 0 );\r
\r
if(autoinc) appData.loadGameIndex = appData.loadPositionIndex = -(twice + 1); else\r
if(!appData.loadGameFile[0]) appData.loadGameIndex = -2*twice; // kludge to pass value of "twice" for use in GUI book\r
+ if(!autoinc && !twice) { // prevent auto-inc being remembered in index value if checkboxes not ticked\r
+ if(appData.loadGameIndex < 0) appData.loadGameIndex = 0;\r
+ if(appData.loadPositionIndex < 0) appData.loadPositionIndex = 0;\r
+ }\r
if(swiss) { appData.defaultMatchGames = 1; appData.tourneyType = -1; }\r
+ ASSIGN(appData.tourneyFile, tfName);\r
}\r
\r
char *GetParticipants(HWND hDlg)\r