X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=b3c88c442f8b01acf0f7f82cc6f53b09a932bdf8;hb=39d79ffb3def5d8ac66c02dd97245a13d89ba8eb;hp=932914efa8a5ae18088de16effebc88261d0a092;hpb=77160c21009681c3a08fbef9e9025ab7212231b3;p=xboard.git diff --git a/xoptions.c b/xoptions.c index 932914e..b3c88c4 100644 --- a/xoptions.c +++ b/xoptions.c @@ -709,8 +709,8 @@ SetPositionAndSize (Arg *args, Widget leftNeigbor, Widget topNeigbor, int b, int if(!appData.monoMode) { if(!b && appData.dialogColor[0]) XtSetArg(args[j], XtNbackground, dialogColor), j++; if(b == 3 && appData.buttonColor[0]) XtSetArg(args[j], XtNbackground, buttonColor), j++; - if(b == 3) b = 1; } + if(b == 3) b = 1; // border XtSetArg(args[j], XtNborderWidth, b); j++; return j; @@ -807,12 +807,16 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent if(option[i].type == FileName || option[i].type == PathName) w -= 55; j = SetPositionAndSize(args, dialog, last, 1 /* border */, w /* w */, option[i].type == TextBox ? option[i].value : 0 /* h */, 0x91 /* chain full width */); - if(option[i].type == TextBox && option[i].value) { // decorations for multi-line text-edits + if(option[i].type == TextBox) { // decorations for multi-line text-edits if(option[i].min & T_VSCRL) { XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; } if(option[i].min & T_HSCRL) { XtSetArg(args[j], XtNscrollHorizontal, XawtextScrollAlways); j++; } if(option[i].min & T_FILL) { XtSetArg(args[j], XtNautoFill, True); j++; } if(option[i].min & T_WRAP) { XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; } - if(option[i].min & T_TOP) { XtSetArg(args[j], XtNtop, XtChainTop); j++; } + if(option[i].min & T_TOP) { XtSetArg(args[j], XtNtop, XtChainTop); j++; + if(!option[i].value) { XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetValues(dialog, args+j-2, 2); + } + } } else shrink = TRUE; XtSetArg(args[j], XtNeditType, XawtextEdit); j++; XtSetArg(args[j], XtNuseStringInPlace, False); j++; @@ -879,7 +883,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent #if ENABLE_NLS if(option[i].choice) XtSetArg(args[j], XtNfontSet, *(XFontSet*)option[i].choice), j++; #else - if(option[i].choice) XtSetArg(args[j], XtNfont, *(XFontStruct*)option[i].choice), j++; + if(option[i].choice) XtSetArg(args[j], XtNfont, (XFontStruct*)option[i].choice), j++; #endif XtSetArg(args[j], XtNresizable, False); j++; XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; @@ -962,6 +966,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent (last = XtCreateManagedWidget("graph", widgetClass, form, args, j)); XtAddEventHandler(last, ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask, False, (XtEventHandler) GraphEventProc, option[i].target); // mandatory user-supplied expose handler + if(option[i].min & SAME_ROW) last = forelast, forelast = lastrow; break; case PopUp: // note: used only after Graph, so 'last' refers to the Graph widget option[i].handle = (void*) CreateComboPopup(last, option + i, i + 256*dlgNr, TRUE, option[i].value); @@ -1148,7 +1153,7 @@ SetInsertPos (Option *opt, int pos) XtSetArg(args[0], XtNinsertPosition, pos); XtSetValues(opt->handle, args, 1); // SetFocus(opt->handle, shells[InputBoxDlg], NULL, False); // No idea why this does not work, and the following is needed: - XSetInputFocus(xDisplay, XtWindow(opt->handle), RevertToPointerRoot, CurrentTime); +// XSetInputFocus(xDisplay, XtWindow(opt->handle), RevertToPointerRoot, CurrentTime); } void