X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=b3bea5af144e3dec711e422a6d16583fb70c4914;hb=f23961e675c1fb441ebb3392ff21f47c6db1c941;hp=bf1ff104ea797715f93c4f5bed03604f7a71e0a3;hpb=997b54f179fb1834d738042a9b6c4ec1cefe8c6b;p=xboard.git diff --git a/xoptions.c b/xoptions.c index bf1ff10..b3bea5a 100644 --- a/xoptions.c +++ b/xoptions.c @@ -74,6 +74,7 @@ extern char *getenv(); #include "common.h" #include "backend.h" #include "xboard.h" +#include "xboard2.h" #include "dialogs.h" #include "menus.h" #include "gettext.h" @@ -143,6 +144,18 @@ static Arg formArgs[] = { }; void +MarkMenuItem (char *menuRef, int state) +{ + MenuItem *item = MenuNameToItem(menuRef); + + if(item) { + Arg args[2]; + XtSetArg(args[0], XtNleftBitmap, state ? xMarkPixmap : None); + XtSetValues(item->handle, args, 1); + } +} + +void GetWidgetText (Option *opt, char **buf) { Arg arg; @@ -551,10 +564,14 @@ GraphEventProc(Widget widget, caddr_t client_data, XEvent *event) XtSetArg(args[j], XtNwidth, &w); j++; XtSetArg(args[j], XtNheight, &h); j++; XtGetValues(widget, args, j); + if(w < graph->max || w > graph->max + 1 || h != graph->value) { // use width fudge of 1 pixel - sizing = (((XExposeEvent*)event)->count >= 0); // suppress sizing on ordered redraw in response to sizing. - graph->max = w; graph->value = h; // note: old values are kept if we we don't exceed width fudge - } + if(((XExposeEvent*)event)->count >= 0) { // suppress sizing on expose for ordered redraw in response to sizing. + sizing = 1; + graph->max = w; graph->value = h; // note: old values are kept if we we don't exceed width fudge + } + } else w = graph->max; + if(sizing && ((XExposeEvent*)event)->count > 0) { graph->max = 0; return; } // don't bother if further exposure is pending during resize if(!graph->textValue || sizing) { // create surfaces of new size for display widget if(graph->textValue) cairo_surface_destroy((cairo_surface_t *)graph->textValue); @@ -777,7 +794,6 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent if(engineDlg) { // Settings popup for engine: format through heuristic int n = currentCps->nrOptions; - if(!n) { DisplayNote(_("Engine has no options")); currentCps = NULL; return 0; } if(n > 50) width = 4; else if(n>24) width = 2; else width = 1; height = n / width + 1; if(n && (currentOption[n-1].type == Button || currentOption[n-1].type == SaveButton)) currentOption[n].min = SAME_ROW; // OK on same line