67 : shell(NULL), command(NULL), menuBar(NULL), text(NULL), fHelp(false), fHelpChoice(0)
78 if (std::getenv(
"XENVIRONMENT") == NULL) {
79 XrmDatabase database = XrmGetDatabase(XtDisplay(top));
80 if (database != NULL) {
81 XrmPutLineResource(&database,
"*topShadowColor:white");
82 XrmPutLineResource(&database,
"*bottomShadowColor:black");
83 XrmPutLineResource(&database,
"*foreground:black");
84 XrmPutLineResource(&database,
"*background:lightgrey");
85 XrmPutLineResource(&database,
"*borderColor:lightgrey");
86 XrmPutLineResource(&database,
"*fontList:-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1");
87 XrmPutLineResource(&database,
"*text.background:white");
88 XrmPutLineResource(&database,
"*text.fontList:*courier*-r-*--14-*");
89 XrmPutLineResource(&database,
"*text.maxLength:8000");
94 XtSetArg(args[0], XmNkeyboardFocusPolicy, XmPOINTER);
95 shell = XtAppCreateShell(
"G4UIXm",
"G4UIXm", topLevelShellWidgetClass, XtDisplay(top), args, 1);
96 form = XmCreateForm(shell, (
char*)menu_str[0].c_str(), NULL, 0);
99 XtSetArg(args[0], XmNtopAttachment, XmATTACH_FORM);
100 XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM);
101 XtSetArg(args[2], XmNrightAttachment, XmATTACH_FORM);
102 menuBar = XmCreateMenuBar(form, (
char*)menu_str[1].c_str(), args, 3);
104 XtSetArg(args[0], XmNtopAttachment, XmATTACH_NONE);
105 XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM);
106 XtSetArg(args[2], XmNrightAttachment, XmATTACH_FORM);
107 XtSetArg(args[3], XmNbottomAttachment, XmATTACH_FORM);
108 command = XmCreateCommand(form, (
char*)menu_str[2].c_str(), args, 4);
109 XtManageChild(command);
111 XtSetArg(args[0], XmNtopAttachment, XmATTACH_NONE);
112 XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM);
113 XtSetArg(args[2], XmNrightAttachment, XmATTACH_FORM);
114 XtSetArg(args[3], XmNbottomAttachment, XmATTACH_WIDGET);
115 XtSetArg(args[4], XmNbottomWidget, command);
116 XmString cps = XmStringLtoRCreate((
char*)menu_str[3].c_str(), (
char*)XmSTRING_DEFAULT_CHARSET);
117 XtSetArg(args[5], XmNlabelString, cps);
118 Widget clearButton = XmCreatePushButton(form, (
char*)menu_str[4].c_str(), args, 6);
120 XtManageChild(clearButton);
122 XtSetArg(args[0], XmNtopAttachment, XmATTACH_WIDGET);
123 XtSetArg(args[1], XmNtopWidget, menuBar);
124 XtSetArg(args[2], XmNleftAttachment, XmATTACH_FORM);
125 XtSetArg(args[3], XmNrightAttachment, XmATTACH_FORM);
126 XtSetArg(args[4], XmNbottomAttachment, XmATTACH_WIDGET);
127 XtSetArg(args[5], XmNbottomWidget, clearButton);
128 XtSetArg(args[6], XmNeditMode, XmMULTI_LINE_EDIT);
129 XtSetArg(args[7], XmNrows, 12);
130 XtSetArg(args[8], XmNcolumns, 80);
131 text = XmCreateScrolledText(form, (
char*)menu_str[5].c_str(), args, 9);
134 XtAddCallback(clearButton, XmNactivateCallback, clearButtonCallback, (XtPointer)text);
135 XtAddCallback(command, XmNcommandEnteredCallback, CommandEnteredCallback, (XtPointer)
this);
137 Widget commandText = XmCommandGetChild(command, XmDIALOG_COMMAND_TEXT);
138 XtAddEventHandler(commandText, KeyPressMask, False, keyHandler, (XtPointer)
this);
140 XtRealizeWidget(shell);