X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwoptions.c;h=977c0c685b25592e55aaaa09651ff8f889683e57;hb=b0968ab4c53d5f5adacbb9393b1aaf3c96979c5b;hp=a736306e9c57dae736a4c2d98d72cb1631b0476b;hpb=44545b87e12b58945eddcbc76c1827bead814aae;p=xboard.git diff --git a/winboard/woptions.c b/winboard/woptions.c index a736306..977c0c6 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,6 +849,7 @@ int radioButton[] = { -1, -1, OPT_VariantShogi, + -1, // Chu OPT_VariantXiangqi, OPT_VariantCourier, OPT_VariantGothic, @@ -862,6 +869,7 @@ int radioButton[] = { OPT_VariantSChess, OPT_VariantGrand, OPT_VariantSpartan, // Spartan + OPT_VariantLion, -2 // sentinel }; @@ -869,12 +877,12 @@ 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) && (appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1; } - *engineVariant = NULLCHAR; for(i=0; i<9; i++) { // check for engine-defined variants if(IsDlgButtonChecked(hDlg, OPT_EngineVariant+i) ) { GetDlgItemText(hDlg, OPT_EngineVariant+i, engineVariant, MSG_SIZ); // remember name, so we can resolve it later @@ -887,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 @@ -1418,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]); @@ -1796,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}, @@ -3063,6 +3077,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; @@ -3082,10 +3098,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 ); @@ -3120,6 +3137,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");