}
Option generalOptions[] = {
-{ 0, 0, 0, NULL, (void*) &appData.alwaysPromoteToQueen, "", NULL, CheckBox, _("Always Queen") },
+{ 0, 0, 0, NULL, (void*) &appData.sweepSelect, "", NULL, CheckBox, _("Almost Always Queen (Detour Under-Promote)") },
{ 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") },
case Button:
case SaveButton:
case Label:
+ case Break:
break;
}
if(currentOption[i].type == EndMark) break;
}
option[i].handle = (void*)
(dialog = last = XtCreateManagedWidget(option[i].name, commandWidgetClass, form, args, j));
- if(option[i].choice && !currentCps) {
+ if(option[i].choice && ((char*)option[i].choice)[0] == '#' && !currentCps) {
SetColor( *(char**) option[i-1].target, last);
XtAddEventHandler(option[i-1].handle, KeyReleaseMask, False, ColorChanged, (XtPointer)(intptr_t) i-1);
}
char *icsText;
Option boxOptions[] = {
-{ 0, 20, 400, NULL, (void*) &icsText, "", NULL, TextBox, "" },
+{ 0, 30, 400, NULL, (void*) &icsText, "", NULL, TextBox, "" },
{ 0, 3, 0, NULL, NULL, "", NULL, EndMark , "" }
};
XtOverrideTranslations(boxOptions[0].handle, XtParseTranslationTable(ICSInputTranslations));
}
+void TypeInProc(w, event, prms, nprms)
+ Widget w;
+ XEvent *event;
+ String *prms;
+ Cardinal *nprms;
+{
+ Arg args[2];
+ String val;
+
+ if(prms[0][0] == '1') {
+ XtSetArg(args[0], XtNstring, &val);
+ XtGetValues(boxOptions[0].handle, args, 1);
+ TypeInDoneEvent((char*)val);
+ }
+ PopDown(0);\r
+}
+
+char moveTypeInTranslations[] =
+ "<Key>Return: TypeInProc(1) \n"
+ "<Key>Escape: TypeInProc(0) \n";
+
+void PopUpMoveDialog(char firstchar)
+{
+ static char buf[2];
+ buf[0] = firstchar; icsText = buf;
+ if(GenericPopUp(boxOptions, _("Type a move"), 0))
+ XtOverrideTranslations(boxOptions[0].handle, XtParseTranslationTable(moveTypeInTranslations));
+}
+
+void MoveTypeInProc(Widget widget, caddr_t unused, XEvent *event)
+{
+ char buf[10], keys[32];
+ KeySym sym;
+ KeyCode metaL, metaR;
+ int n = XLookupString(&(event->xkey), buf, 10, &sym, NULL);
+ XQueryKeymap(xDisplay,keys);
+ metaL = XKeysymToKeycode(xDisplay, XK_Meta_L);
+ metaR = XKeysymToKeycode(xDisplay, XK_Meta_R);
+ if ( n == 1 && *buf > 32 && !(keys[metaL>>3]&1<<(metaL&7)) && !(keys[metaR>>3]&1<<(metaR&7))) // printable, no alt
+ PopUpMoveDialog(*buf);
+
+}
+
void
SettingsPopUp(ChessProgramState *cps)
{