X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=9bbd805054bd9ca0ee00a8ed11099341be857e4b;hb=bf368bef696bee3555a370ac8ff88418e1f5c498;hp=22737c1f642d614a14045c72a648bfb0fbfbf9da;hpb=21b2748b7e01ca15af0c2dce7102df401dc2666f;p=xboard.git diff --git a/xoptions.c b/xoptions.c index 22737c1..9bbd805 100644 --- a/xoptions.c +++ b/xoptions.c @@ -78,6 +78,8 @@ 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; @@ -1065,7 +1067,21 @@ void NewVariantPopUp() b_ok= XtCreateManagedWidget(_(" OK "), commandWidgetClass, form, args, j); XtAddCallback(b_ok, XtNcallback, NewVariantCallback, (XtPointer) 0); - XtRealizeWidget(popup); + j=0; + XtSetArg(args[j], XtNfromVert, buttonDesc[14].handle); j++; +// XtSetArg(args[j], XtNheight, 70); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNlabel, _("WARNING: variants with un-orthodox\n" + "pieces only have built-in bitmaps\n" + "for -boardSize middling, bulky and\n" + "petite, and substitute king or amazon\n" + "for missing bitmaps. (See manual.)")); j++; + XtCreateManagedWidget("warning", labelWidgetClass, form, args, j); + + XtRealizeWidget(popup); CatchDeleteWindow(popup, "NewVariantPopDown"); XQueryPointer(xDisplay, xBoardWindow, &root, &child, @@ -1459,18 +1475,21 @@ 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=NULL, 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; - i = 0; + 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 = XtCreatePopupShell(_("Settings Menu"), transientShellWidgetClass, @@ -1479,12 +1498,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); @@ -1572,7 +1599,7 @@ void SettingsPopUp(ChessProgramState *cps) break; } } - + } j=0; XtSetArg(args[j], XtNfromVert, last); j++; XtSetArg(args[j], XtNbottom, XtChainBottom); j++; @@ -1600,7 +1627,7 @@ void SettingsPopUp(ChessProgramState *cps) SettingsUp = True; previous = NULL; - SetFocus(edit, popup, (XEvent*) NULL, False); + if(edit)SetFocus(edit, popup, (XEvent*) NULL, False); } void FirstSettingsProc(w, event, prms, nprms) @@ -1621,6 +1648,13 @@ void SecondSettingsProc(w, event, prms, nprms) SettingsPopUp(&second); } +//---------------------------- Chat Windows ---------------------------------------------- + +void OutputChatMessage(int partner, char *mess) +{ + return; // dummy +} + //--------------------------- General Popup for Cloning ---------------------------------- #if 0 int XXXUp; @@ -1725,4 +1759,3 @@ void XXXMenuProc(w, event, prms, nprms) XXXPopUp(); } #endif -