X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwoptions.c;h=9c1942bfeab739d1dd2548426f0413d976de8748;hb=62e5284278f8b168b7eabed3fbf28d39455d7d8c;hp=b997fd4b236b0210b4e01eb6f3b17efded0e39cc;hpb=ce3d0b2034053b0362762fe3b08048ff7df41cf2;p=xboard.git diff --git a/winboard/woptions.c b/winboard/woptions.c index b997fd4..9c1942b 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -1,7 +1,7 @@ /* * woptions.c -- Options dialog box routines for WinBoard * - * Copyright 2000, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. + * Copyright 2000, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -212,6 +212,9 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CHECK_BOX(OPT_SmartMove, appData.oneClick); // [HGM] one-click CHECK_BOX(OPT_AutoTags, appData.autoDisplayTags); // [HGM] CHECK_BOX(OPT_AutoComment, appData.autoDisplayComment); // [HGM] + CHECK_BOX(OPT_Headers, appData.headers); // [HGM] + CHECK_BOX(OPT_Variations, appData.variations); // [HGM] + CHECK_BOX(OPT_AutoExtend, appData.autoExtend); // [HGM] #undef CHECK_BOX @@ -263,6 +266,9 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) appData.oneClick =IS_CHECKED(OPT_SmartMove); // [HGM] one-click appData.autoDisplayTags =IS_CHECKED(OPT_AutoTags); // [HGM] appData.autoDisplayComment =IS_CHECKED(OPT_AutoComment); // [HGM] + appData.headers =IS_CHECKED(OPT_Headers); // [HGM] + appData.variations =IS_CHECKED(OPT_Variations); // [HGM] + appData.autoExtend =IS_CHECKED(OPT_AutoExtend); // [HGM] #undef IS_CHECKED @@ -434,7 +440,7 @@ PaintSampleSquare( /* * clean up */ - SelectObject(hdcMem, oldBrushPiece); + SelectObject(hdcMem, oldBrushSquare); SelectObject(hdcMem, oldPen); DeleteObject(brushPiece); DeleteObject(brushPieceDetail); @@ -843,7 +849,7 @@ int radioButton[] = { -1, -1, OPT_VariantShogi, - OPT_VariantXiangqi, + -1, // Chu OPT_VariantCourier, OPT_VariantGothic, OPT_VariantCapablanca, @@ -858,10 +864,12 @@ int radioButton[] = { OPT_VariantGreat, -1, // Twilight, OPT_VariantMakruk, - OPT_VariantASEAN, OPT_VariantSChess, OPT_VariantGrand, OPT_VariantSpartan, // Spartan + OPT_VariantXiangqi, + OPT_VariantASEAN, + OPT_VariantLion, -2 // sentinel }; @@ -869,6 +877,7 @@ VariantClass VariantWhichRadio(HWND hDlg) { int i=0, j; + *engineVariant = NULLCHAR; while((j = radioButton[i++]) != -2) { if(j == -1) continue; // no menu button if(IsDlgButtonChecked(hDlg, j) && @@ -886,12 +895,15 @@ VariantWhichRadio(HWND hDlg) void VariantShowRadio(HWND hDlg) { + char c = *engineVariant; int i=0, j; CheckDlgButton(hDlg, radioButton[gameInfo.variant], TRUE); + *engineVariant = NULLCHAR; // [HGM] kludge to prevent VariantName will always return engineVariant while((j = radioButton[i++]) != -2) { if(j == -1) continue; // no menu button EnableWindow(GetDlgItem(hDlg, j), appData.noChessProgram || strstr(first.variants, VariantName(i-1))); } + *engineVariant = c; for(i=0; i<9; i++) { // initialize engine-defined variants char *v = EngineDefinedVariant(&first, i); // get name of #i if(v) { // there is such a variant @@ -1417,6 +1429,8 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) break; + + case OPT_ChooseNormalColor: ColorizeTextPopup(hDlg, ColorNormal); UpdateSampleText(hDlg, OPT_SampleNormal, &mca[ColorNormal]); @@ -1795,6 +1809,7 @@ FontsOptionsPopup(HWND hwnd) SoundComboData soundComboData[] = { {N_("Move"), NULL}, {N_("Bell"), NULL}, + {N_("Roar"), NULL}, {N_("ICS Alarm"), NULL}, {N_("ICS Win"), NULL}, {N_("ICS Loss"), NULL}, @@ -2520,6 +2535,7 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SetDlgItemInt(hDlg, OPT_Stretch, appData.stretch, FALSE); CheckDlgButton(hDlg, OPT_Reversed, appData.ignoreColors); CheckDlgButton(hDlg, OPT_Mirror, appData.findMirror); + SetDlgItemText(hDlg, OPT_Counts, ""); switch (appData.searchMode) { case 1: CheckDlgButton(hDlg, OPT_Exact, TRUE); @@ -2564,6 +2580,10 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) appData.searchMode = LoadOptionsWhichRadio(hDlg); appData.ignoreColors = IsDlgButtonChecked(hDlg, OPT_Reversed); appData.findMirror = IsDlgButtonChecked(hDlg, OPT_Mirror); + GetDlgItemText(hDlg, OPT_Counts, buf, MSG_SIZ); + appData.minPieces = appData.maxPieces = 0; + sscanf(buf, "%d-%d", &appData.minPieces, &appData.maxPieces); + if(appData.maxPieces < appData.minPieces) appData.maxPieces = appData.minPieces; EndDialog(hDlg, TRUE); return TRUE; @@ -3062,6 +3082,8 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM SetDlgItemInt( hDlg, IDC_Games, appData.defaultMatchGames, TRUE ); SendDlgItemMessage( hDlg, IDC_PolyglotDir, EM_SETSEL, 0, -1 ); + // [HGM] Yet another ponder duplicate + CheckDlgButton( hDlg, OPT_PonderNextMove, (BOOL) appData.ponderNextMove ); return TRUE; @@ -3081,10 +3103,11 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM GetDlgItemText( hDlg, IDC_BookFile, buf, sizeof(buf) ); appData.polyglotBook = strdup(buf); appData.usePolyglotBook = (Boolean) IsDlgButtonChecked( hDlg, IDC_UseBook ); - // [HGM] smp: get nr of cores: + // [HGM] smp: get nr of cores and ponder: oldCores = appData.smpCores; appData.smpCores = GetDlgItemInt(hDlg, IDC_Cores, NULL, FALSE ); if(appData.smpCores != oldCores) NewSettingEvent(FALSE, &(first.maxCores), "cores", appData.smpCores); + PonderNextMoveEvent((Boolean) IsDlgButtonChecked( hDlg, OPT_PonderNextMove )); // [HGM] book: read tick boxes for own book use appData.firstHasOwnBookUCI = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook1 ); appData.secondHasOwnBookUCI = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook2 ); @@ -3119,6 +3142,7 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM ofn.hwndOwner = hDlg; ofn.hInstance = hInst; ofn.lpstrFilter = filter; + ofn.lpstrFile = buf; ofn.nMaxFile = sizeof(buf); ofn.lpstrTitle = _("Choose Book");