PageRenderTime 47ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/menus.c

#
C | 1277 lines | 1062 code | 117 blank | 98 comment | 93 complexity | 4b6fe1bfaa99f0771c9d244db369a008 MD5 | raw file
Possible License(s): GPL-3.0, MPL-2.0-no-copyleft-exception
  1. /*
  2. * menus.c -- platform-indendent menu handling code for XBoard
  3. *
  4. * Copyright 1991 by Digital Equipment Corporation, Maynard,
  5. * Massachusetts.
  6. *
  7. * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
  8. * 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
  9. *
  10. * The following terms apply to Digital Equipment Corporation's copyright
  11. * interest in XBoard:
  12. * ------------------------------------------------------------------------
  13. * All Rights Reserved
  14. *
  15. * Permission to use, copy, modify, and distribute this software and its
  16. * documentation for any purpose and without fee is hereby granted,
  17. * provided that the above copyright notice appear in all copies and that
  18. * both that copyright notice and this permission notice appear in
  19. * supporting documentation, and that the name of Digital not be
  20. * used in advertising or publicity pertaining to distribution of the
  21. * software without specific, written prior permission.
  22. *
  23. * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  24. * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  25. * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  26. * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  27. * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  28. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  29. * SOFTWARE.
  30. * ------------------------------------------------------------------------
  31. *
  32. * The following terms apply to the enhanced version of XBoard
  33. * distributed by the Free Software Foundation:
  34. * ------------------------------------------------------------------------
  35. *
  36. * GNU XBoard is free software: you can redistribute it and/or modify
  37. * it under the terms of the GNU General Public License as published by
  38. * the Free Software Foundation, either version 3 of the License, or (at
  39. * your option) any later version.
  40. *
  41. * GNU XBoard is distributed in the hope that it will be useful, but
  42. * WITHOUT ANY WARRANTY; without even the implied warranty of
  43. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  44. * General Public License for more details.
  45. *
  46. * You should have received a copy of the GNU General Public License
  47. * along with this program. If not, see http://www.gnu.org/licenses/. *
  48. *
  49. *------------------------------------------------------------------------
  50. ** See the file ChangeLog for a revision history. */
  51. #define HIGHDRAG 1
  52. #include "config.h"
  53. #include <stdio.h>
  54. #include <ctype.h>
  55. #include <signal.h>
  56. #include <errno.h>
  57. #include <sys/types.h>
  58. #include <sys/stat.h>
  59. #include <pwd.h>
  60. #include <math.h>
  61. #if STDC_HEADERS
  62. # include <stdlib.h>
  63. # include <string.h>
  64. #else /* not STDC_HEADERS */
  65. extern char *getenv();
  66. # if HAVE_STRING_H
  67. # include <string.h>
  68. # else /* not HAVE_STRING_H */
  69. # include <strings.h>
  70. # endif /* not HAVE_STRING_H */
  71. #endif /* not STDC_HEADERS */
  72. #if HAVE_UNISTD_H
  73. # include <unistd.h>
  74. #endif
  75. #if ENABLE_NLS
  76. #include <locale.h>
  77. #endif
  78. // [HGM] bitmaps: put before incuding the bitmaps / pixmaps, to know how many piece types there are.
  79. #include "common.h"
  80. #include "frontend.h"
  81. #include "backend.h"
  82. #include "backendz.h"
  83. #include "moves.h"
  84. #include "xhistory.h"
  85. #include "xedittags.h"
  86. #include "menus.h"
  87. #include "gettext.h"
  88. #ifdef ENABLE_NLS
  89. # define _(s) gettext (s)
  90. # define N_(s) gettext_noop (s)
  91. #else
  92. # define _(s) (s)
  93. # define N_(s) s
  94. #endif
  95. /*
  96. * Button/menu procedures
  97. */
  98. char *gameCopyFilename, *gamePasteFilename;
  99. Boolean saveSettingsOnExit;
  100. char *settingsFileName;
  101. static int
  102. LoadGamePopUp (FILE *f, int gameNumber, char *title)
  103. {
  104. cmailMsgLoaded = FALSE;
  105. if (gameNumber == 0) {
  106. int error = GameListBuild(f);
  107. if (error) {
  108. DisplayError(_("Cannot build game list"), error);
  109. } else if (!ListEmpty(&gameList) &&
  110. ((ListGame *) gameList.tailPred)->number > 1) {
  111. GameListPopUp(f, title);
  112. return TRUE;
  113. }
  114. GameListDestroy();
  115. gameNumber = 1;
  116. }
  117. return LoadGame(f, gameNumber, title, FALSE);
  118. }
  119. void
  120. LoadGameProc ()
  121. {
  122. if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) {
  123. Reset(FALSE, TRUE);
  124. }
  125. FileNamePopUp(_("Load game file name?"), "", ".pgn .game", LoadGamePopUp, "rb");
  126. }
  127. void
  128. LoadNextGameProc ()
  129. {
  130. ReloadGame(1);
  131. }
  132. void
  133. LoadPrevGameProc ()
  134. {
  135. ReloadGame(-1);
  136. }
  137. void
  138. ReloadGameProc ()
  139. {
  140. ReloadGame(0);
  141. }
  142. void
  143. LoadNextPositionProc ()
  144. {
  145. ReloadPosition(1);
  146. }
  147. void
  148. LoadPrevPositionProc ()
  149. {
  150. ReloadPosition(-1);
  151. }
  152. void
  153. ReloadPositionProc ()
  154. {
  155. ReloadPosition(0);
  156. }
  157. void
  158. LoadPositionProc()
  159. {
  160. if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) {
  161. Reset(FALSE, TRUE);
  162. }
  163. FileNamePopUp(_("Load position file name?"), "", ".fen .epd .pos", LoadPosition, "rb");
  164. }
  165. void
  166. SaveGameProc ()
  167. {
  168. FileNamePopUp(_("Save game file name?"),
  169. DefaultFileName(appData.oldSaveStyle ? "game" : "pgn"),
  170. appData.oldSaveStyle ? ".game" : ".pgn",
  171. SaveGame, "a");
  172. }
  173. void
  174. SavePositionProc ()
  175. {
  176. FileNamePopUp(_("Save position file name?"),
  177. DefaultFileName(appData.oldSaveStyle ? "pos" : "fen"),
  178. appData.oldSaveStyle ? ".pos" : ".fen",
  179. SavePosition, "a");
  180. }
  181. void
  182. ReloadCmailMsgProc ()
  183. {
  184. ReloadCmailMsgEvent(FALSE);
  185. }
  186. void
  187. CopyFENToClipboard ()
  188. { // wrapper to make call from back-end possible
  189. CopyPositionProc();
  190. }
  191. void
  192. CopyPositionProc ()
  193. {
  194. static char *selected_fen_position=NULL;
  195. if(gameMode == EditPosition) EditPositionDone(TRUE);
  196. if (selected_fen_position) free(selected_fen_position);
  197. selected_fen_position = (char *)PositionToFEN(currentMove, NULL);
  198. if (!selected_fen_position) return;
  199. CopySomething(selected_fen_position);
  200. }
  201. void
  202. CopyGameProc ()
  203. {
  204. int ret;
  205. ret = SaveGameToFile(gameCopyFilename, FALSE);
  206. if (!ret) return;
  207. CopySomething(NULL);
  208. }
  209. void
  210. CopyGameListProc ()
  211. {
  212. if(!SaveGameListAsText(fopen(gameCopyFilename, "w"))) return;
  213. CopySomething(NULL);
  214. }
  215. void
  216. AutoSaveGame ()
  217. {
  218. SaveGameProc();
  219. }
  220. void
  221. QuitProc ()
  222. {
  223. ExitEvent(0);
  224. }
  225. void
  226. AnalyzeModeProc ()
  227. {
  228. char buf[MSG_SIZ];
  229. if (!first.analysisSupport) {
  230. snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy);
  231. DisplayError(buf, 0);
  232. return;
  233. }
  234. /* [DM] icsEngineAnalyze [HGM] This is horrible code; reverse the gameMode and isEngineAnalyze tests! */
  235. if (appData.icsActive) {
  236. if (gameMode != IcsObserving) {
  237. snprintf(buf, MSG_SIZ, _("You are not observing a game"));
  238. DisplayError(buf, 0);
  239. /* secure check */
  240. if (appData.icsEngineAnalyze) {
  241. if (appData.debugMode)
  242. fprintf(debugFP, _("Found unexpected active ICS engine analyze \n"));
  243. ExitAnalyzeMode();
  244. ModeHighlight();
  245. }
  246. return;
  247. }
  248. /* if enable, use want disable icsEngineAnalyze */
  249. if (appData.icsEngineAnalyze) {
  250. ExitAnalyzeMode();
  251. ModeHighlight();
  252. return;
  253. }
  254. appData.icsEngineAnalyze = TRUE;
  255. if (appData.debugMode)
  256. fprintf(debugFP, _("ICS engine analyze starting... \n"));
  257. }
  258. #ifndef OPTIONSDIALOG
  259. if (!appData.showThinking)
  260. ShowThinkingProc();
  261. #endif
  262. AnalyzeModeEvent();
  263. }
  264. void
  265. AnalyzeFileProc ()
  266. {
  267. if (!first.analysisSupport) {
  268. char buf[MSG_SIZ];
  269. snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy);
  270. DisplayError(buf, 0);
  271. return;
  272. }
  273. // Reset(FALSE, TRUE);
  274. #ifndef OPTIONSDIALOG
  275. if (!appData.showThinking)
  276. ShowThinkingProc();
  277. #endif
  278. AnalyzeFileEvent();
  279. // FileNamePopUp(_("File to analyze"), "", ".pgn .game", LoadGamePopUp, "rb");
  280. AnalysisPeriodicEvent(1);
  281. }
  282. void
  283. MatchProc ()
  284. {
  285. MatchEvent(2);
  286. }
  287. void
  288. AdjuWhiteProc ()
  289. {
  290. UserAdjudicationEvent(+1);
  291. }
  292. void
  293. AdjuBlackProc ()
  294. {
  295. UserAdjudicationEvent(-1);
  296. }
  297. void
  298. AdjuDrawProc ()
  299. {
  300. UserAdjudicationEvent(0);
  301. }
  302. void
  303. RevertProc ()
  304. {
  305. RevertEvent(False);
  306. }
  307. void
  308. AnnotateProc ()
  309. {
  310. RevertEvent(True);
  311. }
  312. void
  313. FlipViewProc ()
  314. {
  315. if(twoBoards) { partnerUp = 1; DrawPosition(True, NULL); partnerUp = 0; }
  316. flipView = !flipView;
  317. DrawPosition(True, NULL);
  318. }
  319. void
  320. SaveOnExitProc ()
  321. {
  322. saveSettingsOnExit = !saveSettingsOnExit;
  323. MarkMenuItem("Options.SaveSettingsonExit", saveSettingsOnExit);
  324. }
  325. void
  326. SaveSettingsProc ()
  327. {
  328. SaveSettings(settingsFileName);
  329. }
  330. void
  331. InfoProc ()
  332. {
  333. char buf[MSG_SIZ];
  334. snprintf(buf, sizeof(buf), "xterm -e info --directory %s --directory . -f %s &",
  335. INFODIR, INFOFILE);
  336. system(buf);
  337. }
  338. void
  339. BugReportProc ()
  340. {
  341. char buf[MSG_SIZ];
  342. snprintf(buf, MSG_SIZ, "%s mailto:bug-xboard@gnu.org", appData.sysOpen);
  343. system(buf);
  344. }
  345. void
  346. GuideProc ()
  347. {
  348. char buf[MSG_SIZ];
  349. snprintf(buf, MSG_SIZ, "%s http://www.gnu.org/software/xboard/user_guide/UserGuide.html", appData.sysOpen);
  350. system(buf);
  351. }
  352. void
  353. HomePageProc ()
  354. {
  355. char buf[MSG_SIZ];
  356. snprintf(buf, MSG_SIZ, "%s http://www.gnu.org/software/xboard/", appData.sysOpen);
  357. system(buf);
  358. }
  359. void
  360. NewsPageProc ()
  361. {
  362. char buf[MSG_SIZ];
  363. snprintf(buf, MSG_SIZ, "%s http://www.gnu.org/software/xboard/whats_new/portal.html", appData.sysOpen);
  364. system(buf);
  365. }
  366. void
  367. AboutProc ()
  368. {
  369. char buf[2 * MSG_SIZ];
  370. #if ZIPPY
  371. char *zippy = _(" (with Zippy code)");
  372. #else
  373. char *zippy = "";
  374. #endif
  375. snprintf(buf, sizeof(buf),
  376. _("%s%s\n\n"
  377. "Copyright 1991 Digital Equipment Corporation\n"
  378. "Enhancements Copyright 1992-2012 Free Software Foundation\n"
  379. "Enhancements Copyright 2005 Alessandro Scotti\n\n"
  380. "%s is free software and carries NO WARRANTY;"
  381. "see the file COPYING for more information.\n\n"
  382. "Visit XBoard on the web at: http://www.gnu.org/software/xboard/\n"
  383. "Check out the newest features at: http://www.gnu.org/software/xboard/whats_new.html\n\n"
  384. "Report bugs via email at: <bug-xboard@gnu.org>\n\n"
  385. ),
  386. programVersion, zippy, PACKAGE);
  387. ErrorPopUp(_("About XBoard"), buf, FALSE);
  388. }
  389. void
  390. DebugProc ()
  391. {
  392. appData.debugMode = !appData.debugMode;
  393. if(!strcmp(appData.nameOfDebugFile, "stderr")) return; // stderr is already open, and should never be closed
  394. if(!appData.debugMode) fclose(debugFP);
  395. else {
  396. debugFP = fopen(appData.nameOfDebugFile, "w");
  397. if(debugFP == NULL) debugFP = stderr;
  398. else setbuf(debugFP, NULL);
  399. }
  400. }
  401. void
  402. NothingProc ()
  403. {
  404. return;
  405. }
  406. #ifdef OPTIONSDIALOG
  407. # define MARK_MENU_ITEM(X,Y)
  408. #else
  409. # define MARK_MENU_ITEM(X,Y) MarkMenuItem(X, Y)
  410. #endif
  411. void
  412. PonderNextMoveProc ()
  413. {
  414. PonderNextMoveEvent(!appData.ponderNextMove);
  415. MARK_MENU_ITEM("Options.PonderNextMove", appData.ponderNextMove);
  416. }
  417. void
  418. AlwaysQueenProc ()
  419. {
  420. appData.alwaysPromoteToQueen = !appData.alwaysPromoteToQueen;
  421. MARK_MENU_ITEM("Options.AlwaysQueen", appData.alwaysPromoteToQueen);
  422. }
  423. void
  424. AnimateDraggingProc ()
  425. {
  426. appData.animateDragging = !appData.animateDragging;
  427. if (appData.animateDragging) CreateAnimVars();
  428. MARK_MENU_ITEM("Options.AnimateDragging", appData.animateDragging);
  429. }
  430. void
  431. AnimateMovingProc ()
  432. {
  433. appData.animate = !appData.animate;
  434. if (appData.animate) CreateAnimVars();
  435. MARK_MENU_ITEM("Options.AnimateMoving", appData.animate);
  436. }
  437. void
  438. AutoflagProc ()
  439. {
  440. appData.autoCallFlag = !appData.autoCallFlag;
  441. MARK_MENU_ITEM("Options.AutoFlag", appData.autoCallFlag);
  442. }
  443. void
  444. AutoflipProc ()
  445. {
  446. appData.autoFlipView = !appData.autoFlipView;
  447. MARK_MENU_ITEM("Options.AutoFlipView", appData.autoFlipView);
  448. }
  449. void
  450. BlindfoldProc ()
  451. {
  452. appData.blindfold = !appData.blindfold;
  453. MARK_MENU_ITEM("Options.Blindfold", appData.blindfold);
  454. DrawPosition(True, NULL);
  455. }
  456. void
  457. TestLegalityProc ()
  458. {
  459. appData.testLegality = !appData.testLegality;
  460. MARK_MENU_ITEM("Options.TestLegality", appData.testLegality);
  461. }
  462. void
  463. FlashMovesProc ()
  464. {
  465. if (appData.flashCount == 0) {
  466. appData.flashCount = 3;
  467. } else {
  468. appData.flashCount = -appData.flashCount;
  469. }
  470. MARK_MENU_ITEM("Options.FlashMoves", appData.flashCount > 0);
  471. }
  472. #if HIGHDRAG
  473. void
  474. HighlightDraggingProc ()
  475. {
  476. appData.highlightDragging = !appData.highlightDragging;
  477. MARK_MENU_ITEM("Options.HighlightDragging", appData.highlightDragging);
  478. }
  479. #endif
  480. void
  481. HighlightLastMoveProc ()
  482. {
  483. appData.highlightLastMove = !appData.highlightLastMove;
  484. MARK_MENU_ITEM("Options.HighlightLastMove", appData.highlightLastMove);
  485. }
  486. void
  487. HighlightArrowProc ()
  488. {
  489. appData.highlightMoveWithArrow = !appData.highlightMoveWithArrow;
  490. MARK_MENU_ITEM("Options.HighlightWithArrow", appData.highlightMoveWithArrow);
  491. }
  492. void
  493. IcsAlarmProc ()
  494. {
  495. appData.icsAlarm = !appData.icsAlarm;
  496. // MARK_MENU_ITEM("Options.ICSAlarm", appData.icsAlarm);
  497. }
  498. void
  499. MoveSoundProc ()
  500. {
  501. appData.ringBellAfterMoves = !appData.ringBellAfterMoves;
  502. MARK_MENU_ITEM("Options.MoveSound", appData.ringBellAfterMoves);
  503. }
  504. void
  505. OneClickProc ()
  506. {
  507. appData.oneClick = !appData.oneClick;
  508. MARK_MENU_ITEM("Options.OneClickMoving", appData.oneClick);
  509. }
  510. void
  511. PeriodicUpdatesProc ()
  512. {
  513. PeriodicUpdatesEvent(!appData.periodicUpdates);
  514. MARK_MENU_ITEM("Options.PeriodicUpdates", appData.periodicUpdates);
  515. }
  516. void
  517. PopupExitMessageProc ()
  518. {
  519. appData.popupExitMessage = !appData.popupExitMessage;
  520. MARK_MENU_ITEM("Options.PopupExitMessage", appData.popupExitMessage);
  521. }
  522. void
  523. PopupMoveErrorsProc ()
  524. {
  525. appData.popupMoveErrors = !appData.popupMoveErrors;
  526. MARK_MENU_ITEM("Options.PopupMoveErrors", appData.popupMoveErrors);
  527. }
  528. void
  529. PremoveProc ()
  530. {
  531. appData.premove = !appData.premove;
  532. // MARK_MENU_ITEM("Options.Premove", appData.premove);
  533. }
  534. void
  535. ShowCoordsProc ()
  536. {
  537. appData.showCoords = !appData.showCoords;
  538. MARK_MENU_ITEM("Options.ShowCoords", appData.showCoords);
  539. DrawPosition(True, NULL);
  540. }
  541. void
  542. ShowThinkingProc ()
  543. {
  544. appData.showThinking = !appData.showThinking; // [HGM] thinking: taken out of ShowThinkingEvent
  545. ShowThinkingEvent();
  546. }
  547. void
  548. HideThinkingProc ()
  549. {
  550. appData.hideThinkingFromHuman = !appData.hideThinkingFromHuman; // [HGM] thinking: taken out of ShowThinkingEvent
  551. ShowThinkingEvent();
  552. MARK_MENU_ITEM("Options.HideThinking", appData.hideThinkingFromHuman);
  553. }
  554. /*
  555. * Menu definition tables
  556. */
  557. MenuItem fileMenu[] = {
  558. {N_("New Game Ctrl+N"), "NewGame", ResetGameEvent},
  559. {N_("New Shuffle Game ..."), "NewShuffleGame", ShuffleMenuProc},
  560. {N_("New Variant ... Alt+Shift+V"), "NewVariant", NewVariantProc}, // [HGM] variant: not functional yet
  561. {"----", NULL, NothingProc},
  562. {N_("Load Game Ctrl+O"), "LoadGame", LoadGameProc},
  563. {N_("Load Position Ctrl+Shift+O"), "LoadPosition", LoadPositionProc},
  564. // {N_("Load Next Game"), "LoadNextGame", LoadNextGameProc},
  565. // {N_("Load Previous Game"), "LoadPreviousGame", LoadPrevGameProc},
  566. // {N_("Reload Same Game"), "ReloadSameGame", ReloadGameProc},
  567. {N_("Next Position Shift+PgDn"), "LoadNextPosition", LoadNextPositionProc},
  568. {N_("Prev Position Shift+PgUp"), "LoadPreviousPosition", LoadPrevPositionProc},
  569. {"----", NULL, NothingProc},
  570. // {N_("Reload Same Position"), "Reload Same Position", ReloadPositionProc},
  571. {N_("Save Game Ctrl+S"), "SaveGame", SaveGameProc},
  572. {N_("Save Position Ctrl+Shift+S"), "SavePosition", SavePositionProc},
  573. {"----", NULL, NothingProc},
  574. {N_("Mail Move"), "MailMove", MailMoveEvent},
  575. {N_("Reload CMail Message"), "ReloadCMailMessage", ReloadCmailMsgProc},
  576. {"----", NULL, NothingProc},
  577. {N_("Quit Ctr+Q"), "Quit", QuitProc},
  578. {NULL, NULL, NULL}
  579. };
  580. MenuItem editMenu[] = {
  581. {N_("Copy Game Ctrl+C"), "CopyGame", CopyGameProc},
  582. {N_("Copy Position Ctrl+Shift+C"), "CopyPosition", CopyPositionProc},
  583. {N_("Copy Game List"), "CopyGameList", CopyGameListProc},
  584. {"----", NULL, NothingProc},
  585. {N_("Paste Game Ctrl+V"), "PasteGame", PasteGameProc},
  586. {N_("Paste Position Ctrl+Shift+V"), "PastePosition", PastePositionProc},
  587. {"----", NULL, NothingProc},
  588. {N_("Edit Game Ctrl+E"), "EditGame", EditGameEvent},
  589. {N_("Edit Position Ctrl+Shift+E"), "EditPosition", EditPositionEvent},
  590. {N_("Edit Tags"), "EditTags", EditTagsProc},
  591. {N_("Edit Comment"), "EditComment", EditCommentProc},
  592. {N_("Edit Book"), "EditBook", EditBookEvent},
  593. {"----", NULL, NothingProc},
  594. {N_("Revert Home"), "Revert", RevertProc},
  595. {N_("Annotate"), "Annotate", AnnotateProc},
  596. {N_("Truncate Game End"), "TruncateGame", TruncateGameEvent},
  597. {"----", NULL, NothingProc},
  598. {N_("Backward Alt+Left"), "Backward", BackwardEvent},
  599. {N_("Forward Alt+Right"), "Forward", ForwardEvent},
  600. {N_("Back to Start Alt+Home"), "BacktoStart", ToStartEvent},
  601. {N_("Forward to End Alt+End"), "ForwardtoEnd", ToEndEvent},
  602. {NULL, NULL, NULL}
  603. };
  604. MenuItem viewMenu[] = {
  605. {N_("Flip View F2"), "FlipView", FlipViewProc},
  606. {"----", NULL, NothingProc},
  607. {N_("Engine Output Alt+Shift+O"), "EngineOutput", EngineOutputProc},
  608. {N_("Move History Alt+Shift+H"), "MoveHistory", HistoryShowProc}, // [HGM] hist: activate 4.2.7 code
  609. {N_("Evaluation Graph Alt+Shift+E"), "EvaluationGraph", EvalGraphProc},
  610. {N_("Game List Alt+Shift+G"), "GameList", ShowGameListProc},
  611. {N_("ICS text menu"), "ICStextmenu", IcsTextProc},
  612. {"----", NULL, NothingProc},
  613. {N_("Tags"), "Tags", EditTagsProc},
  614. {N_("Comments"), "Comments", EditCommentProc},
  615. {N_("ICS Input Box"), "ICSInputBox", IcsInputBoxProc},
  616. {N_("Open Chat Window"), "OpenChatWindow", ChatProc},
  617. {"----", NULL, NothingProc},
  618. {N_("Board..."), "Board", BoardOptionsProc},
  619. {N_("Game List Tags..."), "GameListTags", GameListOptionsProc},
  620. {NULL, NULL, NULL}
  621. };
  622. MenuItem modeMenu[] = {
  623. {N_("Machine White Ctrl+W"), "MachineWhite", MachineWhiteEvent},
  624. {N_("Machine Black Ctrl+B"), "MachineBlack", MachineBlackEvent},
  625. {N_("Two Machines Ctrl+T"), "TwoMachines", TwoMachinesEvent},
  626. {N_("Analysis Mode Ctrl+A"), "AnalysisMode", AnalyzeModeProc},
  627. {N_("Analyze Game Ctrl+G"), "AnalyzeFile", AnalyzeFileProc },
  628. {N_("Edit Game Ctrl+E"), "EditGame", EditGameEvent},
  629. {N_("Edit Position Ctrl+Shift+E"), "EditPosition", EditPositionEvent},
  630. {N_("Training"), "Training", TrainingEvent},
  631. {N_("ICS Client"), "ICSClient", IcsClientEvent},
  632. {"----", NULL, NothingProc},
  633. {N_("Machine Match"), "MachineMatch", MatchProc},
  634. {N_("Pause Pause"), "Pause", PauseEvent},
  635. {NULL, NULL, NULL}
  636. };
  637. MenuItem actionMenu[] = {
  638. {N_("Accept F3"), "Accept", AcceptEvent},
  639. {N_("Decline F4"), "Decline", DeclineEvent},
  640. {N_("Rematch F12"), "Rematch", RematchEvent},
  641. {"----", NULL, NothingProc},
  642. {N_("Call Flag F5"), "CallFlag", CallFlagEvent},
  643. {N_("Draw F6"), "Draw", DrawEvent},
  644. {N_("Adjourn F7"), "Adjourn", AdjournEvent},
  645. {N_("Abort F8"),"Abort", AbortEvent},
  646. {N_("Resign F9"), "Resign", ResignEvent},
  647. {"----", NULL, NothingProc},
  648. {N_("Stop Observing F10"), "StopObserving", StopObservingEvent},
  649. {N_("Stop Examining F11"), "StopExamining", StopExaminingEvent},
  650. {N_("Upload to Examine"), "UploadtoExamine", UploadGameEvent},
  651. {"----", NULL, NothingProc},
  652. {N_("Adjudicate to White"), "AdjudicatetoWhite", AdjuWhiteProc},
  653. {N_("Adjudicate to Black"), "AdjudicatetoBlack", AdjuBlackProc},
  654. {N_("Adjudicate Draw"), "AdjudicateDraw", AdjuDrawProc},
  655. {NULL, NULL, NULL}
  656. };
  657. MenuItem engineMenu[] = {
  658. {N_("Load New 1st Engine ..."), "LoadNew1stEngine", LoadEngine1Proc},
  659. {N_("Load New 2nd Engine ..."), "LoadNew2ndEngine", LoadEngine2Proc},
  660. {"----", NULL, NothingProc},
  661. {N_("Engine #1 Settings ..."), "Engine#1Settings", FirstSettingsProc},
  662. {N_("Engine #2 Settings ..."), "Engine#2Settings", SecondSettingsProc},
  663. {"----", NULL, NothingProc},
  664. {N_("Hint"), "Hint", HintEvent},
  665. {N_("Book"), "Book", BookEvent},
  666. {"----", NULL, NothingProc},
  667. {N_("Move Now Ctrl+M"), "MoveNow", MoveNowEvent},
  668. {N_("Retract Move Ctrl+X"), "RetractMove", RetractMoveEvent},
  669. {NULL, NULL, NULL}
  670. };
  671. MenuItem optionsMenu[] = {
  672. #ifdef OPTIONSDIALOG
  673. {N_("General ..."), "General", OptionsProc},
  674. #endif
  675. {N_("Time Control ... Alt+Shift+T"), "TimeControl", TimeControlProc},
  676. {N_("Common Engine ... Alt+Shift+U"), "CommonEngine", UciMenuProc},
  677. {N_("Adjudications ... Alt+Shift+J"), "Adjudications", EngineMenuProc},
  678. {N_("ICS ..."), "ICS", IcsOptionsProc},
  679. {N_("Match ..."), "Match", MatchOptionsProc},
  680. {N_("Load Game ..."), "LoadGame", LoadOptionsProc},
  681. {N_("Save Game ..."), "SaveGame", SaveOptionsProc},
  682. // {N_(" ..."), "", OptionsProc},
  683. {N_("Game List ..."), "GameList", GameListOptionsProc},
  684. {N_("Sounds ..."), "Sounds", SoundOptionsProc},
  685. {"----", NULL, NothingProc},
  686. #ifndef OPTIONSDIALOG
  687. {N_("Always Queen Ctrl+Shift+Q"), "AlwaysQueen", AlwaysQueenProc},
  688. {N_("Animate Dragging"), "AnimateDragging", AnimateDraggingProc},
  689. {N_("Animate Moving Ctrl+Shift+A"), "AnimateMoving", AnimateMovingProc},
  690. {N_("Auto Flag Ctrl+Shift+F"), "AutoFlag", AutoflagProc},
  691. {N_("Auto Flip View"), "AutoFlipView", AutoflipProc},
  692. {N_("Blindfold"), "Blindfold", BlindfoldProc},
  693. {N_("Flash Moves"), "FlashMoves", FlashMovesProc},
  694. #if HIGHDRAG
  695. {N_("Highlight Dragging"), "HighlightDragging", HighlightDraggingProc},
  696. #endif
  697. {N_("Highlight Last Move"), "HighlightLastMove", HighlightLastMoveProc},
  698. {N_("Highlight With Arrow"), "HighlightWithArrow", HighlightArrowProc},
  699. {N_("Move Sound"), "MoveSound", MoveSoundProc},
  700. // {N_("ICS Alarm"), "ICSAlarm", IcsAlarmProc},
  701. {N_("One-Click Moving"), "OneClickMoving", OneClickProc},
  702. {N_("Periodic Updates"), "PeriodicUpdates", PeriodicUpdatesProc},
  703. {N_("Ponder Next Move Ctrl+Shift+P"), "PonderNextMove", PonderNextMoveProc},
  704. {N_("Popup Exit Message"), "PopupExitMessage", PopupExitMessageProc},
  705. {N_("Popup Move Errors"), "PopupMoveErrors", PopupMoveErrorsProc},
  706. // {N_("Premove"), "Premove", PremoveProc},
  707. {N_("Show Coords"), "ShowCoords", ShowCoordsProc},
  708. {N_("Hide Thinking Ctrl+Shift+H"), "HideThinking", HideThinkingProc},
  709. {N_("Test Legality Ctrl+Shift+L"), "TestLegality", TestLegalityProc},
  710. {"----", NULL, NothingProc},
  711. #endif
  712. {N_("Save Settings Now"), "SaveSettingsNow", SaveSettingsProc},
  713. {N_("Save Settings on Exit"), "SaveSettingsonExit", SaveOnExitProc},
  714. {NULL, NULL, NULL}
  715. };
  716. MenuItem helpMenu[] = {
  717. {N_("Info XBoard"), "InfoXBoard", InfoProc},
  718. {N_("Man XBoard F1"), "ManXBoard", ManProc},
  719. {"----", NULL, NothingProc},
  720. {N_("XBoard Home Page"), "XBoardHomePage", HomePageProc},
  721. {N_("On-line User Guide"), "On-lineUserGuide", GuideProc},
  722. {N_("Development News"), "DevelopmentNews", NewsPageProc},
  723. {N_("e-Mail Bug Report"), "e-MailBugReport", BugReportProc},
  724. {"----", NULL, NothingProc},
  725. {N_("About XBoard"), "AboutXBoard", AboutProc},
  726. {NULL, NULL, NULL}
  727. };
  728. MenuItem noMenu[] = {
  729. { "", "LoadNextGame", LoadNextGameProc },
  730. { "", "LoadPrevGame", LoadPrevGameProc },
  731. { "", "ReloadGame", ReloadGameProc },
  732. { "", "ReloadPosition", ReloadPositionProc },
  733. #ifndef OPTIONSDIALOG
  734. { "", "AlwaysQueen", AlwaysQueenProc },
  735. { "", "AnimateDragging", AnimateDraggingProc },
  736. { "", "AnimateMoving", AnimateMovingProc },
  737. { "", "Autoflag", AutoflagProc },
  738. { "", "Autoflip", AutoflipProc },
  739. { "", "Blindfold", BlindfoldProc },
  740. { "", "FlashMoves", FlashMovesProc },
  741. #if HIGHDRAG
  742. { "", "HighlightDragging", HighlightDraggingProc },
  743. #endif
  744. { "", "HighlightLastMove", HighlightLastMoveProc },
  745. // { "", "IcsAlarm", IcsAlarmProc },
  746. { "", "MoveSound", MoveSoundProc },
  747. { "", "PeriodicUpdates", PeriodicUpdatesProc },
  748. { "", "PopupExitMessage", PopupExitMessageProc },
  749. { "", "PopupMoveErrors", PopupMoveErrorsProc },
  750. // { "", "Premove", PremoveProc },
  751. { "", "ShowCoords", ShowCoordsProc },
  752. { "", "ShowThinking", ShowThinkingProc },
  753. { "", "HideThinking", HideThinkingProc },
  754. { "", "TestLegality", TestLegalityProc },
  755. #endif
  756. { "", "AboutGame", AboutGameEvent },
  757. { "", "DebugProc", DebugProc },
  758. { "", "Nothing", NothingProc },
  759. {NULL, NULL, NULL}
  760. };
  761. Menu menuBar[] = {
  762. {N_("File"), "File", fileMenu},
  763. {N_("Edit"), "Edit", editMenu},
  764. {N_("View"), "View", viewMenu},
  765. {N_("Mode"), "Mode", modeMenu},
  766. {N_("Action"), "Action", actionMenu},
  767. {N_("Engine"), "Engine", engineMenu},
  768. {N_("Options"), "Options", optionsMenu},
  769. {N_("Help"), "Help", helpMenu},
  770. {NULL, NULL, NULL}
  771. };
  772. MenuItem *
  773. MenuNameToItem (char *menuName)
  774. {
  775. int i=0;
  776. char buf[MSG_SIZ], *p;
  777. MenuItem *menuTab;
  778. static MenuItem a = { NULL, NULL, NothingProc };
  779. extern Option mainOptions[];
  780. safeStrCpy(buf, menuName, MSG_SIZ);
  781. p = strchr(buf, '.');
  782. if(!p) menuTab = noMenu, p = menuName; else {
  783. *p++ = NULLCHAR;
  784. for(i=0; menuBar[i].name; i++)
  785. if(!strcmp(buf, menuBar[i].name)) break;
  786. if(!menuBar[i].name) return NULL; // main menu not found
  787. menuTab = menuBar[i].mi;
  788. }
  789. if(*p == NULLCHAR) { a.handle = mainOptions[i+1].handle; return &a; } // main menu bar
  790. for(i=0; menuTab[i].string; i++)
  791. if(menuTab[i].ref && !strcmp(p, menuTab[i].ref)) return menuTab + i;
  792. return NULL; // item not found
  793. }
  794. void
  795. AppendEnginesToMenu (char *list)
  796. {
  797. int i=0;
  798. char *p;
  799. if(appData.icsActive || appData.recentEngines <= 0) return;
  800. recentEngines = strdup(list);
  801. while (*list) {
  802. p = strchr(list, '\n'); if(p == NULL) break;
  803. if(i == 0) AppendMenuItem("----", 0); // at least one valid item to add
  804. *p = 0;
  805. AppendMenuItem(list, i);
  806. i++; *p = '\n'; list = p + 1;
  807. }
  808. }
  809. Enables icsEnables[] = {
  810. { "File.MailMove", False },
  811. { "File.ReloadCMailMessage", False },
  812. { "Mode.MachineBlack", False },
  813. { "Mode.MachineWhite", False },
  814. { "Mode.AnalysisMode", False },
  815. { "Mode.AnalyzeFile", False },
  816. { "Mode.TwoMachines", False },
  817. { "Mode.MachineMatch", False },
  818. #ifndef ZIPPY
  819. { "Engine.Hint", False },
  820. { "Engine.Book", False },
  821. { "Engine.MoveNow", False },
  822. #ifndef OPTIONSDIALOG
  823. { "PeriodicUpdates", False },
  824. { "HideThinking", False },
  825. { "PonderNextMove", False },
  826. #endif
  827. #endif
  828. { "Engine.Engine#1Settings", False },
  829. { "Engine.Engine#2Settings", False },
  830. { "Engine.Load1stEngine", False },
  831. { "Engine.Load2ndEngine", False },
  832. { "Edit.Annotate", False },
  833. { "Options.Match", False },
  834. { NULL, False }
  835. };
  836. Enables ncpEnables[] = {
  837. { "File.MailMove", False },
  838. { "File.ReloadCMailMessage", False },
  839. { "Mode.MachineWhite", False },
  840. { "Mode.MachineBlack", False },
  841. { "Mode.AnalysisMode", False },
  842. { "Mode.AnalyzeFile", False },
  843. { "Mode.TwoMachines", False },
  844. { "Mode.MachineMatch", False },
  845. { "Mode.ICSClient", False },
  846. { "View.ICStextmenu", False },
  847. { "View.ICSInputBox", False },
  848. { "View.OpenChatWindow", False },
  849. { "Action.", False },
  850. { "Edit.Revert", False },
  851. { "Edit.Annotate", False },
  852. { "Engine.Engine#1Settings", False },
  853. { "Engine.Engine#2Settings", False },
  854. { "Engine.MoveNow", False },
  855. { "Engine.RetractMove", False },
  856. { "Options.ICS", False },
  857. #ifndef OPTIONSDIALOG
  858. { "Options.AutoFlag", False },
  859. { "Options.AutoFlip View", False },
  860. // { "Options.ICSAlarm", False },
  861. { "Options.MoveSound", False },
  862. { "Options.HideThinking", False },
  863. { "Options.PeriodicUpdates", False },
  864. { "Options.PonderNextMove", False },
  865. #endif
  866. { "Engine.Hint", False },
  867. { "Engine.Book", False },
  868. { NULL, False }
  869. };
  870. Enables gnuEnables[] = {
  871. { "Mode.ICSClient", False },
  872. { "View.ICStextmenu", False },
  873. { "View.ICSInputBox", False },
  874. { "View.OpenChatWindow", False },
  875. { "Action.Accept", False },
  876. { "Action.Decline", False },
  877. { "Action.Rematch", False },
  878. { "Action.Adjourn", False },
  879. { "Action.StopExamining", False },
  880. { "Action.StopObserving", False },
  881. { "Action.UploadtoExamine", False },
  882. { "Edit.Revert", False },
  883. { "Edit.Annotate", False },
  884. { "Options.ICS", False },
  885. /* The next two options rely on SetCmailMode being called *after* */
  886. /* SetGNUMode so that when GNU is being used to give hints these */
  887. /* menu options are still available */
  888. { "File.MailMove", False },
  889. { "File.ReloadCMailMessage", False },
  890. // [HGM] The following have been added to make a switch from ncp to GNU mode possible
  891. { "Mode.MachineWhite", True },
  892. { "Mode.MachineBlack", True },
  893. { "Mode.AnalysisMode", True },
  894. { "Mode.AnalyzeFile", True },
  895. { "Mode.TwoMachines", True },
  896. { "Mode.MachineMatch", True },
  897. { "Engine.Engine#1Settings", True },
  898. { "Engine.Engine#2Settings", True },
  899. { "Engine.Hint", True },
  900. { "Engine.Book", True },
  901. { "Engine.MoveNow", True },
  902. { "Engine.RetractMove", True },
  903. { "Action.", True },
  904. { NULL, False }
  905. };
  906. Enables cmailEnables[] = {
  907. { "Action.", True },
  908. { "Action.CallFlag", False },
  909. { "Action.Draw", True },
  910. { "Action.Adjourn", False },
  911. { "Action.Abort", False },
  912. { "Action.StopObserving", False },
  913. { "Action.StopExamining", False },
  914. { "File.MailMove", True },
  915. { "File.ReloadCMailMessage", True },
  916. { NULL, False }
  917. };
  918. Enables trainingOnEnables[] = {
  919. { "Edit.EditComment", False },
  920. { "Mode.Pause", False },
  921. { "Edit.Forward", False },
  922. { "Edit.Backward", False },
  923. { "Edit.ForwardtoEnd", False },
  924. { "Edit.BacktoStart", False },
  925. { "Engine.MoveNow", False },
  926. { "Edit.TruncateGame", False },
  927. { NULL, False }
  928. };
  929. Enables trainingOffEnables[] = {
  930. { "Edit.EditComment", True },
  931. { "Mode.Pause", True },
  932. { "Edit.Forward", True },
  933. { "Edit.Backward", True },
  934. { "Edit.ForwardtoEnd", True },
  935. { "Edit.BacktoStart", True },
  936. { "Engine.MoveNow", True },
  937. { "Engine.TruncateGame", True },
  938. { NULL, False }
  939. };
  940. Enables machineThinkingEnables[] = {
  941. { "File.LoadGame", False },
  942. // { "LoadNextGame", False },
  943. // { "LoadPreviousGame", False },
  944. // { "ReloadSameGame", False },
  945. { "Edit.PasteGame", False },
  946. { "File.LoadPosition", False },
  947. // { "LoadNextPosition", False },
  948. // { "LoadPreviousPosition", False },
  949. // { "ReloadSamePosition", False },
  950. { "Edit.PastePosition", False },
  951. { "Mode.MachineWhite", False },
  952. { "Mode.MachineBlack", False },
  953. { "Mode.TwoMachines", False },
  954. // { "MachineMatch", False },
  955. { "Engine.RetractMove", False },
  956. { NULL, False }
  957. };
  958. Enables userThinkingEnables[] = {
  959. { "File.LoadGame", True },
  960. // { "LoadNextGame", True },
  961. // { "LoadPreviousGame", True },
  962. // { "ReloadSameGame", True },
  963. { "Edit.PasteGame", True },
  964. { "File.LoadPosition", True },
  965. // { "LoadNextPosition", True },
  966. // { "LoadPreviousPosition", True },
  967. // { "ReloadSamePosition", True },
  968. { "Edit.PastePosition", True },
  969. { "Mode.MachineWhite", True },
  970. { "Mode.MachineBlack", True },
  971. { "Mode.TwoMachines", True },
  972. // { "MachineMatch", True },
  973. { "Engine.RetractMove", True },
  974. { NULL, False }
  975. };
  976. void
  977. SetICSMode ()
  978. {
  979. SetMenuEnables(icsEnables);
  980. #if ZIPPY
  981. if (appData.zippyPlay && !appData.noChessProgram) { /* [DM] icsEngineAnalyze */
  982. EnableNamedMenuItem("Mode.AnalysisMode", True);
  983. EnableNamedMenuItem("Engine.Engine#1Settings", True);
  984. }
  985. #endif
  986. }
  987. void
  988. SetNCPMode ()
  989. {
  990. SetMenuEnables(ncpEnables);
  991. }
  992. void
  993. SetGNUMode ()
  994. {
  995. SetMenuEnables(gnuEnables);
  996. }
  997. void
  998. SetCmailMode ()
  999. {
  1000. SetMenuEnables(cmailEnables);
  1001. }
  1002. void
  1003. SetTrainingModeOn ()
  1004. {
  1005. SetMenuEnables(trainingOnEnables);
  1006. if (appData.showButtonBar) {
  1007. EnableButtonBar(False);
  1008. }
  1009. CommentPopDown();
  1010. }
  1011. void
  1012. SetTrainingModeOff ()
  1013. {
  1014. SetMenuEnables(trainingOffEnables);
  1015. if (appData.showButtonBar) {
  1016. EnableButtonBar(True);
  1017. }
  1018. }
  1019. void
  1020. SetUserThinkingEnables ()
  1021. {
  1022. if (appData.noChessProgram) return;
  1023. SetMenuEnables(userThinkingEnables);
  1024. }
  1025. void
  1026. SetMachineThinkingEnables ()
  1027. {
  1028. if (appData.noChessProgram) return;
  1029. SetMenuEnables(machineThinkingEnables);
  1030. switch (gameMode) {
  1031. case MachinePlaysBlack:
  1032. case MachinePlaysWhite:
  1033. case TwoMachinesPlay:
  1034. EnableNamedMenuItem(ModeToWidgetName(gameMode), True);
  1035. break;
  1036. default:
  1037. break;
  1038. }
  1039. }
  1040. void
  1041. GreyRevert (Boolean grey)
  1042. {
  1043. MarkMenuItem("Edit.Revert", !grey);
  1044. MarkMenuItem("Edit.Annotate", !grey);
  1045. }
  1046. char *
  1047. ModeToWidgetName (GameMode mode)
  1048. {
  1049. switch (mode) {
  1050. case BeginningOfGame:
  1051. if (appData.icsActive)
  1052. return "Mode.ICSClient";
  1053. else if (appData.noChessProgram ||
  1054. *appData.cmailGameName != NULLCHAR)
  1055. return "Mode.EditGame";
  1056. else
  1057. return "Mode.MachineBlack";
  1058. case MachinePlaysBlack:
  1059. return "Mode.MachineBlack";
  1060. case MachinePlaysWhite:
  1061. return "Mode.MachineWhite";
  1062. case AnalyzeMode:
  1063. return "Mode.AnalysisMode";
  1064. case AnalyzeFile:
  1065. return "Mode.AnalyzeFile";
  1066. case TwoMachinesPlay:
  1067. return "Mode.TwoMachines";
  1068. case EditGame:
  1069. return "Mode.EditGame";
  1070. case PlayFromGameFile:
  1071. return "File.LoadGame";
  1072. case EditPosition:
  1073. return "Mode.EditPosition";
  1074. case Training:
  1075. return "Mode.Training";
  1076. case IcsPlayingWhite:
  1077. case IcsPlayingBlack:
  1078. case IcsObserving:
  1079. case IcsIdle:
  1080. case IcsExamining:
  1081. return "Mode.ICSClient";
  1082. default:
  1083. case EndOfGame:
  1084. return NULL;
  1085. }
  1086. }
  1087. void
  1088. InitMenuMarkers()
  1089. {
  1090. #ifndef OPTIONSDIALOG
  1091. if (appData.alwaysPromoteToQueen) {
  1092. MarkMenuItem("Options.Always Queen", True);
  1093. }
  1094. if (appData.animateDragging) {
  1095. MarkMenuItem("Options.Animate Dragging", True);
  1096. }
  1097. if (appData.animate) {
  1098. MarkMenuItem("Options.Animate Moving", True);
  1099. }
  1100. if (appData.autoCallFlag) {
  1101. MarkMenuItem("Options.Auto Flag", True);
  1102. }
  1103. if (appData.autoFlipView) {
  1104. XtSetValues(XtNameToWidget(menuBarWidget,"Options.Auto Flip View", True);
  1105. }
  1106. if (appData.blindfold) {
  1107. MarkMenuItem("Options.Blindfold", True);
  1108. }
  1109. if (appData.flashCount > 0) {
  1110. MarkMenuItem("Options.Flash Moves", True);
  1111. }
  1112. #if HIGHDRAG
  1113. if (appData.highlightDragging) {
  1114. MarkMenuItem("Options.Highlight Dragging", True);
  1115. }
  1116. #endif
  1117. if (appData.highlightLastMove) {
  1118. MarkMenuItem("Options.Highlight Last Move", True);
  1119. }
  1120. if (appData.highlightMoveWithArrow) {
  1121. MarkMenuItem("Options.Arrow", True);
  1122. }
  1123. // if (appData.icsAlarm) {
  1124. // MarkMenuItem("Options.ICS Alarm", True);
  1125. // }
  1126. if (appData.ringBellAfterMoves) {
  1127. MarkMenuItem("Options.Move Sound", True);
  1128. }
  1129. if (appData.oneClick) {
  1130. MarkMenuItem("Options.OneClick", True);
  1131. }
  1132. if (appData.periodicUpdates) {
  1133. MarkMenuItem("Options.Periodic Updates", True);
  1134. }
  1135. if (appData.ponderNextMove) {
  1136. MarkMenuItem("Options.Ponder Next Move", True);
  1137. }
  1138. if (appData.popupExitMessage) {
  1139. MarkMenuItem("Options.Popup Exit Message", True);
  1140. }
  1141. if (appData.popupMoveErrors) {
  1142. MarkMenuItem("Options.Popup Move Errors", True);
  1143. }
  1144. // if (appData.premove) {
  1145. // MarkMenuItem("Options.Premove", True);
  1146. // }
  1147. if (appData.showCoords) {
  1148. MarkMenuItem("Options.Show Coords", True);
  1149. }
  1150. if (appData.hideThinkingFromHuman) {
  1151. MarkMenuItem("Options.Hide Thinking", True);
  1152. }
  1153. if (appData.testLegality) {
  1154. MarkMenuItem("Options.Test Legality", True);
  1155. }
  1156. #endif
  1157. if (saveSettingsOnExit) {
  1158. MarkMenuItem("Options.SaveSettingsonExit", True);
  1159. }
  1160. }