2 * New (WinBoard-style) Move history for XBoard
4 * Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
5 * ------------------------------------------------------------------------
7 * GNU XBoard is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or (at
10 * your option) any later version.
12 * GNU XBoard is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see http://www.gnu.org/licenses/.
20 * ------------------------------------------------------------------------
21 ** See the file ChangeLog for a revision history. */
36 # define _(s) gettext (s)
37 # define N_(s) gettext_noop (s)
43 // templates for calls into back-end (= history.c; should be moved to history.h header shared with it!)
44 void RefreshMemoContent P((void));
45 void MemoContentUpdated P((void));
47 // variables in xoptions.c
48 extern Option historyOptions[];
50 // ------------- low-level front-end actions called by MoveHistory back-end -----------------
55 SetWidgetText(&historyOptions[0], "", HistoryDlg);
58 // the bold argument says 0 = normal, 1 = bold typeface
59 // the colorNr argument says 0 = font-default, 1 = gray
61 AppendToHistoryMemo (char * text, int bold, int colorNr)
63 return AppendText(&historyOptions[0], text); // for now ignore bold & color stuff, as Xaw cannot handle that
68 Option historyOptions[] = {
69 { 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 400, NULL, (void*) &historyText, "", NULL, TextBox, "" },
70 { 0, NO_OK, 0, NULL, (void*) NULL, "", NULL, EndMark , "" }
73 // ------------ standard entry points into MoveHistory code -----------
78 return shellUp[HistoryDlg];
82 MoveHistoryDialogExists ()
84 return DialogExists(HistoryDlg);
90 if(GenericPopUp(historyOptions, _("Move list"), HistoryDlg, BoardWindow, NONMODAL, 1))
91 AddHandler(&historyOptions[0], 0);
92 MarkMenu("View.MoveHistory", HistoryDlg);
98 if (!shellUp[HistoryDlg]) {
99 ASSIGN(historyText, "");
101 RefreshMemoContent();
102 MemoContentUpdated();
103 } else PopDown(HistoryDlg);
104 ToNrEvent(currentMove);