diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2004-06-08 02:44:35 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2004-06-08 02:44:35 +0000 |
commit | a5c5bd828d0a89ab979ad122c40073e8985e5e6e (patch) | |
tree | 51878d6ebb18fdf875cdceffad908b4caa4009a6 | |
parent | b041343bcf05fdf5ce4234655c869251b3f8fafa (diff) |
Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=668 - Add print
support to xman
-rw-r--r-- | XMore.ad | 118 | ||||
-rw-r--r-- | print.c | 53 | ||||
-rw-r--r-- | printdialog.c | 79 |
3 files changed, 120 insertions, 130 deletions
@@ -35,32 +35,94 @@ *printshell*background: white ! Print dialog -*printdialogshell*geometry: 600x120 -*printdialogshell*setup*geometry: 600x400 -*printdialogshell*printerselection*geometry: 400x150 -*printdialog*main*ok.tip: Print -*printdialog*main*cancel.tip: Cancel printing -*printdialog*main*setup.tip: Configure printer options (page size, orientation, etc.) -*printdialog*main*desclabel.tip: Short description of printer -*printdialog*main*desc.tip: Short description of printer -*printdialog*main*info.tip: Display additional information about this printer -*printdialog*main*namelabel.tip: Name of selected printer -*printdialog*main*name.tip: Name of selected printer -*printdialog*main*selectprinter.tip: Select a different printer -*printdialog*main*filenamelabel.tip: File where the output should be stored -*printdialog*main*filename.tip: File where the output should be stored -*printdialog*main*selectfile.tip: Select file where the output should be stored -*printdialog*main*printtoprinter.tip: Send print job to printer -*printdialog*main*printtofile.tip: Save print job in a file -*printdialog*setup*ok.tip: Commit changes -*printdialog*setup*cancel.tip: Cancel and reset to defaults -*printdialog*setup*paperlist.tip: Select paper size -*printdialog*setup*resolutionlist.tip: Select page resolution -*printdialog*setup*orientationlist.tip: Select page orientation -*printdialog*setup*plexlist.tip: Select page plex mode (simplex, duplex, etc.) -*printdialog*setup*jobcopieslabel.tip: Set number of job copies -*printdialog*setup*jobcopies.tip: Set number of job copies -*printdialog*printerselection*ok.tip: Switch printer -*printdialog*printerselection*cancel.tip: Cancel printer selection -*printdialog*printerselection*list.tip: Select printer name from list +*printdialogshell*geometry: 600x120 +*printdialogshell*title: Print +*printdialogshell*main*ok.fromVert: innerform +*printdialogshell*main*ok.label: Print +*printdialogshell*main*ok.tip: Print +*printdialogshell*main*setup.fromHoriz: ok +*printdialogshell*main*setup.fromVert: innerform +*printdialogshell*main*setup.label: Setup... +*printdialogshell*main*setup.tip: Configure print job options (page size, orientation, etc.) +*printdialogshell*main*cancel.fromHoriz: setup +*printdialogshell*main*cancel.fromVert: innerform +*printdialogshell*main*cancel.label: Cancel +*printdialogshell*main*cancel.tip: Cancel printing +*printdialogshell*main*desclabel.label: Printer Description: +*printdialogshell*main*desclabel.tip: Short description of printer +*printdialogshell*main*desc.fromHoriz: desclabel +*printdialogshell*main*desc.tip: Short description of printer +*printdialogshell*main*info.fromHoriz: desc +*printdialogshell*main*info.label: Printer info... +*printdialogshell*main*info.tip: Display additional information about this printer +*printdialogshell*main*namelabel.fromVert: desclabel +*printdialogshell*main*namelabel.label: Printer Name: +*printdialogshell*main*namelabel.tip: Name of selected printer +*printdialogshell*main*name.fromHoriz: namelabel +*printdialogshell*main*name.fromVert: desclabel +*printdialogshell*main*name.tip: Name of selected printer +*printdialogshell*main*selectprinter.fromHoriz: name +*printdialogshell*main*selectprinter.fromVert: desclabel +*printdialogshell*main*selectprinter.label: Select Printer... +*printdialogshell*main*selectprinter.label: Select Printer... +*printdialogshell*main*selectprinter.tip: Select a different printer +*printdialogshell*main*filenamelabel.fromVert: namelabel +*printdialogshell*main*filenamelabel.label: File Name: +*printdialogshell*main*filenamelabel.tip: File where the output should be stored +*printdialogshell*main*filename.fromHoriz: filenamelabel +*printdialogshell*main*filename.fromVert: namelabel +*printdialogshell*main*filename.tip: File where the output should be stored +*printdialogshell*main*selectfile.fromHoriz: filename +*printdialogshell*main*selectfile.fromVert: namelabel +*printdialogshell*main*selectfile.label: Select File... +*printdialogshell*main*selectfile.tip: Select file where the output should be stored +*printdialogshell*main*printtoprinter.fromVert: filenamelabel +*printdialogshell*main*printtoprinter.label: Print to Printer +*printdialogshell*main*printtoprinter.tip: Send print job to printer +*printdialogshell*main*printtofile.fromVert: filenamelabel +*printdialogshell*main*printtofile.fromHoriz: printtoprinter +*printdialogshell*main*printtofile.label: Print to File +*printdialogshell*main*printtofile.tip: Save print job in a file + +! Print job options dialog +*printdialogshell*setup*geometry: 600x400 +*printdialogshell*setup*title: Print: Print job options +*printdialogshell*setup*ok.fromVert: list +*printdialogshell*setup*ok.label: OK +*printdialogshell*setup*ok.tip: Commit changes +*printdialogshell*setup*cancel.fromHoriz: ok +*printdialogshell*setup*cancel.fromVert: list +*printdialogshell*setup*cancel.label: Cancel +*printdialogshell*setup*cancel.tip: Cancel and reset to defaults +*printdialogshell*setup*paperlist.tip: Select paper size +*printdialogshell*setup*resolutionlist.fromHoriz: paperlist +*printdialogshell*setup*resolutionlist.tip: Select page resolution +*printdialogshell*setup*orientationlist.fromHoriz: resolutionlist +*printdialogshell*setup*orientationlist.tip: Select page orientation +*printdialogshell*setup*plexlist.fromHoriz: orientationlist +*printdialogshell*setup*plexlist.tip: Select page plex mode (simplex, duplex, etc.) +*printdialogshell*setup*jobcopieslabel.fromVert: paperlist +*printdialogshell*setup*jobcopieslabel.tip: Set number of job copies +*printdialogshell*setup*jobcopieslabel.label: Job Copies: +*printdialogshell*setup*jobcopies.fromHoriz: jobcopieslabel +*printdialogshell*setup*jobcopies.fromVert: paperlist +*printdialogshell*setup*jobcopies.tip: Set number of job copies + +! Printer selection +*printdialogshell*printerselection*geometry: 400x150 +*printdialogshell*printerselection*title: Print: Select printer +*printdialogshell*printerselection*ok.fromVert: list +*printdialogshell*printerselection*ok.label: OK +*printdialogshell*printerselection*ok.tip: Switch printer +*printdialogshell*printerselection*cancel.fromHoriz: ok +*printdialogshell*printerselection*cancel.fromVert: list +*printdialogshell*printerselection*cancel.label: Cancel +*printdialogshell*printerselection*cancel.tip: Cancel printer selection +*printdialogshell*printerselection*list.tip: Select printer name from list + +! Select job file +*printdialogshell*selectfile*geometry: 400x80 +*printdialogshell*selectfile*title: Print: Select job file +*printdialogshell*selectfile*dialog.label: Select Filename: + ! EOF. @@ -39,8 +39,6 @@ in this Software without prior written authorization from The Open Group. #include <stdio.h> #include <stdlib.h> -#define PRINT_PAGEHEADER 1 - static Widget CreatePrintShell(Widget videoshell, Screen *pscreen, @@ -131,22 +129,10 @@ long CountPages(Widget textWidget) /* ... and move to the top of the file... */ XtCallActionProc(textWidget, "beginning-of-file", NULL, NULL, 0); - - return numpages; -} - -static -int GetCurrPageNum(Widget printshell) -{ - Cardinal n; - Arg args[2]; - int pagenum = -666; /* bah! */ - n = 0; - XtSetArg(args[n], XawNcurrPageNumInJob, &pagenum); n++; - XtGetValues(printshell, args, n); + Log(("CountPages() found %ld pages.\n", numpages)) - return pagenum; + return numpages; } static void @@ -159,12 +145,13 @@ PageSetupCB(Widget widget, XtPointer client_data, XtPointer call_data) Log(("--> PageSetupCB\n")); if (!psp->last_page_in_job) { - int currpage = GetCurrPageNum(pshell); -#ifdef PRINT_PAGEHEADER - char buffer[256]; + int currpage; + char buffer[256]; + + XtVaGetValues(pshell, XawNcurrPageNumInJob, &currpage, NULL); + sprintf(buffer, "Title: %s / Page: %d/%d", p->jobtitle, currpage, p->numpages); XtVaSetValues(apd->content.pageheaderlabel, XtNlabel, buffer, NULL); -#endif /* PRINT_PAGEHEADER */ /* Note: XawPrintShell's pagecount starts with '1' * (=first page is page no. '1') */ @@ -213,7 +200,7 @@ void FinishPrinting(AppPrintData *p) /* ... and then get rid of the display */ if (p->pcontext != None) { - XpDestroyContext(p->pdpy, p->pcontext); + XpDestroyContext(p->pdpy, p->pcontext); } XtCloseDisplay(p->pdpy); @@ -245,15 +232,21 @@ XFontSet GetPrintTextFontSet(const char *appname, Display *pdpy, long dpi) int missing_charset_count_return; char *def_string_return; int i; - long font_size; - - /* Scale font size with DPI */ - font_size = (40L * dpi) / 300L; - sprintf(fontname, "-adobe-courier-medium-r-normal--%ld-*-%ld-%ld-*-*," - "-*-*-*-*-*-*-%ld-*-%ld-%ld-*-*", - font_size, dpi, dpi, - font_size, dpi, dpi); + sprintf(fontname, /* Default font for CDE */ + "-dt-interface user-medium-r-normal-s*-*-120-%ld-%ld-*-*," + /* Default font */ + "-adobe-courier-medium-r-normal--*-120-%ld-%ld-*-*," + /* Default font for Linux/Japanese locales (ja_JP.SJIS) */ + "-watanabe-mincho-medium-r-normal--*-120-%ld-%ld-*-*," + "-wadalab-gothic-medium-r-normal--*-120-%ld-%ld-*-*," + /* Fallback */ + "-*-*-*-*-*--*-120-%ld-%ld-*-*", + dpi, dpi, + dpi, dpi, + dpi, dpi, + dpi, dpi, + dpi, dpi); fontset = XCreateFontSet(pdpy, fontname, &missing_charset_list_return, &missing_charset_count_return, @@ -322,7 +315,6 @@ void DoPrintTextSource(const char *programname, textfontset = GetPrintTextFontSet(apd->programname, pdpy, dpi); -#ifdef PRINT_PAGEHEADER n = 0; XtSetArg(args[n], XtNinternational, True); n++; XtSetArg(args[n], XtNfromHoriz, NULL); n++; @@ -334,7 +326,6 @@ void DoPrintTextSource(const char *programname, XtSetArg(args[n], XtNlabel, "Page: n/n"); n++; XtSetArg(args[n], XtNjustify, XtJustifyRight); n++; apd->content.pageheaderlabel = XtCreateManagedWidget("pageinfo", labelWidgetClass, apd->content.form, args, n); -#endif /* PRINT_PAGEHEADER */ font_extents = XExtentsOfFontSet(textfontset); diff --git a/printdialog.c b/printdialog.c index 8d31020..615734f 100644 --- a/printdialog.c +++ b/printdialog.c @@ -53,7 +53,11 @@ in this Software without prior written authorization from The Open Group. #define Error(x) { printf x ; exit(EXIT_FAILURE); } #define Assertion(expr, msg) { if (!(expr)) { Error msg } } -#define Log(x) { if(True) printf x; } +#ifdef DEBUG +# define Log(x) { if(True) printf x; } +#else +# define Log(x) { if(False) printf x; } +#endif /* DEBUG */ /* Local prototypes */ static void do_beep(PrintDialogWidget pdw); @@ -304,7 +308,7 @@ printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData) printSetupClose(pdw); if (pdp->cancel_callback) { - Log(("printCancelXtProc: calling callback")); + Log(("printCancelXtProc: calling callback\n")); XtCallCallbackList((Widget)pdw, pdp->cancel_callback, NULL); } } @@ -323,7 +327,7 @@ printDialogDestXtProc(Widget w, XtPointer client_data, XtPointer callData) } else { - Log(("printDialogDestXtProc: ERROR: Unknown widget.")); + Log(("printDialogDestXtProc: ERROR: Unknown widget.\n")); } updateWidgetStates(pdw); @@ -430,7 +434,6 @@ void buildFileDialog(PrintDialogWidget pdw) (Widget)pdw, NULL, 0); n = 0; XtSetArg(args[n], XtNvalue, pdp->filename?pdp->filename:""); n++; - XtSetArg(args[n], XtNlabel, "Select Filename:"); n++; pdp->selectFile.dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, pdp->selectFile.shell, args, n); XawDialogAddButton(pdp->selectFile.dialog, "Accept", printFileSelectedXtProc, pdw); @@ -609,8 +612,6 @@ Widget buildPrintSetupDialog(PrintDialogWidget pdw) XtSetArg(args[n], XtNresizable, True); n++; XtSetArg(args[n], XtNforceColumns, True); n++; XtSetArg(args[n], XtNdefaultColumns, 1); n++; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNsensitive, canChangePaperSize); n++; XtSetArg(args[n], XtNlist, pdp->widget_paperlist); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; @@ -620,8 +621,6 @@ Widget buildPrintSetupDialog(PrintDialogWidget pdw) XtSetArg(args[n], XtNresizable, True); n++; XtSetArg(args[n], XtNforceColumns, True); n++; XtSetArg(args[n], XtNdefaultColumns, 1); n++; - XtSetArg(args[n], XtNfromHoriz, pdp->setup.paperlist); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNsensitive, canChangeResolution); n++; XtSetArg(args[n], XtNlist, pdp->widget_resolutionlist); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; @@ -631,8 +630,6 @@ Widget buildPrintSetupDialog(PrintDialogWidget pdw) XtSetArg(args[n], XtNresizable, True); n++; XtSetArg(args[n], XtNforceColumns, True); n++; XtSetArg(args[n], XtNdefaultColumns, 1); n++; - XtSetArg(args[n], XtNfromHoriz, pdp->setup.resolutionlist); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNsensitive, canChangeOrientation); n++; XtSetArg(args[n], XtNlist, pdp->widget_orientationlist); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; @@ -642,27 +639,20 @@ Widget buildPrintSetupDialog(PrintDialogWidget pdw) XtSetArg(args[n], XtNresizable, True); n++; XtSetArg(args[n], XtNforceColumns, True); n++; XtSetArg(args[n], XtNdefaultColumns, 1); n++; - XtSetArg(args[n], XtNfromHoriz, pdp->setup.orientationlist); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNsensitive, canChangePlex); n++; XtSetArg(args[n], XtNlist, pdp->widget_plexlist); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; pdp->setup.plexlist = XtCreateManagedWidget("plexlist", listWidgetClass, listform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, pdp->setup.paperlist); n++; XtSetArg(args[n], XtNborderWidth, 0); n++; XtSetArg(args[n], XtNresizable, False); n++; XtSetArg(args[n], XtNjustify, XtJustifyRight); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; - XtSetArg(args[n], XtNlabel, "Job Copies:"); n++; XtSetArg(args[n], XtNsensitive, canChangeJobCopies); n++; pdp->setup.jobcopieslabel = XtCreateManagedWidget("jobcopieslabel", labelWidgetClass, listform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->setup.jobcopieslabel); n++; - XtSetArg(args[n], XtNfromVert, pdp->setup.paperlist); n++; XtSetArg(args[n], XtNstring, "1"); n++; XtSetArg(args[n], XtNresizable, True); n++; XtSetArg(args[n], XtNeditType, XawtextEdit); n++; @@ -671,16 +661,10 @@ Widget buildPrintSetupDialog(PrintDialogWidget pdw) XtAddCallback(pdp->setup.jobcopies, XtNpositionCallback, printSetupJobCopiesXtProc, pdw); n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, listform); n++; - XtSetArg(args[n], XtNlabel, "OK"); n++; pdp->setup.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->setup.form, args, n); XtAddCallback(pdp->setup.ok, XtNcallback, printSetupOKXtProc, pdw); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->setup.ok); n++; - XtSetArg(args[n], XtNfromVert, listform); n++; - XtSetArg(args[n], XtNlabel, "Cancel"); n++; pdp->setup.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->setup.form, args, n); XtAddCallback(pdp->setup.cancel, XtNcallback, printSetupCancelXtProc, pdw); @@ -805,7 +789,7 @@ printerSelectionPrinterSelectedXtProc(Widget w, XtPointer client_data, XtPointer list_index = lrs->list_index; if (list_index == XAW_LIST_NONE) { - Log(("printerSelectionPrinterSelectedXtProc: Nothing selected.")); + Log(("printerSelectionPrinterSelectedXtProc: Nothing selected.\n")); return; } @@ -915,25 +899,17 @@ Bool buildPrinterSelectionDialog(PrintDialogWidget pdw) XtSetArg(args[n], XtNresizable, True); n++; XtSetArg(args[n], XtNforceColumns, True); n++; XtSetArg(args[n], XtNdefaultColumns, 1); n++; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNlist, pdp->widget_printerlist); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; pdp->selectPrinter.list = XtCreateManagedWidget("list", listWidgetClass, pdp->selectPrinter.form, args, n); XtAddCallback(pdp->selectPrinter.list, XtNcallback, printerSelectionPrinterSelectedXtProc, pdw); n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, pdp->selectPrinter.list); n++; - XtSetArg(args[n], XtNlabel, "OK"); n++; XtSetArg(args[n], XtNsensitive, False); n++; pdp->selectPrinter.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->selectPrinter.form, args, n); XtAddCallback(pdp->selectPrinter.ok, XtNcallback, printerSelectionOKXtProc, pdw); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->selectPrinter.ok); n++; - XtSetArg(args[n], XtNfromVert, pdp->selectPrinter.list); n++; - XtSetArg(args[n], XtNlabel, "Cancel"); n++; pdp->selectPrinter.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->selectPrinter.form, args, n); XtAddCallback(pdp->selectPrinter.cancel, XtNcallback, printerSelectionCancelXtProc, pdw); @@ -1005,18 +981,13 @@ createprintdialogchildren(Widget w) pdp->main.innerform = XtCreateManagedWidget("innerform", formWidgetClass, pdp->main.form, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNborderWidth, 0); n++; XtSetArg(args[n], XtNresizable, False); n++; XtSetArg(args[n], XtNjustify, XtJustifyRight); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; - XtSetArg(args[n], XtNlabel, "Printer Description:"); n++; pdp->main.desclabel = XtCreateManagedWidget("desclabel", labelWidgetClass, pdp->main.innerform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.desclabel); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNborderWidth, 0); n++; XtSetArg(args[n], XtNresizable, False); n++; XtSetArg(args[n], XtNjustify, XtJustifyLeft); n++; @@ -1025,27 +996,19 @@ createprintdialogchildren(Widget w) pdp->main.desc = XtCreateManagedWidget("desc", labelWidgetClass, pdp->main.innerform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.desc); n++; - XtSetArg(args[n], XtNfromVert, NULL); n++; XtSetArg(args[n], XtNsensitive, has_default_printer); n++; - XtSetArg(args[n], XtNlabel, "Printer info..."); n++; pdp->main.info = XtCreateManagedWidget("info", commandWidgetClass, pdp->main.innerform, args, n); /* XtAddCallback(pdp->main.info, XtNcallback, printerInfoXtProc, pdw); */ n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.desclabel); n++; XtSetArg(args[n], XtNborderWidth, 0); n++; XtSetArg(args[n], XtNresizable, False); n++; XtSetArg(args[n], XtNjustify, XtJustifyRight); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; - XtSetArg(args[n], XtNlabel, "Printer Name:"); n++; pdp->main.namelabel = XtCreateManagedWidget("namelabel", labelWidgetClass, pdp->main.innerform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.namelabel); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.desclabel); n++; XtSetArg(args[n], XtNborderWidth, 0); n++; XtSetArg(args[n], XtNresizable, False); n++; XtSetArg(args[n], XtNjustify, XtJustifyLeft); n++; @@ -1054,28 +1017,20 @@ createprintdialogchildren(Widget w) pdp->main.name = XtCreateManagedWidget("name", labelWidgetClass, pdp->main.innerform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.name); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.desclabel); n++; - XtSetArg(args[n], XtNlabel, "Select Printer..."); n++; pdp->main.selectprinter = XtCreateManagedWidget("selectprinter", commandWidgetClass, pdp->main.innerform, args, n); XtAddCallback(pdp->main.selectprinter, XtNcallback, printSelectPrinterXtProc, pdw); /* Line: "File selection" */ n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.namelabel); n++; XtSetArg(args[n], XtNborderWidth, 0); n++; XtSetArg(args[n], XtNresizable, False); n++; XtSetArg(args[n], XtNjustify, XtJustifyRight); n++; XtSetArg(args[n], XtNwidth, DEFAULT_WIDTH); n++; - XtSetArg(args[n], XtNlabel, "File Name:"); n++; XtSetArg(args[n], XtNsensitive, False); n++; pdp->main.filenamelabel = XtCreateManagedWidget("filenamelabel", labelWidgetClass, pdp->main.innerform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.filenamelabel); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.namelabel); n++; XtSetArg(args[n], XtNborderWidth, 0); n++; XtSetArg(args[n], XtNresizable, False); n++; XtSetArg(args[n], XtNjustify, XtJustifyLeft); n++; @@ -1085,26 +1040,17 @@ createprintdialogchildren(Widget w) pdp->main.filename = XtCreateManagedWidget("filename", labelWidgetClass, pdp->main.innerform, args, n); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.filename); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.namelabel); n++; XtSetArg(args[n], XtNsensitive, False); n++; - XtSetArg(args[n], XtNlabel, "Select File..."); n++; pdp->main.selectfile = XtCreateManagedWidget("selectfile", commandWidgetClass, pdp->main.innerform, args, n); XtAddCallback(pdp->main.selectfile, XtNcallback, printSelectFileXtProc, pdw); /* Line: Misc (Print destination toggles, copy-count etc.)*/ n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.filenamelabel); n++; - XtSetArg(args[n], XtNlabel, "Print to Printer"); n++; XtSetArg(args[n], XtNstate, True); n++; pdp->main.printtoprinter = XtCreateManagedWidget("printtoprinter", toggleWidgetClass, pdp->main.innerform, args, n); XtAddCallback(pdp->main.printtoprinter, XtNcallback, printDialogDestXtProc, pdw); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.printtoprinter); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.filenamelabel); n++; - XtSetArg(args[n], XtNlabel, "Print to File"); n++; XtSetArg(args[n], XtNstate, False); n++; pdp->main.printtofile = XtCreateManagedWidget("printtofile", toggleWidgetClass, pdp->main.innerform, args, n); XtAddCallback(pdp->main.printtofile, XtNcallback, printDialogDestXtProc, pdw); @@ -1112,25 +1058,16 @@ createprintdialogchildren(Widget w) /* End-of-Inner-Form-Content */ n = 0; - XtSetArg(args[n], XtNfromHoriz, NULL); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.innerform); n++; - XtSetArg(args[n], XtNlabel, "Print"); n++; XtSetArg(args[n], XtNsensitive, has_default_printer); n++; pdp->main.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->main.form, args, n); XtAddCallback(pdp->main.ok, XtNcallback, printOKXtProc, pdw); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.ok); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.innerform); n++; - XtSetArg(args[n], XtNlabel, "Setup..."); n++; XtSetArg(args[n], XtNsensitive, has_default_printer); n++; pdp->main.setup = XtCreateManagedWidget("setup", commandWidgetClass, pdp->main.form, args, n); XtAddCallback(pdp->main.setup, XtNcallback, printSetupXtProc, pdw); n = 0; - XtSetArg(args[n], XtNfromHoriz, pdp->main.setup); n++; - XtSetArg(args[n], XtNfromVert, pdp->main.innerform); n++; - XtSetArg(args[n], XtNlabel, "Cancel"); n++; pdp->main.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->main.form, args, n); XtAddCallback(pdp->main.cancel, XtNcallback, printCancelXtProc, pdw); } |