2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: PrintOptions.c /main/4 1996/04/29 17:12:37 rswiston $ */
30 * RESTRICTED CONFIDENTIAL INFORMATION:
32 * The information in this document is subject to special
33 * restrictions in a confidential disclosure agreement between
34 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
35 * document outside HP, IBM, Sun, USL, SCO, or Univel without
36 * Sun's specific written approval. This document and all copies
37 * and derivative works thereof must be returned or destroyed at
40 * Copyright 1994 Sun Microsystems, Inc. All rights reserved.
45 * Common Desktop Environment
47 * (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
48 * (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
49 * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
50 * (c) Copyright 1993, 1994, 1995 Novell, Inc.
51 * (c) Copyright 1995 Digital Equipment Corp.
52 * (c) Copyright 1995 Fujitsu Limited
53 * (c) Copyright 1995 Hitachi, Ltd.
56 * RESTRICTED RIGHTS LEGEND
58 * Use, duplication, or disclosure by the U.S. Government is subject to
59 * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
60 * Technical Data and Computer Software clause in DFARS 252.227-7013. Rights
61 * for non-DOD U.S. Government Departments and Agencies are as set forth in
62 * FAR 52.227-19(c)(1,2).
64 * Hewlett-Packard Company, 3000 Hanover Street, Palo Alto, CA 94304 U.S.A.
65 * International Business Machines Corp., Route 100, Somers, NY 10589 U.S.A.
66 * Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, CA 94043 U.S.A.
67 * Novell, Inc., 190 River Road, Summit, NJ 07901 U.S.A.
68 * Digital Equipment Corp., 111 Powdermill Road, Maynard, MA 01754, U.S.A.
69 * Fujitsu Limited, 1015, Kamikodanaka Nakahara-Ku, Kawasaki 211, Japan
70 * Hitachi, Ltd., 6, Kanda Surugadai 4-Chome, Chiyoda-ku, Tokyo 101, Japan
75 #include "PrintMsgsP.h"
76 #include "PrintOptionsP.h"
79 /******************************************************************************
83 ******************************************************************************/
86 _DtPrintDestroyHdrFtrFrameCB(
88 XtPointer client_data,
92 _DtPrintDestroyMarginFrameCB(
94 XtPointer client_data,
98 /******************************************************************************
100 * _DtPrint Header/Footer API
102 ******************************************************************************/
103 typedef struct dtpo_header_footer_spec
110 typedef struct dtpo_header_footer_frame
122 DtpoHdrFtrSpec *specs;
126 _DtPrintDestroyHdrFtrFrameCB(
128 XtPointer client_data,
132 DtpoHdrFtrFrame *info = (DtpoHdrFtrFrame *) client_data;
134 if (info == NULL) return;
135 if (info->specs != NULL)
136 XtFree((char*) info->specs);
137 XtFree((char*) info);
142 * Function: _DtPrintCreateHdrFtrFrame
144 * Creates a frame for specifying the contents of page headers and footers.
145 * The frame contains four option menus, one for each _DtPrintHdrFtrEnum.
146 * The pulldown menus for the option menu are constructed from the .string
147 * field in the array of _DtPrintHdrFtrSpec in "specs".
149 * _DtPrintCreateHdrFtrFrame copies the pointer to the array of
150 * _DtPrintHdrFtrSpec. IT DOES NOT COPY THE ELEMENTS OF THE ARRAY.
152 * parent - specifies the parent of the frame.
153 * nspecs - specifies the number of entries in the specs array.
154 * specs - array of header/footer specifiers. The .string
155 * field is used to construct labels in the GUI.
156 * The .data field is returned in calls to
157 * _DtPrintGetHdrFtrSpec.
159 * Returns the widget id for the frame.
162 _DtPrintCreateHdrFtrFrame(
169 DtpoHdrFtrFrame *info;
175 info = (DtpoHdrFtrFrame *) XtMalloc( sizeof(DtpoHdrFtrFrame) );
176 info->nspecs = nspecs;
177 info->specs = (DtpoHdrFtrSpec *) XtMalloc(nspecs*sizeof(DtpoHdrFtrSpec));
178 for (i=0; i<nspecs; i++)
180 info->specs[i].string = spec_strings[i];
181 if (spec_data != (void*) NULL)
182 info->specs[i].data = spec_data[i];
184 info->specs[i].data = (void*) NULL;
185 info->specs[i].button = (Widget) NULL;
190 * Create the frame and attach add a destroyCallback to clean up
191 * memory allocated for this object.
194 XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
195 XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
196 XtSetArg(args[n], XmNuserData, info); n++;
197 info->frame = XmCreateFrame(parent, "HdrFtrFrame", args, n);
201 _DtPrintDestroyHdrFtrFrameCB,
206 * Create a label child for the frame
208 xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_LABEL);
210 XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
211 XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
212 XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
213 XtSetArg(args[n], XmNlabelString, xms); n++;
214 info->label = XmCreateLabel(info->frame, "HdrFtrLabel", args, n);
215 XtManageChild(info->label);
219 * Create a form work area child which will be populated by the
223 XtSetArg(args[n], XmNallowOverlap, False); n++;
224 XtSetArg(args[n], XmNfractionBase, 2); n++;
225 info->form = XmCreateForm(info->frame, "HdrFtrForm", args, n);
228 * Create the pulldown menu for the option menus.
229 * Store the button index in the userData resource of each button.
231 info->menu = XmCreatePulldownMenu(parent, "HdrFtrMenu", NULL, 0);
232 for (i=0; i<info->nspecs; i++)
234 static char button_label[32];
236 sprintf(button_label, "Button%d", i);
237 xms = XmStringCreateLocalized(info->specs[i].string);
239 XtSetArg(args[n], XmNlabelString, xms); n++;
240 XtSetArg(args[n], XmNuserData, i); n++;
241 info->specs[i].button =
242 XmCreatePushButtonGadget(info->menu, button_label, args, n);
244 XtManageChild(info->specs[i].button);
249 * Create the option menus using the menu created above.
251 xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_TOP_LEFT_LABEL);
254 XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
255 XtSetArg(args[n], XmNlabelString, xms); n++;
256 XtSetArg(args[n], XmNuserData, info); n++;
257 XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
258 XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
259 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
260 XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++;
261 XtSetArg(args[n], XmNrightPosition, 1); n++;
262 XtSetArg(args[n], XmNrightOffset, 5); n++;
264 info->top_left = XmCreateOptionMenu(
270 XtManageChild(info->top_left);
272 xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_TOP_RIGHT_LABEL);
275 XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
276 XtSetArg(args[n], XmNlabelString, xms); n++;
277 XtSetArg(args[n], XmNuserData, info); n++;
278 XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
279 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
280 XtSetArg(args[n], XmNtopWidget, info->top_left); n++;
281 XtSetArg(args[n], XmNtopOffset, 0); n++;
282 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
283 XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
285 info->top_right = XmCreateOptionMenu(
291 XtManageChild(info->top_right);
293 xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_BOTTOM_LEFT_LABEL);
296 XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
297 XtSetArg(args[n], XmNlabelString, xms); n++;
298 XtSetArg(args[n], XmNuserData, info); n++;
299 XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
300 XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
301 XtSetArg(args[n], XmNtopWidget, info->top_left); n++;
302 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
303 XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
304 XtSetArg(args[n], XmNrightWidget, info->top_left); n++;
305 XtSetArg(args[n], XmNrightOffset, 0); n++;
307 info->bottom_left = XmCreateOptionMenu(
313 XtManageChild(info->bottom_left);
315 xms = XmStringCreateLocalized(DTPO_HEADERFOOTER_FRAME_BOTTOM_RIGHT_LABEL);
318 XtSetArg(args[n], XmNsubMenuId, info->menu); n++;
319 XtSetArg(args[n], XmNlabelString, xms); n++;
320 XtSetArg(args[n], XmNuserData, info); n++;
321 XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
322 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
323 XtSetArg(args[n], XmNtopWidget, info->bottom_left); n++;
324 XtSetArg(args[n], XmNtopOffset, 0); n++;
325 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
326 XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
327 XtSetArg(args[n], XmNrightWidget, info->top_right); n++;
328 XtSetArg(args[n], XmNrightOffset, 0); n++;
330 info->bottom_right = XmCreateOptionMenu(
336 XtManageChild(info->bottom_right);
338 XtManageChild(info->form);
343 * Function: _DtPrintHdrFtrFrameEnumToWidget
345 * Returns the widget id of the option menu corresponding the specified
348 * frame - specifies the HdrFtr frame
349 * which - specifies the particular header or footer in "frame".
351 * Returns the widget id of the option menu for "which"
354 _DtPrintHdrFtrFrameEnumToWidget(
356 _DtPrintHdrFtrEnum which
359 DtpoHdrFtrFrame *info;
360 Widget widget = NULL;
362 XtVaGetValues(frame, XmNuserData, &info, NULL);
368 case DTPRINT_OPTION_HEADER_LEFT:
369 widget = info->top_left; break;
370 case DTPRINT_OPTION_HEADER_RIGHT:
371 widget = info->top_right; break;
372 case DTPRINT_OPTION_FOOTER_LEFT:
373 widget = info->bottom_left; break;
374 case DTPRINT_OPTION_FOOTER_RIGHT:
375 widget = info->bottom_right; break;
384 * Function: _DtPrintHdrFtrFrameMenuWidgets
386 * widget -specifies the option menu
388 * Returns the widgets which make up the pulldown menu.
391 _DtPrintHdrFtrFrameMenuWidgets(
395 Widget **menu_buttons
399 DtpoHdrFtrFrame *info;
401 if (frame == NULL) return;
403 XtVaGetValues(frame, XmNuserData, &info, NULL);
404 if (info == NULL) return;
409 if (nmenu_buttons != NULL)
410 *nmenu_buttons = info->nspecs;
412 if (menu_buttons != NULL)
414 if (*menu_buttons == NULL)
415 *menu_buttons = (Widget *) XtMalloc( info->nspecs * sizeof(Widget) );
417 for (i=0; i<info->nspecs; i++)
418 (*menu_buttons)[i] = info->specs[i].button;
423 * Function: _DtPrintGetHdrFtrIndex
425 * option - specifies the HdrFtr option menu
427 * Returns the index of the active menu option of the specified
431 _DtPrintGetHdrFtrIndex(
438 if (! option) return index;
440 XtVaGetValues(option, XmNmenuHistory, &selected, NULL);
441 XtVaGetValues(selected, XmNuserData, &index, NULL);
446 * Function: _DtPrintGetHdrFtrData
448 * option - specifies the HdrFtr option menu
450 * Returns the data associated with the active menu option of the specified
454 _DtPrintGetHdrFtrData(
459 DtpoHdrFtrFrame *info = NULL;
461 if (! option) return (void*) NULL;
462 XtVaGetValues(option, XmNuserData, &info, NULL);
463 if (info == NULL) return 0;
465 index = _DtPrintGetHdrFtrIndex(option);
466 return info->specs[index].data;
470 * Function: _DtPrintGetHdrFtrString
472 * option - specifies the HdrFtr option menu
474 * Returns the string associated with the active menu option of the specified
478 _DtPrintGetHdrFtrString(
483 DtpoHdrFtrFrame *info = NULL;
485 if (! option) return (void*) NULL;
486 XtVaGetValues(option, XmNuserData, &info, NULL);
487 if (info == NULL) return 0;
489 index = _DtPrintGetHdrFtrIndex(option);
490 return info->specs[index].string;
494 * Function: _DtPrintSetHdrFtrByData
496 * Displays the specified menu item as the currently active option.
498 * option - specifies the HdrFtr option menu
499 * data - data associated with the option to be displayed.
502 _DtPrintSetHdrFtrByData(
508 DtpoHdrFtrFrame *info;
510 if (option == NULL) return;
511 XtVaGetValues(option, XmNuserData, &info, NULL);
512 if (info == NULL) return;
514 for (i=0; i<info->nspecs; i++)
515 if (info->specs[i].data == data)
517 XtVaSetValues(option, XmNmenuHistory, info->specs[i].button, NULL);
523 * Function: _DtPrintSetHdrFtrByIndex
525 * Displays the specified menu item as the currently active option.
527 * option - specifies the HdrFtr option menu
528 * index - specifies the option to be displayed.
531 _DtPrintSetHdrFtrByIndex(
536 DtpoHdrFtrFrame *info;
538 if (option == NULL) return;
539 XtVaGetValues(option, XmNuserData, &info, NULL);
540 if (info == NULL) return;
542 XtVaSetValues(option, XmNmenuHistory, info->specs[index].button, NULL);
546 * Function: _DtPrintSetHdrFtrByString
548 * Displays the specified menu item as the currently active option.
550 * option - specifies the HdrFtr option menu
551 * string - string associated with the option to be displayed.
554 _DtPrintSetHdrFtrByString(
560 DtpoHdrFtrFrame *info;
562 if (option == NULL) return;
563 XtVaGetValues(option, XmNuserData, &info, NULL);
564 if (info == NULL) return;
566 for (i=0; i<info->nspecs; i++)
567 if (strcmp(info->specs[i].string,string) == 0)
569 XtVaSetValues(option, XmNmenuHistory, info->specs[i].button, NULL);
576 /******************************************************************************
578 * _DtPrint Margin API
580 ******************************************************************************/
581 typedef struct dtpo_margin_frame
599 _DtPrintDestroyMarginFrameCB(
601 XtPointer client_data,
605 DtpoHdrFtrFrame *info = (DtpoHdrFtrFrame *) client_data;
607 if (info == NULL) return;
608 XtFree((char*) info);
612 * Function: _DtPrintCreateMarginFrame
614 * Creates a frame for specifying margins. The frame contains four text
615 * fields, one for each _DtPrintMarginEnum.
617 * parent - specifies the parent of the frame.
619 * Returns the widget id of the frame.
622 _DtPrintCreateMarginFrame(
632 info = (DtpoMarginFrame *) XtMalloc( sizeof(DtpoMarginFrame) );
635 XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
636 XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
637 XtSetArg(args[n], XmNuserData, info); n++;
638 info->frame = XmCreateFrame(parent, "MarginFrame", args, n);
642 _DtPrintDestroyMarginFrameCB,
646 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_LABEL);
648 XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
649 XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
650 XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
651 XtSetArg(args[n], XmNlabelString, xms); n++;
652 info->label = XmCreateLabel(info->frame, "MarginLabel", args, n);
653 XtManageChild(info->label);
657 XtSetArg(args[n], XmNallowOverlap, False); n++;
658 XtSetArg(args[n], XmNfractionBase, 2); n++;
659 info->form = XmCreateForm(info->frame, "MarginForm", args, n);
662 XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
663 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
664 XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++;
665 XtSetArg(args[n], XmNrightPosition, 1); n++;
666 XtSetArg(args[n], XmNrightOffset, 5); n++;
667 info->top = XmCreateTextField(info->form, "MarginTopText", args, n);
668 XtManageChild(info->top);
670 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_TOP_MARGIN_LABEL);
673 XtSetArg(args[n], XmNlabelString, xms); n++;
674 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
675 XtSetArg(args[n], XmNtopWidget, info->top); n++;
676 XtSetArg(args[n], XmNtopOffset, 0); n++;
677 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
678 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
679 XtSetArg(args[n], XmNrightWidget, info->top); n++;
680 XtSetArg(args[n], XmNrightOffset, 3); n++;
681 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
682 XtSetArg(args[n], XmNbottomWidget, info->top); n++;
683 XtSetArg(args[n], XmNbottomOffset, 0); n++;
685 XmCreateLabelGadget(info->form, "MarginTopLabel", args, n);
687 XtManageChild(info->top_label);
690 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
691 XtSetArg(args[n], XmNtopWidget, info->top); n++;
692 XtSetArg(args[n], XmNtopOffset, 0); n++;
693 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
694 XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
695 info->right = XmCreateTextField(info->form, "MarginRightText", args, n);
696 XtManageChild(info->right);
698 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_RIGHT_MARGIN_LABEL);
700 XtSetArg(args[n], XmNlabelString, xms); n++;
701 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
702 XtSetArg(args[n], XmNtopWidget, info->right); n++;
703 XtSetArg(args[n], XmNtopOffset, 0); n++;
704 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
705 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
706 XtSetArg(args[n], XmNrightWidget, info->right); n++;
707 XtSetArg(args[n], XmNrightOffset, 3); n++;
708 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
709 XtSetArg(args[n], XmNbottomWidget, info->right); n++;
710 XtSetArg(args[n], XmNbottomOffset, 0); n++;
712 XmCreateLabelGadget(info->form, "MarginRightLabel", args, n);
714 XtManageChild(info->right_label);
717 XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
718 XtSetArg(args[n], XmNtopWidget, info->top); n++;
719 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
720 XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
721 XtSetArg(args[n], XmNrightWidget, info->top); n++;
722 XtSetArg(args[n], XmNrightOffset, 0); n++;
723 info->bottom = XmCreateTextField(info->form, "MarginBottomText", args, n);
724 XtManageChild(info->bottom);
726 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_BOTTOM_MARGIN_LABEL);
728 XtSetArg(args[n], XmNlabelString, xms); n++;
729 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
730 XtSetArg(args[n], XmNtopWidget, info->bottom); n++;
731 XtSetArg(args[n], XmNtopOffset, 0); n++;
732 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
733 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
734 XtSetArg(args[n], XmNrightWidget, info->bottom); n++;
735 XtSetArg(args[n], XmNrightOffset, 3); n++;
736 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
737 XtSetArg(args[n], XmNbottomWidget, info->bottom); n++;
738 XtSetArg(args[n], XmNbottomOffset, 0); n++;
740 XmCreateLabelGadget(info->form, "MarginBottomLabel", args, n);
742 XtManageChild(info->bottom_label);
745 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
746 XtSetArg(args[n], XmNtopWidget, info->bottom); n++;
747 XtSetArg(args[n], XmNtopOffset, 0); n++;
748 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
749 XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
750 XtSetArg(args[n], XmNrightWidget, info->right); n++;
751 XtSetArg(args[n], XmNrightOffset, 0); n++;
752 info->left = XmCreateTextField(info->form, "MarginLeftText", args, n);
753 XtManageChild(info->left);
755 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_LEFT_MARGIN_LABEL);
757 XtSetArg(args[n], XmNlabelString, xms); n++;
758 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
759 XtSetArg(args[n], XmNtopWidget, info->left); n++;
760 XtSetArg(args[n], XmNtopOffset, 0); n++;
761 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
762 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
763 XtSetArg(args[n], XmNrightWidget, info->left); n++;
764 XtSetArg(args[n], XmNrightOffset, 3); n++;
765 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
766 XtSetArg(args[n], XmNbottomWidget, info->left); n++;
767 XtSetArg(args[n], XmNbottomOffset, 0); n++;
769 XmCreateLabelGadget(info->form, "MarginLeftLabel", args, n);
771 XtManageChild(info->left_label);
773 XtManageChild(info->form);
778 * Function: _DtPrintMarginFrameEnumToWidget
780 * frame - specifies the HdrFtr frame
781 * which - specifies the particular margin in "frame".
783 * Returns the widget id of the textfield for "which"
786 _DtPrintMarginFrameEnumToWidget(
788 _DtPrintMarginEnum which
791 DtpoMarginFrame *info;
792 Widget widget = NULL;
794 XtVaGetValues(frame, XmNuserData, &info, NULL);
800 case DTPRINT_OPTION_MARGIN_TOP:
801 widget = info->top; break;
802 case DTPRINT_OPTION_MARGIN_RIGHT:
803 widget = info->right; break;
804 case DTPRINT_OPTION_MARGIN_BOTTOM:
805 widget = info->bottom; break;
806 case DTPRINT_OPTION_MARGIN_LEFT:
807 widget = info->left; break;
816 * Function: _DtPrintGetMarginSpec
818 * margin - specifies the margin widget.
820 * Returns a copy of the contents of the specified margin.
821 * The calling function should free this string when done with it.
824 _DtPrintGetMarginSpec(
831 spec = XmTextFieldGetString(margin);
837 * Function: _DtPrintSetMarginSpec
839 * margin -specifies the margin widget.
840 * spec - specifies the string to be displayed in the GUI.
844 _DtPrintSetMarginSpec(
850 XmTextFieldSetString(margin, spec);