X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwoptions.c;h=60b8fd130a4beb10aa346757195e743ab908b888;hb=36fca099ff6d67b7df504606ffa15e8e5e8c66bb;hp=b1f50b6ff0e8c393cee210415c8e009b00b32728;hpb=570f0d333ffba03730d5bc5a69ef5a509247104f;p=xboard.git diff --git a/winboard/woptions.c b/winboard/woptions.c index b1f50b6..60b8fd1 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -1,9 +1,10 @@ /* * woptions.c -- Options dialog box routines for WinBoard - * $Id: woptions.c,v 2.1 2003/10/27 19:21:02 mann Exp $ * * Copyright 2000,2009 Free Software Foundation, Inc. * + * Enhancements Copyright 2005 Alessandro Scotti + * * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -63,6 +64,7 @@ extern HWND hwndConsole; extern char *defaultTextAttribs[]; extern HWND commentDialog; extern HWND moveHistoryDialog; +extern HWND engineOutputDialog; extern char installDir[]; extern HWND hCommPort; /* currently open comm port */ extern DCB dcb; @@ -793,7 +795,11 @@ VariantWhichRadio(HWND hDlg) (IsDlgButtonChecked(hDlg, OPT_VariantJanus) ? VariantJanus : (IsDlgButtonChecked(hDlg, OPT_VariantWildcastle) ? VariantWildCastle : (IsDlgButtonChecked(hDlg, OPT_VariantNocastle) ? VariantNoCastle : - VariantNormal )))))))))))))))))))))))); + (IsDlgButtonChecked(hDlg, OPT_Variant3Check) ? Variant3Check : + (IsDlgButtonChecked(hDlg, OPT_VariantGreat) ? VariantGreat : + (IsDlgButtonChecked(hDlg, OPT_VariantGiveaway) ? VariantGiveaway : + (IsDlgButtonChecked(hDlg, OPT_VariantTwilight) ? VariantTwilight : + VariantNormal )))))))))))))))))))))))))))); } LRESULT CALLBACK @@ -866,6 +872,8 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CheckDlgButton(hDlg, OPT_VariantCylinder, TRUE); break; case Variant3Check: + CheckDlgButton(hDlg, OPT_Variant3Check, TRUE); + break; case VariantSuper: CheckDlgButton(hDlg, OPT_VariantSuper, TRUE); break; @@ -881,9 +889,15 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case VariantNoCastle: CheckDlgButton(hDlg, OPT_VariantNocastle, TRUE); break; -// case VariantGreat: // Note to self: must still make this button (and GiveAway too). -// CheckDlgButton(hDlg, OPT_VariantGreat, TRUE); -// break; + case VariantGreat: + CheckDlgButton(hDlg, OPT_VariantGreat, TRUE); + break; + case VariantGiveaway: + CheckDlgButton(hDlg, OPT_VariantGiveaway, TRUE); + break; + case VariantTwilight: + CheckDlgButton(hDlg, OPT_VariantTwilight, TRUE); + break; default: ; } @@ -1622,7 +1636,17 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(moveHistoryDialog, IDC_MoveHistory, WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, MAKELPARAM(TRUE, 0)); - InvalidateRect(editTagsDialog, NULL, TRUE); + SendMessage( moveHistoryDialog, WM_INITDIALOG, 0, 0 ); +// InvalidateRect(editTagsDialog, NULL, TRUE); // [HGM] this ws improperly cloned? + } + + if( engineOutputDialog != NULL ) { + SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo1, + WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, + MAKELPARAM(TRUE, 0)); + SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo2, + WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, + MAKELPARAM(TRUE, 0)); } if (hwndConsole) { @@ -1894,6 +1918,7 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SoundClass sc; ColorClass cc; SoundComboData *scd; + int oldMute; switch (message) { case WM_INITDIALOG: @@ -1974,6 +1999,8 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } } + mute = FALSE; // [HGM] mute: switch sounds automatically on if we select one + CheckMenuItem(GetMenu(hwndMain),IDM_MuteSounds,MF_BYCOMMAND|MF_UNCHECKED); ResetSoundComboData(soundComboData); EndDialog(hDlg, TRUE); return TRUE; @@ -2003,7 +2030,9 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) tmp.name = strdup(SoundDialogGetName(hDlg, radio)); tmp.data = NULL; MyLoadSound(&tmp); + oldMute = mute; mute = FALSE; // [HGM] mute: always sound when user presses play, ignorig mute setting MyPlaySound(&tmp); + mute = oldMute; if (tmp.data != NULL) FreeResource(tmp.data); // technically obsolete fn, but tmp.data is NOT malloc'd mem if (tmp.name != NULL) free(tmp.name); return TRUE;