1 /* 2 * Copyright 1993, 1994 Liverpool University Computer Science Department 3 * 4 * Permission to use, copy, modify, and distribute this software and its 5 * documentation for any purpose and without fee is hereby granted, provided 6 * that the above copyright notice appear in all copies and that both that 7 * copyright notice and this permission notice appear in supporting 8 * documentation, and that the name of L.U.C.S. not be used in advertising 9 * or publicity pertaining to distribution of the software without specific, 10 * written prior permission. L.U.C.S. makes no representations about the 11 * suitability of this software for any purpose. It is provided "as is" 12 * without express or implied warranty. 13 * 14 * FILE NAME: XbrCreate.h 15 * CREATED: Fri Nov 5 1993 16 * AUTHOR: Rik Turnbull (rik@csc.liv.ac.uk) 17 * DESCRIPTION: Header file for XbrCreate.c 18 * 19 */ 20 21 #ifndef XBRLIB_XBRCREATE_H 22 #define XBRLIB_XBRCREATE_H 1 23 24 extern Widget XbrCreateList(Widget, unsigned char, unsigned char, unsigned char, 25 int, unsigned char, int, unsigned char, int, unsigned char, int); 26 27 extern Widget XbrCreateText(Widget, Boolean, Boolean, Boolean, unsigned char, 28 unsigned char, int, unsigned char, int, unsigned char, int, unsigned char, 29 int); 30 31 #define XbrCreateForm(w) \ 32 XtVaCreateManagedWidget("Form", xmFormWidgetClass, w, \ 33 XmNmarginWidth, 5, XmNmarginHeight, 5, NULL) 34 35 #define XbrCreateFormWH(w, width, height) \ 36 XtVaCreateManagedWidget("Form", xmFormWidgetClass, w, \ 37 XmNmarginWidth, 5, XmNmarginHeight, 5, XmNwidth, width, XmNheight, \ 38 height, NULL) 39 40 #define XbrCreateMainW(w, seps, width, height) \ 41 XtVaCreateManagedWidget("Main Window", xmMainWindowWidgetClass, w, \ 42 XmNshowSeparator, seps, XmNwidth, width, XmNheight, height, \ 43 NULL) 44 45 #define XbrCreateLabelN(w, name, string, alignment, leftAt, leftPos, rightAt, \ 46 rightPos, topAt, topPos, botAt, botPos) \ 47 XtVaCreateManagedWidget(name, xmLabelWidgetClass, w, \ 48 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 49 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 50 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 51 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 52 XtVaTypedArg, XmNlabelString, XmRString, string, sizeof(char *), \ 53 XmNalignment, alignment, NULL) 54 55 #define XbrCreateLabel(w, string, alignment, leftAt, leftPos, rightAt, \ 56 rightPos, topAt, topPos, botAt, botPos) \ 57 XtVaCreateManagedWidget("Label", xmLabelWidgetClass, w, \ 58 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 59 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 60 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 61 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 62 XtVaTypedArg, XmNlabelString, XmRString, string, sizeof(char *), \ 63 XmNalignment, alignment, NULL) 64 65 #define XbrCreatePBN(w, name, string, alignment, leftAt, leftPos, rightAt, \ 66 rightPos, topAt, topPos, botAt, botPos) \ 67 XtVaCreateManagedWidget(name, xmPushButtonWidgetClass, w, \ 68 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 69 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 70 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 71 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 72 XtVaTypedArg, XmNlabelString, XmRString, string, sizeof(char *), \ 73 XmNalignment, alignment, NULL) 74 75 #define XbrCreatePB(w, string, alignment, leftAt, leftPos, rightAt, rightPos, \ 76 topAt, topPos, botAt, botPos) \ 77 XtVaCreateManagedWidget("Push Button", xmPushButtonWidgetClass, w, \ 78 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 79 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 80 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 81 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 82 XtVaTypedArg, XmNlabelString, XmRString, string, sizeof(char *), \ 83 XmNalignment, alignment, NULL) 84 85 #define XbrCreateToggleN(w, name, string, set, alignment, leftAt, leftPos, \ 86 rightAt, rightPos, topAt, topPos, botAt, botPos) \ 87 XtVaCreateManagedWidget(name, xmToggleButtonWidgetClass, w, \ 88 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 89 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 90 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 91 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 92 XtVaTypedArg, XmNlabelString, XmRString, string, sizeof(char *), \ 93 XmNalignment, alignment, XmNset, set, NULL) 94 95 #define XbrCreateToggle(w, string, set, alignment, leftAt, leftPos, rightAt, \ 96 rightPos, topAt, topPos, botAt, botPos) \ 97 XtVaCreateManagedWidget("Toggle Button", xmToggleButtonWidgetClass, w, \ 98 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 99 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 100 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 101 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 102 XtVaTypedArg, XmNlabelString, XmRString, string, sizeof(char *), \ 103 XmNalignment, alignment, XmNset, set, NULL) 104 105 #define XbrCreateSep(w, style, leftAt, leftPos, rightAt, \ 106 rightPos, topAt, topPos, botAt, botPos) \ 107 XtVaCreateManagedWidget("Separator", xmSeparatorWidgetClass, w, \ 108 XmNseparatorType, style, \ 109 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 110 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 111 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 112 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 113 NULL) 114 115 #define XbrCreateTextF(w, string, editable, leftAt, leftPos, rightAt, \ 116 rightPos, topAt, topPos, botAt, botPos) \ 117 XtVaCreateManagedWidget("Text Field", xmTextFieldWidgetClass, w, \ 118 XmNeditable, editable,XmNcursorPositionVisible, editable, \ 119 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 120 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 121 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 122 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 123 XmNvalue, string, NULL) 124 125 #define XbrCreateTextFN(w, name, string, editable, leftAt, leftPos, rightAt, \ 126 rightPos, topAt, topPos, botAt, botPos) \ 127 XtVaCreateManagedWidget(name, xmTextFieldWidgetClass, w, \ 128 XmNeditable, editable,XmNcursorPositionVisible, editable, \ 129 XmNleftAttachment, leftAt, XmNleftPosition, leftPos, \ 130 XmNrightAttachment, rightAt, XmNrightPosition, rightPos, \ 131 XmNtopAttachment, topAt, XmNtopPosition, topPos, \ 132 XmNbottomAttachment, botAt, XmNbottomPosition, botPos, \ 133 XmNvalue, string, NULL) 134 135 136 #endif 137