X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xaw%2Fxoptions.c;h=1eb4965aef6fb4dcb679574d94e6d2f37eb641ee;hb=f94596a352d0d54c8214ddf2cbc98bdc7eace640;hp=91baa04df6b9088f7a5b55dc892e02fe2898047c;hpb=c37d45adc7d98a702a7459ccdc0ac23df01a476e;p=xboard.git diff --git a/xaw/xoptions.c b/xaw/xoptions.c index 91baa04..1eb4965 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) @@ -333,7 +349,7 @@ SpinCallback (Widget w, XtPointer client_data, XtPointer call_data) if(--j < opt->min) return; } else return; snprintf(buf, MSG_SIZ, "%d", j); - SetWidgetText(opt, buf, TransientDlg); + SetWidgetText(opt, buf, shellUp[TransientDlg] ? TransientDlg : MasterDlg); } static void @@ -626,7 +642,8 @@ GenericPopDown (Widget w, XEvent *event, String *prms, Cardinal *nprms) { // to cause popdown through a translation (Delete Window button!) int dlg = atoi(prms[0]); Widget sh = shells[dlg]; - if(shellUp[BrowserDlg] && dlg != BrowserDlg || dialogError) return; // prevent closing dialog when it has an open file-browse daughter + if(shellUp[BrowserDlg] && dlg != BrowserDlg || dialogError || dlg == MasterDlg && shellUp[TransientDlg]) + return; // prevent closing dialog when it has an open file-browse or transient daughter shells[dlg] = w; PopDown(dlg); shells[dlg] = sh; // restore @@ -920,6 +937,7 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent shellUp[dlgNr] = True; return 0; } + if(dlgNr == TransientDlg && parent == BoardWindow && shellUp[MasterDlg]) parent = MasterDlg; // MasterDlg can always take role of main window dialogOptions[dlgNr] = option; // make available to callback // post currentOption globally, so Spin and Combo callbacks can already use it @@ -964,7 +982,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: @@ -1353,6 +1377,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 :( ) @@ -1362,7 +1388,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); }