Add option Display Logo in WB general-options menu
[xboard.git] / winboard / woptions.c
old mode 100755 (executable)
new mode 100644 (file)
index 09739e5..f5dbb3e
@@ -1,7 +1,7 @@
 /*\r
  * woptions.c -- Options dialog box routines for WinBoard\r
  *\r
- * Copyright 2000,2009 Free Software Foundation, Inc.\r
+ * Copyright 2000, 2009, 2010 Free Software Foundation, Inc.\r
  *\r
  * Enhancements Copyright 2005 Alessandro Scotti\r
  *\r
@@ -146,12 +146,14 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   static Boolean oldShowCoords;\r
   static Boolean oldBlindfold;\r
   static Boolean oldShowButtonBar;\r
+  static Boolean oldAutoLogo;\r
 \r
   switch (message) {\r
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     oldShowCoords = appData.showCoords;\r
     oldBlindfold  = appData.blindfold;\r
     oldShowButtonBar = appData.showButtonBar;\r
+    oldAutoLogo  = appData.autoLogo;\r
 \r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
@@ -181,6 +183,7 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     CHECK_BOX(OPT_SaveExtPGN, appData.saveExtendedInfoInPGN);\r
     CHECK_BOX(OPT_ExtraInfoInMoveHistory, appData.showEvalInMoveHistory);\r
     CHECK_BOX(OPT_HighlightMoveArrow, appData.highlightMoveWithArrow);\r
+    CHECK_BOX(OPT_AutoLogo, appData.autoLogo); // [HGM] logo\r
 \r
 #undef CHECK_BOX\r
 \r
@@ -228,6 +231,7 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       ShowThinkingEvent(); // [HGM] thinking: tests four options\r
       appData.testLegality         = IS_CHECKED(OPT_TestLegality);\r
       appData.highlightMoveWithArrow=IS_CHECKED(OPT_HighlightMoveArrow);\r
+      appData.autoLogo             =IS_CHECKED(OPT_AutoLogo); // [HGM] logo\r
 \r
 #undef IS_CHECKED\r
 \r
@@ -249,7 +253,10 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        */\r
       EndDialog(hDlg, TRUE);\r
 \r
-      if (oldShowButtonBar != appData.showButtonBar) {\r
+      if (oldAutoLogo != appData.autoLogo) { // [HGM] logo: remove any logos when we switch autologo off\r
+       if(oldAutoLogo) first.programLogo = second.programLogo = NULL;\r
+       InitDrawingSizes(boardSize, 0);\r
+      } else if (oldShowButtonBar != appData.showButtonBar) {\r
        InitDrawingSizes(boardSize, 0);\r
       } else if ((oldShowCoords != appData.showCoords) || \r
                 (oldBlindfold != appData.blindfold)) {\r
@@ -774,7 +781,8 @@ VariantWhichRadio(HWND hDlg)
          (IsDlgButtonChecked(hDlg, OPT_VariantGreat) ? VariantGreat :\r
          (IsDlgButtonChecked(hDlg, OPT_VariantGiveaway) ? VariantGiveaway :\r
          (IsDlgButtonChecked(hDlg, OPT_VariantTwilight) ? VariantTwilight :\r
-          VariantNormal ))))))))))))))))))))))))))));\r
+         (IsDlgButtonChecked(hDlg, OPT_VariantMakruk) ? VariantMakruk :\r
+          VariantNormal )))))))))))))))))))))))))))));\r
 }\r
 \r
 LRESULT CALLBACK\r
@@ -873,6 +881,9 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     case VariantTwilight:\r
       CheckDlgButton(hDlg, OPT_VariantTwilight, TRUE);\r
       break;\r
+    case VariantMakruk:\r
+      CheckDlgButton(hDlg, OPT_VariantMakruk, TRUE);\r
+      break;\r
     default: ;\r
     }\r
 \r
@@ -1171,6 +1182,11 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     CHECK_BOX(OPT_GetMoveList, appData.getMoveList);\r
     CHECK_BOX(OPT_LocalLineEditing, appData.localLineEditing);\r
     CHECK_BOX(OPT_QuietPlay, appData.quietPlay);\r
+    CHECK_BOX(OPT_SeekGraph, appData.seekGraph);\r
+    CHECK_BOX(OPT_AutoRefresh, appData.autoRefresh);\r
+    CHECK_BOX(OPT_BgObserve, appData.bgObserve);\r
+    CHECK_BOX(OPT_DualBoard, appData.dualBoard);\r
+    CHECK_BOX(OPT_SmartMove, appData.oneClick);\r
     CHECK_BOX(OPT_Premove, appData.premove);\r
     CHECK_BOX(OPT_PremoveWhite, appData.premoveWhite);\r
     CHECK_BOX(OPT_PremoveBlack, appData.premoveBlack);\r
@@ -1183,6 +1199,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     SetDlgItemText(hDlg, OPT_IcsAlarmTime, buf);\r
     SetDlgItemText(hDlg, OPT_PremoveWhiteText, appData.premoveWhiteText);\r
     SetDlgItemText(hDlg, OPT_PremoveBlackText, appData.premoveBlackText);\r
+    SetDlgItemText(hDlg, OPT_StartupChatBoxes, appData.chatBoxes);\r
 \r
     SendDlgItemMessage(hDlg, OPT_SampleShout,     EM_SETBKGNDCOLOR, 0, cbc);\r
     SendDlgItemMessage(hDlg, OPT_SampleSShout,    EM_SETBKGNDCOLOR, 0, cbc);\r
@@ -1249,12 +1266,19 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       appData.getMoveList      = IS_CHECKED(OPT_GetMoveList);\r
       appData.localLineEditing = IS_CHECKED(OPT_LocalLineEditing);\r
       appData.quietPlay        = IS_CHECKED(OPT_QuietPlay);\r
+      appData.seekGraph        = IS_CHECKED(OPT_SeekGraph);\r
+      appData.autoRefresh      = IS_CHECKED(OPT_AutoRefresh);\r
+      appData.bgObserve        = IS_CHECKED(OPT_BgObserve);\r
+      appData.dualBoard        = IS_CHECKED(OPT_DualBoard);\r
+      appData.oneClick         = IS_CHECKED(OPT_SmartMove);\r
 \r
 #undef IS_CHECKED\r
 \r
       appData.icsAlarmTime = number * 1000;\r
       GetDlgItemText(hDlg, OPT_PremoveWhiteText, appData.premoveWhiteText, 5);\r
       GetDlgItemText(hDlg, OPT_PremoveBlackText, appData.premoveBlackText, 5);\r
+      GetDlgItemText(hDlg, OPT_StartupChatBoxes, buf, sizeof(buf));\r
+      buf[sizeof(buf)-1] = NULLCHAR; appData.chatBoxes = StrSave(buf); // memory leak\r
 \r
       if (appData.localLineEditing) {\r
        DontEcho();\r