/*\r
* woptions.c -- Options dialog box routines for WinBoard\r
- * $Id: woptions.c,v 2.1 2003/10/27 19:21:02 mann Exp $\r
*\r
- * Copyright 2000 Free Software Foundation, Inc.\r
+ * Copyright 2000, 2009, 2010 Free Software Foundation, Inc.\r
+ *\r
+ * Enhancements Copyright 2005 Alessandro Scotti\r
*\r
* ------------------------------------------------------------------------\r
- * This program is free software; you can redistribute it and/or modify\r
+ *\r
+ * GNU XBoard is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
+ * the Free Software Foundation, either version 3 of the License, or (at\r
+ * your option) any later version.\r
*\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
+ * GNU XBoard is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * General Public License for more details.\r
*\r
* You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
- * ------------------------------------------------------------------------\r
- */\r
+ * along with this program. If not, see http://www.gnu.org/licenses/. *\r
+ *\r
+ *------------------------------------------------------------------------\r
+ ** See the file ChangeLog for a revision history. */\r
\r
#include "config.h"\r
\r
#include <stdio.h>\r
#include <stdlib.h>\r
#include <shlobj.h> /* [AS] Requires NT 4.0 or Win95 */\r
+#include <ctype.h>\r
\r
#include "common.h"\r
#include "winboard.h"\r
extern char *defaultTextAttribs[];\r
extern HWND commentDialog;\r
extern HWND moveHistoryDialog;\r
+extern HWND engineOutputDialog;\r
extern char installDir[];\r
extern HWND hCommPort; /* currently open comm port */\r
extern DCB dcb;\r
extern BOOLEAN chessProgram;\r
+extern int startedFromPositionFile; /* [HGM] loadPos */\r
\r
/* types */\r
\r
VOID SetLoadOptionEnables(HWND hDlg);\r
VOID SetSaveOptionEnables(HWND hDlg);\r
VOID SetTimeControlEnables(HWND hDlg);\r
+void NewSettingEvent(int option, char *command, int value);\r
\r
/*---------------------------------------------------------------------------*\\r
*\r
appData.popupMoveErrors = IS_CHECKED(OPT_PopupMoveErrors);\r
appData.showButtonBar = IS_CHECKED(OPT_ShowButtonBar);\r
appData.showCoords = IS_CHECKED(OPT_ShowCoordinates);\r
- ShowThinkingEvent( IS_CHECKED(OPT_ShowThinking));\r
- appData.testLegality = IS_CHECKED(OPT_TestLegality);\r
- appData.hideThinkingFromHuman= IS_CHECKED(OPT_HideThinkFromHuman);\r
+ // [HGM] thinking: next three moved up\r
appData.saveExtendedInfoInPGN= IS_CHECKED(OPT_SaveExtPGN);\r
+ appData.hideThinkingFromHuman= IS_CHECKED(OPT_HideThinkFromHuman);\r
appData.showEvalInMoveHistory= IS_CHECKED(OPT_ExtraInfoInMoveHistory);\r
+ appData.showThinking = IS_CHECKED(OPT_ShowThinking);\r
+ ShowThinkingEvent(); // [HGM] thinking: tests four options\r
+ appData.testLegality = IS_CHECKED(OPT_TestLegality);\r
appData.highlightMoveWithArrow=IS_CHECKED(OPT_HighlightMoveArrow);\r
\r
#undef IS_CHECKED\r
HBRUSH brushSquareOutline;\r
HBRUSH brushPiece;\r
HBRUSH brushPieceDetail;\r
- HBRUSH oldBrushPiece;\r
+ HBRUSH oldBrushPiece = NULL;\r
HBRUSH oldBrushSquare;\r
HBITMAP oldBitmapMem;\r
HBITMAP oldBitmapTemp;\r
oldBrushPiece = SelectObject(hdcMem, brushPiece);\r
BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
hdcTemp, 0, 0, 0x00B8074A);\r
-#if 0\r
- /* Use pieceDetailColor for outline of white pieces */\r
- SelectObject(hdcTemp, pieces[OUTLINE]);\r
- SelectObject(hdcMem, brushPieceDetail);\r
- BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
- hdcTemp, 0, 0, 0x00B8074A);\r
-#else\r
/* Use black for outline of white pieces */\r
SelectObject(hdcTemp, pieces[OUTLINE]);\r
BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
hdcTemp, 0, 0, SRCAND);\r
-#endif\r
} else {\r
-#if 0\r
- /* Use pieceDetailColor for details of black pieces */\r
- /* Requires filled-in solid bitmaps (BLACK_PIECE class); the\r
- WHITE_PIECE ones aren't always the right shape. */\r
- oldBitmapTemp = SelectObject(hdcTemp, pieces[BLACK]);\r
- oldBrushPiece = SelectObject(hdcMem, brushPieceDetail);\r
- BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
- hdcTemp, 0, 0, 0x00B8074A);\r
- SelectObject(hdcTemp, pieces[SOLID]);\r
- SelectObject(hdcMem, brushPiece);\r
- BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
- hdcTemp, 0, 0, 0x00B8074A);\r
-#else\r
/* Use square color for details of black pieces */\r
oldBitmapTemp = SelectObject(hdcTemp, pieces[SOLID]);\r
oldBrushPiece = SelectObject(hdcMem, brushPiece);\r
BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
hdcTemp, 0, 0, 0x00B8074A);\r
-#endif\r
}\r
SelectObject(hdcMem, oldBrushPiece);\r
SelectObject(hdcTemp, oldBitmapTemp);\r
break;\r
case SizeTitanic:\r
CheckDlgButton(hDlg, OPT_SizeTitanic, TRUE);\r
+ default: ; // should not happen, but suppresses warning on pedantic compilers\r
}\r
\r
if (appData.monoMode)\r
(IsDlgButtonChecked(hDlg, OPT_VariantSuicide) ? VariantSuicide :\r
(IsDlgButtonChecked(hDlg, OPT_VariantAtomic) ? VariantAtomic :\r
(IsDlgButtonChecked(hDlg, OPT_VariantShatranj) ? VariantShatranj :\r
- VariantNormal )))))))))))))));\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantFRC) ? VariantFischeRandom :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantCylinder) ? VariantCylinder :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantFalcon) ? VariantFalcon :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantCRC) ? VariantCapaRandom :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantSuper) ? VariantSuper :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantBerolina) ? VariantBerolina :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantJanus) ? VariantJanus :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantWildcastle) ? VariantWildCastle :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantNocastle) ? VariantNoCastle :\r
+ (IsDlgButtonChecked(hDlg, OPT_Variant3Check) ? Variant3Check :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantGreat) ? VariantGreat :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantGiveaway) ? VariantGiveaway :\r
+ (IsDlgButtonChecked(hDlg, OPT_VariantTwilight) ? VariantTwilight :\r
+ VariantNormal ))))))))))))))))))))))))))));\r
}\r
\r
LRESULT CALLBACK\r
NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
{\r
- static Boolean mono;\r
static VariantClass v;\r
- static COLORREF lsc, dsc, wpc, bpc, hsc, phc;\r
- static HBITMAP pieces[3];\r
static int n1_ok, n2_ok, n3_ok;\r
\r
switch (message) {\r
case VariantShatranj:\r
CheckDlgButton(hDlg, OPT_VariantShatranj, TRUE);\r
break;\r
+ case VariantFischeRandom:\r
+ CheckDlgButton(hDlg, OPT_VariantFRC, TRUE);\r
+ break;\r
+ case VariantCapaRandom:\r
+ CheckDlgButton(hDlg, OPT_VariantCRC, TRUE);\r
+ break;\r
+ case VariantFalcon:\r
+ CheckDlgButton(hDlg, OPT_VariantFalcon, TRUE);\r
+ break;\r
+ case VariantCylinder:\r
+ CheckDlgButton(hDlg, OPT_VariantCylinder, TRUE);\r
+ break;\r
+ case Variant3Check:\r
+ CheckDlgButton(hDlg, OPT_Variant3Check, TRUE);\r
+ break;\r
+ case VariantSuper:\r
+ CheckDlgButton(hDlg, OPT_VariantSuper, TRUE);\r
+ break;\r
+ case VariantBerolina:\r
+ CheckDlgButton(hDlg, OPT_VariantBerolina, TRUE);\r
+ break;\r
+ case VariantJanus:\r
+ CheckDlgButton(hDlg, OPT_VariantJanus, TRUE);\r
+ break;\r
+ case VariantWildCastle:\r
+ CheckDlgButton(hDlg, OPT_VariantWildcastle, TRUE);\r
+ break;\r
+ case VariantNoCastle:\r
+ CheckDlgButton(hDlg, OPT_VariantNocastle, TRUE);\r
+ break;\r
+ case VariantGreat:\r
+ CheckDlgButton(hDlg, OPT_VariantGreat, TRUE);\r
+ break;\r
+ case VariantGiveaway:\r
+ CheckDlgButton(hDlg, OPT_VariantGiveaway, TRUE);\r
+ break;\r
+ case VariantTwilight:\r
+ CheckDlgButton(hDlg, OPT_VariantTwilight, TRUE);\r
+ break;\r
+ default: ;\r
}\r
\r
SetDlgItemInt( hDlg, IDC_Files, -1, TRUE );\r
EndDialog(hDlg, TRUE);\r
\r
v = VariantWhichRadio(hDlg);\r
+ if(!appData.noChessProgram) { char *name = VariantName(v), buf[MSG_SIZ];\r
+ if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) {\r
+ /* [HGM] in protocol 2 we check if variant is suported by engine */\r
+ sprintf(buf, "Variant %s not supported by %s", name, first.tidy);\r
+ DisplayError(buf, 0);\r
+ return TRUE; /* treat as "Cancel" if first engine does not support it */\r
+ } else\r
+ if (second.initDone && second.protocolVersion > 1 && StrStr(second.variants, name) == NULL) {\r
+ sprintf(buf, "Warning: second engine (%s) does not support this!", second.tidy);\r
+ DisplayError(buf, 0); /* use of second engine is optional; only warn user */\r
+ }\r
+ }\r
\r
gameInfo.variant = v;\r
appData.variant = VariantName(v);\r
if(!n2_ok) appData.NrRanks = -1;\r
if(!n3_ok) appData.holdingsSize = -1;\r
\r
+ shuffleOpenings = FALSE; /* [HGM] shuffle: possible shuffle reset when we switch */\r
+ startedFromPositionFile = FALSE; /* [HGM] loadPos: no longer valid in new variant */\r
+ appData.pieceToCharTable = NULL;\r
Reset(TRUE, TRUE);\r
\r
return TRUE;\r
font->mfp.italic = font->lf.lfItalic;\r
font->mfp.underline = font->lf.lfUnderline;\r
font->mfp.strikeout = font->lf.lfStrikeOut;\r
+ font->mfp.charset = font->lf.lfCharSet;\r
strcpy(font->mfp.faceName, font->lf.lfFaceName);\r
return TRUE;\r
}\r
CHARFORMAT cf;\r
cf.cbSize = sizeof(CHARFORMAT);\r
cf.dwMask = \r
- CFM_COLOR|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_FACE|CFM_SIZE;\r
+ CFM_COLOR|CFM_CHARSET|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_FACE|CFM_SIZE;\r
cf.crTextColor = mca->color;\r
cf.dwEffects = mca->effects;\r
strcpy(cf.szFaceName, font[boardSize][CONSOLE_FONT]->mfp.faceName);\r
appData.colorize =\r
(Boolean)!IsDlgButtonChecked(hDlg, OPT_DontColorize);\r
\r
- if (!appData.colorize) {\r
+ ChangedConsoleFont();\r
+\r
+ if (!appData.colorize) {\r
CHARFORMAT cf;\r
COLORREF background = ParseColorName(COLOR_BKGD);\r
/*\r
rectFormat.left = center.x - (size.cx / 2) - 1;\r
rectFormat.right = center.x + (size.cx / 2) + 1;\r
\r
-#if 0\r
- fprintf(debugFP, "\nfont: %s\n"\r
- "center.x %d, centerY %d\n"\r
- "size.cx %d, size.cy %d\n"\r
- "client.top %d, bottom %d, left %d, right %d\n"\r
- "format.top %d, bottom %d, left %d, right %d\n",\r
- buf,\r
- center.x, center.y,\r
- size.cx, size.cy,\r
- rectClient.top, rectClient.bottom, rectClient.left,\r
- rectClient.right,\r
- rectFormat.top, rectFormat.bottom, rectFormat.left,\r
- rectFormat.right);\r
-#endif\r
-\r
cf.cbSize = sizeof(CHARFORMAT);\r
cf.dwMask = CFM_FACE|CFM_SIZE|CFM_CHARSET|CFM_BOLD|CFM_ITALIC;\r
cf.dwEffects = 0;\r
dest->mfp.italic = src->mfp.italic;\r
dest->mfp.underline = src->mfp.underline;\r
dest->mfp.strikeout = src->mfp.strikeout;\r
+ dest->mfp.charset = src->mfp.charset;\r
lstrcpy(dest->mfp.faceName, src->mfp.faceName);\r
CreateFontInMF(dest);\r
}\r
SendDlgItemMessage(moveHistoryDialog, IDC_MoveHistory,\r
WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
MAKELPARAM(TRUE, 0));\r
- InvalidateRect(editTagsDialog, NULL, TRUE);\r
+ SendMessage( moveHistoryDialog, WM_INITDIALOG, 0, 0 );\r
+// InvalidateRect(editTagsDialog, NULL, TRUE); // [HGM] this ws improperly cloned?\r
+ }\r
+\r
+ if( engineOutputDialog != NULL ) {\r
+ SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo1,\r
+ WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+ MAKELPARAM(TRUE, 0));\r
+ SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo2,\r
+ WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+ MAKELPARAM(TRUE, 0));\r
}\r
\r
if (hwndConsole) {\r
err = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) scd->label);\r
if (err != cnt++) {\r
sprintf(buf, "InitSoundCombo(): err '%d', cnt '%d'\n",\r
- err, cnt);\r
+ (int)err, (int)cnt);\r
MessageBox(NULL, buf, NULL, MB_OK);\r
}\r
scd++;\r
SoundClass sc;\r
ColorClass cc;\r
SoundComboData *scd;\r
+ int oldMute;\r
\r
switch (message) {\r
case WM_INITDIALOG:\r
}\r
}\r
\r
+ mute = FALSE; // [HGM] mute: switch sounds automatically on if we select one\r
+ CheckMenuItem(GetMenu(hwndMain),IDM_MuteSounds,MF_BYCOMMAND|MF_UNCHECKED);\r
ResetSoundComboData(soundComboData);\r
EndDialog(hDlg, TRUE);\r
return TRUE;\r
tmp.name = strdup(SoundDialogGetName(hDlg, radio));\r
tmp.data = NULL;\r
MyLoadSound(&tmp);\r
+ oldMute = mute; mute = FALSE; // [HGM] mute: always sound when user presses play, ignorig mute setting\r
MyPlaySound(&tmp);\r
- if (tmp.data != NULL) free(tmp.data);\r
+ mute = oldMute;\r
+ if (tmp.data != NULL) FreeResource(tmp.data); // technically obsolete fn, but tmp.data is NOT malloc'd mem\r
if (tmp.name != NULL) free(tmp.name);\r
return TRUE;\r
\r
case OPT_BrowseSound:\r
- f = OpenFileDialog(hDlg, FALSE, NULL, "wav", SOUND_FILT,\r
+ f = OpenFileDialog(hDlg, "rb", NULL, "wav", SOUND_FILT,\r
"Browse for Sound File", NULL, NULL, buf);\r
if (f != NULL) {\r
fclose(f);\r
flow = cdFlow[FLOW_NONE].label;\r
}\r
fprintf(f, "/%s=%d,%d,%s,%s,%s\n", name,\r
- dcb->BaudRate, dcb->ByteSize, parity, stopBits, flow);\r
+ (int)dcb->BaudRate, dcb->ByteSize, parity, stopBits, flow);\r
}\r
\r
\r
\r
hwndCombo = GetDlgItem(hDlg, OPT_DataRate);\r
InitCombo(hwndCombo, cdDataRate);\r
- sprintf(buf, "%u", dcb.BaudRate);\r
+ sprintf(buf, "%u", (int)dcb.BaudRate);\r
if (SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) buf) == CB_ERR) {\r
SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);\r
SendMessage(hwndCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) buf);\r
return TRUE;\r
\r
case OPT_AVBrowse:\r
- f = OpenFileDialog(hDlg, TRUE, NULL, \r
+ f = OpenFileDialog(hDlg, "a", NULL, \r
appData.oldSaveStyle ? "gam" : "pgn", \r
GAME_FILT, "Browse for Auto Save File", \r
NULL, NULL, buf);\r
TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
{\r
char buf[MSG_SIZ];\r
- int mps, increment;\r
- BOOL ok;\r
+ int mps, increment, odds1, odds2;\r
+ BOOL ok, ok2;\r
\r
switch (message) {\r
case WM_INITDIALOG: /* message: initialize dialog box */\r
SetDlgItemText(hDlg, OPT_TCTime2, appData.timeControl);\r
SetDlgItemInt(hDlg, OPT_TCInc, appData.timeIncrement, FALSE);\r
}\r
+ SetDlgItemInt(hDlg, OPT_TCOdds1, 1, FALSE);\r
+ SetDlgItemInt(hDlg, OPT_TCOdds2, 1, FALSE);\r
SetTimeControlEnables(hDlg);\r
}\r
return TRUE;\r
return FALSE;\r
}\r
}\r
+ odds1 = GetDlgItemInt(hDlg, OPT_TCOdds1, &ok, FALSE);\r
+ odds2 = GetDlgItemInt(hDlg, OPT_TCOdds2, &ok2, FALSE);\r
+ if (!ok || !ok2 || odds1 <= 0 || odds2 <= 0) {\r
+ MessageBox(hDlg, "Invalid time-odds factor",\r
+ "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+ return FALSE;\r
+ }\r
appData.timeControl = strdup(buf);\r
appData.movesPerSession = mps;\r
appData.timeIncrement = increment;\r
+ appData.firstTimeOdds = first.timeOdds = odds1;\r
+ appData.secondTimeOdds = second.timeOdds = odds2;\r
Reset(TRUE, TRUE);\r
EndDialog(hDlg, TRUE);\r
return TRUE;\r
CHECK_BOX(IDC_MaterialDraws, appData.materialDraws);\r
CHECK_BOX(IDC_TrivialDraws, appData.trivialDraws);\r
\r
+ CHECK_BOX(IDC_ScoreAbs1, appData.firstScoreIsAbsolute);\r
+ CHECK_BOX(IDC_ScoreAbs2, appData.secondScoreIsAbsolute);\r
+\r
SetDlgItemInt( hDlg, IDC_EpDrawMoveCount, appData.adjudicateDrawMoves, TRUE );\r
SendDlgItemMessage( hDlg, IDC_EpDrawMoveCount, EM_SETSEL, 0, -1 );\r
\r
/* Read changed options from the dialog box */\r
PeriodicUpdatesEvent( IS_CHECKED(IDC_EpPeriodicUpdates));\r
PonderNextMoveEvent( IS_CHECKED(IDC_EpPonder));\r
- ShowThinkingEvent( IS_CHECKED(IDC_EpShowThinking));\r
- appData.hideThinkingFromHuman= IS_CHECKED(IDC_EpHideThinkingHuman);\r
+ appData.hideThinkingFromHuman= IS_CHECKED(IDC_EpHideThinkingHuman); // [HGM] thinking: moved up\r
+ appData.showThinking = IS_CHECKED(IDC_EpShowThinking);\r
+ ShowThinkingEvent(); // [HGM] thinking: tests all options that need thinking output\r
appData.testClaims = IS_CHECKED(IDC_TestClaims);\r
appData.checkMates = IS_CHECKED(IDC_DetectMates);\r
appData.materialDraws = IS_CHECKED(IDC_MaterialDraws);\r
appData.ruleMoves = GetDlgItemInt(hDlg, IDC_RuleMoves, NULL, FALSE );\r
appData.drawRepeats = (int) GetDlgItemInt(hDlg, IDC_DrawRepeats, NULL, FALSE );\r
\r
+ first.scoreIsAbsolute = appData.firstScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs1);\r
+ second.scoreIsAbsolute = appData.secondScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs2);\r
+\r
EndDialog(hDlg, TRUE);\r
return TRUE;\r
\r
LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
{\r
char buf[MAX_PATH];\r
+ int oldCores;\r
\r
switch (message) {\r
case WM_INITDIALOG: /* message: initialize dialog box */\r
SetDlgItemInt( hDlg, IDC_SizeOfEGTB, appData.defaultCacheSizeEGTB, TRUE );\r
CheckDlgButton( hDlg, IDC_UseBook, (BOOL) appData.usePolyglotBook );\r
SetDlgItemText( hDlg, IDC_BookFile, appData.polyglotBook );\r
+ // [HGM] smp: input field for nr of cores:\r
+ SetDlgItemInt( hDlg, IDC_Cores, appData.smpCores, TRUE );\r
+ // [HGM] book: tick boxes for own book use\r
+ CheckDlgButton( hDlg, IDC_OwnBook1, (BOOL) appData.firstHasOwnBookUCI );\r
+ CheckDlgButton( hDlg, IDC_OwnBook2, (BOOL) appData.secondHasOwnBookUCI );\r
\r
SendDlgItemMessage( hDlg, IDC_PolyglotDir, EM_SETSEL, 0, -1 );\r
\r
GetDlgItemText( hDlg, IDC_BookFile, buf, sizeof(buf) );\r
appData.polyglotBook = strdup(buf);\r
appData.usePolyglotBook = (Boolean) IsDlgButtonChecked( hDlg, IDC_UseBook );\r
-\r
+ // [HGM] smp: get nr of cores:\r
+ oldCores = appData.smpCores;\r
+ appData.smpCores = GetDlgItemInt(hDlg, IDC_Cores, NULL, FALSE );\r
+ if(appData.smpCores != oldCores) NewSettingEvent(FALSE, "cores", appData.smpCores);\r
+ // [HGM] book: read tick boxes for own book use\r
+ appData.firstHasOwnBookUCI = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook1 );\r
+ appData.secondHasOwnBookUCI = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook2 );\r
+\r
+ if(gameMode == BeginningOfGame) Reset(TRUE, TRUE);\r
EndDialog(hDlg, TRUE);\r
return TRUE;\r
\r