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 librararies 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;
400 Widget widget = NULL;
402 if (frame == NULL) return;
404 XtVaGetValues(frame, XmNuserData, &info, NULL);
405 if (info == NULL) return;
410 if (nmenu_buttons != NULL)
411 *nmenu_buttons = info->nspecs;
413 if (menu_buttons != NULL)
415 if (*menu_buttons == NULL)
416 *menu_buttons = (Widget *) XtMalloc( info->nspecs * sizeof(Widget) );
418 for (i=0; i<info->nspecs; i++)
419 (*menu_buttons)[i] = info->specs[i].button;
424 * Function: _DtPrintGetHdrFtrIndex
426 * option - specifies the HdrFtr option menu
428 * Returns the index of the active menu option of the specified
432 _DtPrintGetHdrFtrIndex(
439 if (! option) return index;
441 XtVaGetValues(option, XmNmenuHistory, &selected, NULL);
442 XtVaGetValues(selected, XmNuserData, &index, NULL);
447 * Function: _DtPrintGetHdrFtrData
449 * option - specifies the HdrFtr option menu
451 * Returns the data associated with the active menu option of the specified
455 _DtPrintGetHdrFtrData(
460 DtpoHdrFtrFrame *info = NULL;
462 if (! option) return (void*) NULL;
463 XtVaGetValues(option, XmNuserData, &info, NULL);
464 if (info == NULL) return;
466 index = _DtPrintGetHdrFtrIndex(option);
467 return info->specs[index].data;
471 * Function: _DtPrintGetHdrFtrString
473 * option - specifies the HdrFtr option menu
475 * Returns the string associated with the active menu option of the specified
479 _DtPrintGetHdrFtrString(
484 DtpoHdrFtrFrame *info = NULL;
486 if (! option) return (void*) NULL;
487 XtVaGetValues(option, XmNuserData, &info, NULL);
488 if (info == NULL) return;
490 index = _DtPrintGetHdrFtrIndex(option);
491 return info->specs[index].string;
495 * Function: _DtPrintSetHdrFtrByData
497 * Displays the specified menu item as the currently active option.
499 * option - specifies the HdrFtr option menu
500 * data - data associated with the option to be displayed.
503 _DtPrintSetHdrFtrByData(
509 DtpoHdrFtrFrame *info;
511 if (option == NULL) return;
512 XtVaGetValues(option, XmNuserData, &info, NULL);
513 if (info == NULL) return;
515 for (i=0; i<info->nspecs; i++)
516 if (info->specs[i].data == data)
518 XtVaSetValues(option, XmNmenuHistory, info->specs[i].button, NULL);
524 * Function: _DtPrintSetHdrFtrByIndex
526 * Displays the specified menu item as the currently active option.
528 * option - specifies the HdrFtr option menu
529 * index - specifies the option to be displayed.
532 _DtPrintSetHdrFtrByIndex(
537 DtpoHdrFtrFrame *info;
539 if (option == NULL) return;
540 XtVaGetValues(option, XmNuserData, &info, NULL);
541 if (info == NULL) return;
543 XtVaSetValues(option, XmNmenuHistory, info->specs[index].button, NULL);
547 * Function: _DtPrintSetHdrFtrByString
549 * Displays the specified menu item as the currently active option.
551 * option - specifies the HdrFtr option menu
552 * string - string associated with the option to be displayed.
555 _DtPrintSetHdrFtrByString(
561 DtpoHdrFtrFrame *info;
563 if (option == NULL) return;
564 XtVaGetValues(option, XmNuserData, &info, NULL);
565 if (info == NULL) return;
567 for (i=0; i<info->nspecs; i++)
568 if (strcmp(info->specs[i].string,string) == 0)
570 XtVaSetValues(option, XmNmenuHistory, info->specs[i].button, NULL);
577 /******************************************************************************
579 * _DtPrint Margin API
581 ******************************************************************************/
582 typedef struct dtpo_margin_frame
600 _DtPrintDestroyMarginFrameCB(
602 XtPointer client_data,
606 DtpoHdrFtrFrame *info = (DtpoHdrFtrFrame *) client_data;
609 if (info == NULL) return;
610 XtFree((char*) info);
614 * Function: _DtPrintCreateMarginFrame
616 * Creates a frame for specifying margins. The frame contains four text
617 * fields, one for each _DtPrintMarginEnum.
619 * parent - specifies the parent of the frame.
621 * Returns the widget id of the frame.
624 _DtPrintCreateMarginFrame(
635 info = (DtpoMarginFrame *) XtMalloc( sizeof(DtpoMarginFrame) );
638 XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
639 XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
640 XtSetArg(args[n], XmNuserData, info); n++;
641 info->frame = XmCreateFrame(parent, "MarginFrame", args, n);
645 _DtPrintDestroyMarginFrameCB,
649 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_LABEL);
651 XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++;
652 XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING); n++;
653 XtSetArg(args[n], XmNchildVerticalAlignment, XmALIGNMENT_CENTER); n++;
654 XtSetArg(args[n], XmNlabelString, xms); n++;
655 info->label = XmCreateLabel(info->frame, "MarginLabel", args, n);
656 XtManageChild(info->label);
660 XtSetArg(args[n], XmNallowOverlap, False); n++;
661 XtSetArg(args[n], XmNfractionBase, 2); n++;
662 info->form = XmCreateForm(info->frame, "MarginForm", args, n);
665 XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
666 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
667 XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++;
668 XtSetArg(args[n], XmNrightPosition, 1); n++;
669 XtSetArg(args[n], XmNrightOffset, 5); n++;
670 info->top = XmCreateTextField(info->form, "MarginTopText", args, n);
671 XtManageChild(info->top);
673 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_TOP_MARGIN_LABEL);
676 XtSetArg(args[n], XmNlabelString, xms); n++;
677 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
678 XtSetArg(args[n], XmNtopWidget, info->top); n++;
679 XtSetArg(args[n], XmNtopOffset, 0); n++;
680 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
681 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
682 XtSetArg(args[n], XmNrightWidget, info->top); n++;
683 XtSetArg(args[n], XmNrightOffset, 3); n++;
684 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
685 XtSetArg(args[n], XmNbottomWidget, info->top); n++;
686 XtSetArg(args[n], XmNbottomOffset, 0); n++;
688 XmCreateLabelGadget(info->form, "MarginTopLabel", args, n);
690 XtManageChild(info->top_label);
693 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
694 XtSetArg(args[n], XmNtopWidget, info->top); n++;
695 XtSetArg(args[n], XmNtopOffset, 0); n++;
696 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
697 XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
698 info->right = XmCreateTextField(info->form, "MarginRightText", args, n);
699 XtManageChild(info->right);
701 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_RIGHT_MARGIN_LABEL);
703 XtSetArg(args[n], XmNlabelString, xms); n++;
704 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
705 XtSetArg(args[n], XmNtopWidget, info->right); n++;
706 XtSetArg(args[n], XmNtopOffset, 0); n++;
707 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
708 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
709 XtSetArg(args[n], XmNrightWidget, info->right); n++;
710 XtSetArg(args[n], XmNrightOffset, 3); n++;
711 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
712 XtSetArg(args[n], XmNbottomWidget, info->right); n++;
713 XtSetArg(args[n], XmNbottomOffset, 0); n++;
715 XmCreateLabelGadget(info->form, "MarginRightLabel", args, n);
717 XtManageChild(info->right_label);
720 XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
721 XtSetArg(args[n], XmNtopWidget, info->top); n++;
722 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
723 XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
724 XtSetArg(args[n], XmNrightWidget, info->top); n++;
725 XtSetArg(args[n], XmNrightOffset, 0); n++;
726 info->bottom = XmCreateTextField(info->form, "MarginBottomText", args, n);
727 XtManageChild(info->bottom);
729 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_BOTTOM_MARGIN_LABEL);
731 XtSetArg(args[n], XmNlabelString, xms); n++;
732 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
733 XtSetArg(args[n], XmNtopWidget, info->bottom); n++;
734 XtSetArg(args[n], XmNtopOffset, 0); n++;
735 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
736 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
737 XtSetArg(args[n], XmNrightWidget, info->bottom); n++;
738 XtSetArg(args[n], XmNrightOffset, 3); n++;
739 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
740 XtSetArg(args[n], XmNbottomWidget, info->bottom); n++;
741 XtSetArg(args[n], XmNbottomOffset, 0); n++;
743 XmCreateLabelGadget(info->form, "MarginBottomLabel", args, n);
745 XtManageChild(info->bottom_label);
748 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
749 XtSetArg(args[n], XmNtopWidget, info->bottom); n++;
750 XtSetArg(args[n], XmNtopOffset, 0); n++;
751 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
752 XtSetArg(args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
753 XtSetArg(args[n], XmNrightWidget, info->right); n++;
754 XtSetArg(args[n], XmNrightOffset, 0); n++;
755 info->left = XmCreateTextField(info->form, "MarginLeftText", args, n);
756 XtManageChild(info->left);
758 xms = XmStringCreateLocalized(DTPO_MARGIN_FRAME_LEFT_MARGIN_LABEL);
760 XtSetArg(args[n], XmNlabelString, xms); n++;
761 XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
762 XtSetArg(args[n], XmNtopWidget, info->left); n++;
763 XtSetArg(args[n], XmNtopOffset, 0); n++;
764 XtSetArg(args[n], XmNleftAttachment, XmATTACH_NONE); n++;
765 XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
766 XtSetArg(args[n], XmNrightWidget, info->left); n++;
767 XtSetArg(args[n], XmNrightOffset, 3); n++;
768 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
769 XtSetArg(args[n], XmNbottomWidget, info->left); n++;
770 XtSetArg(args[n], XmNbottomOffset, 0); n++;
772 XmCreateLabelGadget(info->form, "MarginLeftLabel", args, n);
774 XtManageChild(info->left_label);
776 XtManageChild(info->form);
781 * Function: _DtPrintMarginFrameEnumToWidget
783 * frame - specifies the HdrFtr frame
784 * which - specifies the particular margin in "frame".
786 * Returns the widget id of the textfield for "which"
789 _DtPrintMarginFrameEnumToWidget(
791 _DtPrintMarginEnum which
794 DtpoMarginFrame *info;
795 Widget widget = NULL;
797 XtVaGetValues(frame, XmNuserData, &info, NULL);
803 case DTPRINT_OPTION_MARGIN_TOP:
804 widget = info->top; break;
805 case DTPRINT_OPTION_MARGIN_RIGHT:
806 widget = info->right; break;
807 case DTPRINT_OPTION_MARGIN_BOTTOM:
808 widget = info->bottom; break;
809 case DTPRINT_OPTION_MARGIN_LEFT:
810 widget = info->left; break;
819 * Function: _DtPrintGetMarginSpec
821 * margin - specifies the margin widget.
823 * Returns a copy of the contents of the specified margin.
824 * The calling function should free this string when done with it.
827 _DtPrintGetMarginSpec(
834 spec = XmTextFieldGetString(margin);
840 * Function: _DtPrintSetMarginSpec
842 * margin -specifies the margin widget.
843 * spec - specifies the string to be displayed in the GUI.
847 _DtPrintSetMarginSpec(
853 XmTextFieldSetString(margin, spec);