From 5039f141323787ede61b143b439f0267380bef15 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 23 Feb 2010 13:46:25 +0100 Subject: [PATCH] Add option Display Logo in WB general-options menu Changing the option requires InitDrawingSizes to be called for re-formatting the board window. Switching it off requires clearing of the cps->programLogo fields to take effect immediately. Switching it on only takes effect the next session, as we will need some refactoring to redo the figuring out what logos to display. --- winboard/resource.h | 1 + winboard/winboard.rc | 8 +++++--- winboard/woptions.c | 9 ++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/winboard/resource.h b/winboard/resource.h index fdad534..940e367 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -429,6 +429,7 @@ #define OPT_OutOfBookInfo 1436 #define OPT_ExtraInfoInMoveHistory 1437 #define OPT_HighlightMoveArrow 1438 +#define OPT_AutoLogo 1439 #define IDC_BUTTON1 1440 #define IDC_BrowseForPolyglotDir 1440 #define IDC_BrowseForEGTB 1441 diff --git a/winboard/winboard.rc b/winboard/winboard.rc index a94ca09..0bffd9b 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -420,13 +420,13 @@ BEGIN PUSHBUTTON "&Play",OPT_PlaySound,188,47,50,14 END -DLG_GeneralOptions DIALOG DISCARDABLE 0, 0, 250, 183 +DLG_GeneralOptions DIALOG DISCARDABLE 0, 0, 250, 197 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "General Options" FONT 8, "MS Sans Serif" BEGIN - DEFPUSHBUTTON "OK",IDOK,110,164,50,14 - PUSHBUTTON "Cancel",IDCANCEL,166,164,50,14 + DEFPUSHBUTTON "OK",IDOK,110,178,50,14 + PUSHBUTTON "Cancel",IDCANCEL,166,178,50,14 CONTROL "Always on &Top",OPT_AlwaysOnTop,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,4,6,126,10 CONTROL "Highlight Last &Move",OPT_HighlightLastMove,"Button", @@ -471,6 +471,8 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,146,126,10 CONTROL "Highlight with Arro&w",OPT_HighlightMoveArrow, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,131,145,126,10 + CONTROL "Displa&y Logos",OPT_AutoLogo, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,160,126,10 END DLG_IcsOptions DIALOGEX 0, 0, 302, 268 diff --git a/winboard/woptions.c b/winboard/woptions.c index fd0ac4c..f5dbb3e 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -146,12 +146,14 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) static Boolean oldShowCoords; static Boolean oldBlindfold; static Boolean oldShowButtonBar; + static Boolean oldAutoLogo; switch (message) { case WM_INITDIALOG: /* message: initialize dialog box */ oldShowCoords = appData.showCoords; oldBlindfold = appData.blindfold; oldShowButtonBar = appData.showButtonBar; + oldAutoLogo = appData.autoLogo; /* Center the dialog over the application window */ CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER)); @@ -181,6 +183,7 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CHECK_BOX(OPT_SaveExtPGN, appData.saveExtendedInfoInPGN); CHECK_BOX(OPT_ExtraInfoInMoveHistory, appData.showEvalInMoveHistory); CHECK_BOX(OPT_HighlightMoveArrow, appData.highlightMoveWithArrow); + CHECK_BOX(OPT_AutoLogo, appData.autoLogo); // [HGM] logo #undef CHECK_BOX @@ -228,6 +231,7 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) ShowThinkingEvent(); // [HGM] thinking: tests four options appData.testLegality = IS_CHECKED(OPT_TestLegality); appData.highlightMoveWithArrow=IS_CHECKED(OPT_HighlightMoveArrow); + appData.autoLogo =IS_CHECKED(OPT_AutoLogo); // [HGM] logo #undef IS_CHECKED @@ -249,7 +253,10 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) */ EndDialog(hDlg, TRUE); - if (oldShowButtonBar != appData.showButtonBar) { + if (oldAutoLogo != appData.autoLogo) { // [HGM] logo: remove any logos when we switch autologo off + if(oldAutoLogo) first.programLogo = second.programLogo = NULL; + InitDrawingSizes(boardSize, 0); + } else if (oldShowButtonBar != appData.showButtonBar) { InitDrawingSizes(boardSize, 0); } else if ((oldShowCoords != appData.showCoords) || (oldBlindfold != appData.blindfold)) { -- 1.7.0.4