X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=342246cd47a4cbb93270096eae79449607eab0f5;hb=7fe9a56b2afe2dcc934b058e1a736b27a3fd003b;hp=b8a8a680a2f6d5a44f98107b7b5e1d7b0325964f;hpb=b80a07a436b0211145c915a7d79bf7c41ae891e4;p=xboard.git diff --git a/xoptions.c b/xoptions.c index b8a8a68..342246c 100644 --- a/xoptions.c +++ b/xoptions.c @@ -78,6 +78,9 @@ extern char *getenv(); # define N_(s) s #endif +extern void SendToProgram P((char *message, ChessProgramState *cps)); + + extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; extern Display *xDisplay; extern int squareSize; @@ -1473,17 +1476,20 @@ void CreateComboPopup(parent, name, n, mb) void SettingsPopUp(ChessProgramState *cps) { Arg args[16]; - Widget popup, layout, dialog, edit, form, oldform, last, b_ok, b_cancel; + Widget popup, layout, dialog, edit, form, oldform, last, b_ok, b_cancel, leftMargin = NULL; Window root, child; - int x, y, i, j; + int x, y, i, j, height, width, h, c; int win_x, win_y; unsigned int mask; char def[80], *p, *q; + static char pane[6] = "paneX"; // to do: start up second engine if needed if(!cps->initDone || !cps->nrOptions) return; // nothing to be done currentCps = cps; + if(cps->nrOptions > 50) width = 4; else if(cps->nrOptions>24) width = 2; else width = 1; + height = cps->nrOptions / width + 1; i = 0; XtSetArg(args[i], XtNresizable, True); i++; SettingsShell = popup = @@ -1493,12 +1499,20 @@ void SettingsPopUp(ChessProgramState *cps) layout = XtCreateManagedWidget(layoutName, formWidgetClass, popup, layoutArgs, XtNumber(layoutArgs)); - + for(c=0; cnrOptions; i++) { + for(h=0; h= cps->nrOptions) break; switch(cps->option[i].type) { case Spin: sprintf(def, "%d", cps->option[i].value); @@ -1586,7 +1600,7 @@ void SettingsPopUp(ChessProgramState *cps) break; } } - + } j=0; XtSetArg(args[j], XtNfromVert, last); j++; XtSetArg(args[j], XtNbottom, XtChainBottom); j++; @@ -1738,4 +1752,4 @@ void XXXMenuProc(w, event, prms, nprms) { XXXPopUp(); } -#endif \ No newline at end of file +#endif