X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xaw%2Fxoptions.c;h=5caa95a0097b1c5774769e091131d18d9766a465;hb=c093ed852cc384683f502f5b686178b33e406063;hp=8d9141e7788678d6f77963535b3c2c1af2dac9f1;hpb=df677030bcbab764120077e20f356ed244838710;p=xboard.git diff --git a/xaw/xoptions.c b/xaw/xoptions.c index 8d9141e..5caa95a 100644 --- a/xaw/xoptions.c +++ b/xaw/xoptions.c @@ -266,6 +266,22 @@ SelectedListBoxItem (Option *opt) } void +SetTextColor (char **cnames, int fg, int bg, int attr) +{ // this is not possible in Xaw +} + +void +AppendColorized (Option *opt, char *message, int count) +{ + AppendText(opt, message); +} + +void +Show (Option *opt, int hide) +{ +} + +void HighlightText (Option *opt, int start, int end, Boolean on) { if(on) @@ -292,13 +308,21 @@ SetIconName (DialogClass dlg, char *name) } static void +LabelCallback (Widget ww, XtPointer client_data, XEvent *event, Boolean *b) +{ // called on ButtonPress in label widgets with attached user handler (clocks!) + int s, data = (intptr_t) client_data; + Option *opt = dialogOptions[data >> 8] + (s = data & 255); + + if(((XButtonEvent*)event)->button != Button1) s = -s; + ((ButtonCallback*) opt->target) (s); +} + +static void CheckCallback (Widget ww, XtPointer client_data, XEvent *event, Boolean *b) { int s, data = (intptr_t) client_data; Option *opt = dialogOptions[data >> 8] + (data & 255); - if(opt->type == Label) { ((ButtonCallback*) opt->target)(data&255); return; } - GetWidgetState(opt, &s); SetWidgetState(opt, !s); } @@ -966,7 +990,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent for(h=0; hhandle, args, 1); // SetFocus(opt->handle, shells[InputBoxDlg], NULL, False); // No idea why this does not work, and the following is needed: @@ -1355,6 +1385,8 @@ TypeInProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) { // can be used as handler for any text edit in any dialog (from GenericPopUp, that is) int n = prms[0][0] - '0'; Widget sh = XtParent(XtParent(XtParent(w))); // popup shell + extern int hidden; + hidden = 0; if(n<2) { // Enter or Esc typed from primed text widget: treat as if dialog OK or cancel button hit. int dlgNr; // figure out what the dialog number is by comparing shells (because we must pass it :( ) @@ -1364,7 +1396,7 @@ TypeInProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) } void -HardSetFocus (Option *opt) +HardSetFocus (Option *opt, DialogClass dlg) { XSetInputFocus(xDisplay, XtWindow(opt->handle), RevertToPointerRoot, CurrentTime); }