void EngineMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
void UciMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
void TimeControlProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
+void OptionsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
void NewVariantProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
void FirstSettingsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
void SecondSettingsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
};
MenuItem optionsMenu[] = {
+#define OPTIONSDIALOG
+#ifdef OPTIONSDIALOG
+ {N_("General ..."), "General", OptionsProc},
+#endif
{N_("Time Control ... Alt+Shift+T"), "Time Control", TimeControlProc},
{N_("Common Engine ... Alt+Shift+U"), "Common Engine", UciMenuProc},
{N_("Adjudications ... Alt+Shift+J"), "Adjudications", EngineMenuProc},
{N_("Game List ..."), "Game List", GameListOptionsPopUp},
{N_("Sounds ..."), "Sounds", SoundOptionsProc},
{"----", NULL, NothingProc},
+#ifndef OPTIONSDIALOG
{N_("Always Queen Ctrl+Shift+Q"), "Always Queen", AlwaysQueenProc},
{N_("Animate Dragging"), "Animate Dragging", AnimateDraggingProc},
{N_("Animate Moving Ctrl+Shift+A"), "Animate Moving", AnimateMovingProc},
{N_("Hide Thinking Ctrl+Shift+H"), "Hide Thinking", HideThinkingProc},
{N_("Test Legality Ctrl+Shift+L"), "Test Legality", TestLegalityProc},
{"----", NULL, NothingProc},
+#endif
{N_("Save Settings Now"), "Save Settings Now", SaveSettingsProc},
{N_("Save Settings on Exit"), "Save Settings on Exit", SaveOnExitProc},
{NULL, NULL, NULL}
{ "EngineMenuProc", (XtActionProc) EngineMenuProc },
{ "UciMenuProc", (XtActionProc) UciMenuProc },
{ "TimeControlProc", (XtActionProc) TimeControlProc },
+ { "FlipViewProc", FlipViewProc },
+ { "PonderNextMoveProc", PonderNextMoveProc },
+#ifndef OPTIONSDIALOG
{ "AlwaysQueenProc", AlwaysQueenProc },
{ "AnimateDraggingProc", AnimateDraggingProc },
{ "AnimateMovingProc", AnimateMovingProc },
{ "AutoflipProc", AutoflipProc },
{ "BlindfoldProc", BlindfoldProc },
{ "FlashMovesProc", FlashMovesProc },
- { "FlipViewProc", FlipViewProc },
#if HIGHDRAG
{ "HighlightDraggingProc", HighlightDraggingProc },
#endif
// { "IcsAlarmProc", IcsAlarmProc },
{ "MoveSoundProc", MoveSoundProc },
{ "PeriodicUpdatesProc", PeriodicUpdatesProc },
- { "PonderNextMoveProc", PonderNextMoveProc },
{ "PopupExitMessageProc", PopupExitMessageProc },
{ "PopupMoveErrorsProc", PopupMoveErrorsProc },
// { "PremoveProc", PremoveProc },
{ "ShowThinkingProc", ShowThinkingProc },
{ "HideThinkingProc", HideThinkingProc },
{ "TestLegalityProc", TestLegalityProc },
+#endif
{ "SaveSettingsProc", SaveSettingsProc },
{ "SaveOnExitProc", SaveOnExitProc },
{ "InfoProc", InfoProc },
:Meta<Key>J: EngineMenuProc() \n \
:Meta<Key>U: UciMenuProc() \n \
:Meta<Key>T: TimeControlProc() \n \
+ :Ctrl<Key>P: PonderNextMoveProc() \n "
+#ifndef OPTIONSDIALOG
+ "\
:Ctrl<Key>Q: AlwaysQueenProc() \n \
:Ctrl<Key>F: AutoflagProc() \n \
:Ctrl<Key>A: AnimateMovingProc() \n \
- :Ctrl<Key>P: PonderNextMoveProc() \n \
:Ctrl<Key>L: TestLegalityProc() \n \
- :Ctrl<Key>H: HideThinkingProc() \n \
+ :Ctrl<Key>H: HideThinkingProc() \n "
+#endif
+ "\
:<Key>-: Iconify() \n \
:<Key>F1: ManProc() \n \
:<Key>F2: FlipViewProc() \n \
ReadBitmap(&xMarkPixmap, "checkmark.bm",
checkmark_bits, checkmark_width, checkmark_height);
XtSetArg(args[0], XtNleftBitmap, xMarkPixmap);
+#ifndef OPTIONSDIALOG
if (appData.alwaysPromoteToQueen) {
XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Always Queen"),
args, 1);
XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Test Legality"),
args, 1);
}
+#endif
if (saveSettingsOnExit) {
XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Save Settings on Exit"),
args, 1);
{ "menuEngine.Hint", False },
{ "menuEngine.Book", False },
{ "menuEngine.Move Now", False },
+#ifndef OPTIONSDIALOG
{ "menuOptions.Periodic Updates", False },
{ "menuOptions.Hide Thinking", False },
{ "menuOptions.Ponder Next Move", False },
+#endif
{ "menuEngine.Engine #1 Settings", False },
#endif
{ "menuEngine.Engine #2 Settings", False },
{ "menuEngine.Engine #2 Settings", False },
{ "menuEngine.Move Now", False },
{ "menuEngine.Retract Move", False },
+#ifndef OPTIONSDIALOG
{ "menuOptions.Auto Flag", False },
{ "menuOptions.Auto Flip View", False },
{ "menuOptions.ICS", False },
{ "menuOptions.Hide Thinking", False },
{ "menuOptions.Periodic Updates", False },
{ "menuOptions.Ponder Next Move", False },
+#endif
{ "menuEngine.Hint", False },
{ "menuEngine.Book", False },
{ NULL, False }
BlankSquare(x, y, square_color, piece, xBoardWindow, 1);
} else {
drawfunc = ChooseDrawFunc();
+
if (do_flash && appData.flashCount > 0) {
for (i=0; i<appData.flashCount; ++i) {
-
drawfunc(piece, square_color, x, y, xBoardWindow);
XSync(xDisplay, False);
do_flash_delay(flash_delay);
}
}
}
-
return 0;
}
if (appData.debugMode)
fprintf(debugFP, _("ICS engine analyze starting... \n"));
}
+#ifndef OPTIONSDIALOG
if (!appData.showThinking)
ShowThinkingProc(w,event,prms,nprms);
+#endif
AnalyzeModeEvent();
}
return;
}
Reset(FALSE, TRUE);
-
+#ifndef OPTIONSDIALOG
if (!appData.showThinking)
ShowThinkingProc(w,event,prms,nprms);
-
+#endif
AnalyzeFileEvent();
FileNamePopUp(_("File to analyze"), "", LoadGamePopUp, "rb");
AnalysisPeriodicEvent(1);
MoveNowEvent();
}
+void FlipViewProc(w, event, prms, nprms)
+ Widget w;
+ XEvent *event;
+ String *prms;
+ Cardinal *nprms;
+{
+ flipView = !flipView;
+ DrawPosition(True, NULL);
+}
+
+void PonderNextMoveProc(w, event, prms, nprms)
+ Widget w;
+ XEvent *event;
+ String *prms;
+ Cardinal *nprms;
+{
+ Arg args[16];
+
+ PonderNextMoveEvent(!appData.ponderNextMove);
+#ifndef OPTIONSDIALOG
+ if (appData.ponderNextMove) {
+ XtSetArg(args[0], XtNleftBitmap, xMarkPixmap);
+ } else {
+ XtSetArg(args[0], XtNleftBitmap, None);
+ }
+ XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Ponder Next Move"),
+ args, 1);
+#endif
+}
+#ifndef OPTIONSDIALOG
void AlwaysQueenProc(w, event, prms, nprms)
Widget w;
XEvent *event;
args, 1);
}
-void FlipViewProc(w, event, prms, nprms)
- Widget w;
- XEvent *event;
- String *prms;
- Cardinal *nprms;
-{
- flipView = !flipView;
- DrawPosition(True, NULL);
-}
-
#if HIGHDRAG
void HighlightDraggingProc(w, event, prms, nprms)
Widget w;
args, 1);
}
-void PonderNextMoveProc(w, event, prms, nprms)
- Widget w;
- XEvent *event;
- String *prms;
- Cardinal *nprms;
-{
- Arg args[16];
-
- PonderNextMoveEvent(!appData.ponderNextMove);
-
- if (appData.ponderNextMove) {
- XtSetArg(args[0], XtNleftBitmap, xMarkPixmap);
- } else {
- XtSetArg(args[0], XtNleftBitmap, None);
- }
- XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Ponder Next Move"),
- args, 1);
-}
-
void PopupExitMessageProc(w, event, prms, nprms)
Widget w;
XEvent *event;
XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Hide Thinking"),
args, 1);
}
+#endif
void SaveOnExitProc(w, event, prms, nprms)
Widget w;
// cloned from Engine Settings dialog
+#define CURR -2000000000 /* indicates control should start at actual value of target */
+
typedef void ButtonCallback(int n);
char *trialSound;
void CreateXPMPieces P((void));
void GenericReadout();
+void GeneralOptionsOK(int n)
+{
+ int newPonder = appData.ponderNextMove;
+ appData.ponderNextMove = oldPonder;
+ PonderNextMoveEvent(newPonder);
+}
+
+Option generalOptions[] = {
+{ 0, 0, 0, NULL, (void*) &appData.alwaysPromoteToQueen, "", NULL, CheckBox, _("Always Queen") },
+{ 0, 0, 0, NULL, (void*) &appData.animateDragging, "", NULL, CheckBox, _("Animate Dragging") },
+{ 0, 0, 0, NULL, (void*) &appData.animate, "", NULL, CheckBox, _("Animate Moving") },
+{ 0, 0, 0, NULL, (void*) &appData.autoCallFlag, "", NULL, CheckBox, _("Auto Flag") },
+{ 0, 0, 0, NULL, (void*) &appData.autoFlipView, "", NULL, CheckBox, _("Auto Flip View") },
+{ 0, 0, 0, NULL, (void*) &appData.blindfold, "", NULL, CheckBox, _("Blindfold") },
+{ 0, 0, 0, NULL, (void*) &appData.dropMenu, "", NULL, CheckBox, _("Drop Menu") },
+{ 0, 0, 0, NULL, (void*) &appData.highlightDragging, "", NULL, CheckBox, _("Highlight Dragging (Show Move Targets)") },
+{ 0, 0, 0, NULL, (void*) &appData.highlightLastMove, "", NULL, CheckBox, _("Highlight Last Move") },
+{ 0, 0, 0, NULL, (void*) &appData.highlightMoveWithArrow, "", NULL, CheckBox, _("Highlight with Arrow") },
+{ 0, 0, 0, NULL, (void*) &appData.ringBellAfterMoves, "", NULL, CheckBox, _("Move Sound") },
+{ 0, 0, 0, NULL, (void*) &appData.oneClick, "", NULL, CheckBox, _("One-Click Moving") },
+{ 0, 0, 0, NULL, (void*) &appData.periodicUpdates, "", NULL, CheckBox, _("Periodic Updates (in Analysis Mode)") },
+{ 0, 0, 0, NULL, (void*) &appData.ponderNextMove, "", NULL, CheckBox, _("Ponder Next Move") },
+{ 0, 0, 0, NULL, (void*) &appData.popupExitMessage, "", NULL, CheckBox, _("Popup Exit Messages") },
+{ 0, 0, 0, NULL, (void*) &appData.popupMoveErrors, "", NULL, CheckBox, _("Popup Move Errors") },
+{ 0, 0, 0, NULL, (void*) &appData.showCoords, "", NULL, CheckBox, _("Show Coordinates") },
+{ 0, 0, 0, NULL, (void*) &appData.markers, "", NULL, CheckBox, _("Show Target Squares") },
+{ 0, 0, 0, NULL, (void*) &appData.hideThinkingFromHuman, "", NULL, CheckBox, _("Hide Thinking from Human") },
+{ 0, 0, 0, NULL, (void*) &appData.testLegality, "", NULL, CheckBox, _("Test Legality") },
+{ 0, 0, 10, NULL, (void*) &appData.flashCount, "", NULL, Spin, _("Flash Moves (0 = no flashing):") },
+{ 0, 1, 10, NULL, (void*) &appData.flashRate, "", NULL, Spin, _("Flash Rate (high = fast):") },
+{ 0, 5, 100,NULL, (void*) &appData.animSpeed, "", NULL, Spin, _("Animation Speed (high = slow):") },
+{ 0, 0, 0, NULL, (void*) &GeneralOptionsOK, "", NULL, EndMark , "" }
+};
+
void Pick(int n)
{
VariantClass v = currentOption[n].value;
GenericPopUp(variantDescriptors, _("New Variant"));
}
+void OptionsProc(w, event, prms, nprms)
+ Widget w;
+ XEvent *event;
+ String *prms;
+ Cardinal *nprms;
+{
+ oldPonder = appData.ponderNextMove;
+ GenericPopUp(generalOptions, _("General Options"));
+}
+
//---------------------------- Chat Windows ----------------------------------------------
void OutputChatMessage(int partner, char *mess)