3
#include <X11/Intrinsic.h>
5
#include <X11/StringDefs.h>
6
#include <X11/Xaw/Command.h>
7
#include <X11/Xaw/Form.h>
8
#include <X11/Xaw/AsciiText.h>
10
#include "metaconst.h"
15
extern void GetMetanetGeometry();
16
extern char beginHelp[];
17
extern char studyHelp[];
18
extern char modifyHelp[];
20
void HelpClose(w,shell,callData)
25
XtPopdown((Widget)shell);
26
XtDestroyWidget((Widget)shell);
29
void DisplayHelp(file)
34
Widget shell, helpclose, help;
35
XtCallbackRec callbacks[2];
40
callbacks[1].callback = NULL;
41
callbacks[1].closure = NULL;
43
GetMetanetGeometry(&x,&y,&w,&h);
44
strcpy(str,"12345678901234567890123456789012345678901234567890123456789012345678901234567890"); /* 80 characters string */
45
helpwidth = XTextWidth(theG.helpfont,str,strlen(str));
46
if (helpwidth > metaWidth) helpwidth = metaWidth;
48
XtSetArg(args[iargs], XtNx, x + incX); iargs++;
49
XtSetArg(args[iargs], XtNy, y + incY); iargs++;
50
XtSetArg(args[iargs], XtNfont, theG.helpfont); iargs++;
51
shell = XtCreatePopupShell("Metanet Help",transientShellWidgetClass,toplevel,
55
XtSetArg(args[iargs], XtNfont, theG.helpfont); iargs++;
56
help = XtCreateManagedWidget("helpform",formWidgetClass,shell,args,iargs);
58
callbacks[0].callback = (XtCallbackProc)HelpClose;
59
callbacks[0].closure = (caddr_t)shell;
61
XtSetArg(args[iargs], XtNlabel, "Close" ); iargs++;
62
XtSetArg(args[iargs], XtNcallback, callbacks); iargs++;
63
XtSetArg(args[iargs], XtNfont, theG.helpfont); iargs++;
64
XtSetArg(args[iargs], XtNbottom, XawChainTop); iargs++;
65
XtSetArg(args[iargs], XtNtop, XawChainTop); iargs++;
66
XtSetArg(args[iargs], XtNleft, XawChainLeft); iargs++;
67
XtSetArg(args[iargs], XtNright, XawChainLeft); iargs++;
68
helpclose = XtCreateManagedWidget("helpcommand",commandWidgetClass,
72
XtSetArg(args[iargs], XtNtype, XawAsciiFile); iargs++;
73
XtSetArg(args[iargs], XtNstring, file); iargs++;
74
XtSetArg(args[iargs], XtNborderWidth, 1); iargs++;
75
XtSetArg(args[iargs], XtNeditType, XawtextRead); iargs++;
76
XtSetArg(args[iargs], XtNscrollVertical, XawtextScrollWhenNeeded); iargs++;
77
XtSetArg(args[iargs], XtNscrollHorizontal, XawtextScrollWhenNeeded); iargs++;
78
XtSetArg(args[iargs], XtNwidth, helpwidth); iargs++;
79
XtSetArg(args[iargs], XtNheight, metaHeight/2); iargs++;
80
XtSetArg(args[iargs], XtNfont, theG.helpfont); iargs++;
81
XtSetArg(args[iargs], XtNfromVert, helpclose); iargs++;
82
XtCreateManagedWidget("asciitext",asciiTextWidgetClass,
85
XtPopup(shell,XtGrabNone);
88
void DisplayBeginHelp()
90
DisplayHelp(beginHelp);
93
void DisplayStudyHelp()
95
DisplayHelp(studyHelp);
98
void DisplayModifyHelp()
100
DisplayHelp(modifyHelp);