X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=04924c76355c45bf34db53d8378c44cfdb4b6274;hb=650cb846fec03207426278a5592aa973ec45d055;hp=892ea55dd4d5d384f2c6b22aa4d85bcb4949db90;hpb=91d8e5853ca580769cc130aa6ea004869118d171;p=xboard.git diff --git a/xoptions.c b/xoptions.c index 892ea55..04924c7 100644 --- a/xoptions.c +++ b/xoptions.c @@ -1370,7 +1370,7 @@ void SettingsCallback(w, client_data, call_data) XtGetValues(currentCps->option[i].handle, args, 1); if(strcmp(currentCps->option[i].textValue, val)) { strcpy(currentCps->option[i].textValue, val); - sprintf(buf, _("option %s %s\n"), currentCps->option[i].name, val); + sprintf(buf, "option %s=%s\n", currentCps->option[i].name, val); SendToProgram(buf, currentCps); } break; @@ -1382,7 +1382,7 @@ void SettingsCallback(w, client_data, call_data) if(j < currentCps->option[i].min) j = currentCps->option[i].min; if(currentCps->option[i].value != j) { currentCps->option[i].value = j; - sprintf(buf, _("option %s %d\n"), currentCps->option[i].name, j); + sprintf(buf, "option %s=%d\n", currentCps->option[i].name, j); SendToProgram(buf, currentCps); } break; @@ -1392,14 +1392,14 @@ void SettingsCallback(w, client_data, call_data) XtGetValues(currentCps->option[i].handle, args, 1); if(currentCps->option[i].value != j) { currentCps->option[i].value = j; - sprintf(buf, _("option %s %d\n"), currentCps->option[i].name, j); + sprintf(buf, "option %s=%d\n", currentCps->option[i].name, j); SendToProgram(buf, currentCps); } break; case ComboBox: if(currentCps->option[i].value != values[i]) { currentCps->option[i].value = values[i]; - sprintf(buf, _("option %s %s\n"), currentCps->option[i].name, + sprintf(buf, "option %s=%s\n", currentCps->option[i].name, ((char**)currentCps->option[i].textValue)[values[i]]); SendToProgram(buf, currentCps); } @@ -1407,13 +1407,13 @@ void SettingsCallback(w, client_data, call_data) } } if((int)client_data) { // send save-button command to engine - sprintf(buf, _("option %s\n"), name); + sprintf(buf, "option %s\n", name); SendToProgram(buf, currentCps); } SettingsPopDown(); return; } - sprintf(buf, _("option %s\n"), name); + sprintf(buf, "option %s\n", name); SendToProgram(buf, currentCps); } @@ -1483,10 +1483,8 @@ void SettingsPopUp(ChessProgramState *cps) form = XtCreateManagedWidget(layoutName, formWidgetClass, layout, formArgs, XtNumber(formArgs)); - last = NULL; for(i=0; inrOptions; i++) { - Widget box; switch(cps->option[i].type) { case Spin: sprintf(def, "%d", cps->option[i].value); @@ -1510,16 +1508,18 @@ void SettingsPopUp(ChessProgramState *cps) edit = last; cps->option[i].handle = (void*) (last = XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j)); - XtAddEventHandler(box, ButtonPressMask, False, SetFocus, (XtPointer) popup); + XtAddEventHandler(last, ButtonPressMask, False, SetFocus, (XtPointer) popup); if(cps->option[i].type == TextBox) break; + // add increment and decrement controls for spin j=0; XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNfromHoriz, box); j++; + XtSetArg(args[j], XtNfromHoriz, last); j++; XtSetArg(args[j], XtNheight, 10); j++; XtSetArg(args[j], XtNwidth, 20); j++; edit = XtCreateManagedWidget("+", commandWidgetClass, form, args, j); XtAddCallback(edit, XtNcallback, SpinCallback, (XtPointer) i); + j=0; XtSetArg(args[j], XtNfromVert, edit); j++; XtSetArg(args[j], XtNfromHoriz, last); j++;