1 /*******************************************************************************
5 ** $XConsortium: help.c /main/7 1996/04/19 15:47:41 rswiston $
7 ** RESTRICTED CONFIDENTIAL INFORMATION:
9 ** The information in this document is subject to special
10 ** restrictions in a confidential disclosure agreement between
11 ** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
12 ** document outside HP, IBM, Sun, USL, SCO, or Univel without
13 ** Sun's specific written approval. This document and all copies
14 ** and derivative works thereof must be returned or destroyed at
17 ** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
19 *******************************************************************************/
22 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
23 * (c) Copyright 1993, 1994 International Business Machines Corp. *
24 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
25 * (c) Copyright 1993, 1994 Novell, Inc. *
29 static char sccsid[] = "@(#)help.c 1.19 95/03/28 Copyr 1991 Sun Microsystems, Inc.";
32 #include <EUSCompat.h>
36 #include <sys/param.h> /* MAXPATHLEN defined here */
38 #include <sys/utsname.h> /* SYS_NMLN */
39 #endif /* SVR4 specific includes */
44 #include <sys/signal.h>
46 #include <sys/resource.h>
48 #include <netinet/in.h>
52 #include <Xm/LabelG.h>
54 #include <Xm/DialogS.h>
55 #include <Xm/PushBG.h>
56 #include <Xm/RowColumn.h>
58 #include <Xm/SeparatoG.h>
61 #include <Xm/ToggleB.h>
62 #include <Xm/ToggleBG.h>
63 #include <Dt/HourGlass.h>
64 #include <Dt/HelpDialog.h>
70 static void display_help(Calendar *, ArgList, int);
73 display_help(Calendar *c, ArgList args, int nargs)
75 if (!c->mainhelpdialog)
78 char *title = XtNewString(catgets(c->DT_catd, 1, 1076, "Calendar : Help"));
80 XtSetArg(oneArg, XmNtitle, title);
82 (Widget)DtCreateHelpDialog(c->frame, "mainhelpdialog", &oneArg, 1);
86 XtSetValues(c->mainhelpdialog, args, nargs);
87 XtManageChild(c->mainhelpdialog);
90 void show_main_help(Widget w, XtPointer clientData, XtPointer cbs)
94 Calendar *c = calendar;
95 Props_pu *p = (Props_pu *) c->properties_pu;
96 Widget selWidget = NULL;
97 int status = DtHELP_SELECT_ERROR;
100 XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
101 switch ((int)clientData) {
103 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
104 XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
107 XtSetArg(al[ac], DtNhelpVolume, "Help4Help"); ac++;
108 XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
111 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
112 XtSetArg(al[ac], DtNlocationId, "TASKS"); ac++;
115 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
116 XtSetArg(al[ac], DtNlocationId, "REFERENCE"); ac++;
118 case HELP_ABOUTCALENDAR:
119 XtSetArg(al[ac], DtNhelpVolume, "Help4Help"); ac++;
120 XtSetArg(al[ac], DtNlocationId, "_COPYRIGHT"); ac++;
123 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
124 XtSetArg(al[ac], DtNlocationId, "TOC"); ac++;
127 while (!XtIsSubclass(w, applicationShellWidgetClass))
130 status = DtHelpReturnSelectedWidgetId(w, NULL, &selWidget);
133 case DtHELP_SELECT_ERROR:
134 printf(catgets(c->DT_catd, 1, 350, "Selection Error, cannot continue\n"));
136 case DtHELP_SELECT_VALID:
137 while (selWidget != NULL)
139 if ((XtHasCallbacks(selWidget, XmNhelpCallback) == XtCallbackHasSome))
141 XtCallCallbacks((Widget)selWidget,
142 XmNhelpCallback,NULL);
146 selWidget = XtParent(selWidget);
149 case DtHELP_SELECT_ABORT:
152 case DtHELP_SELECT_INVALID:
154 char *title = XtNewString(catgets(c->DT_catd, 1, 110, "Calendar : Error - Help"));
155 char *text = XtNewString(catgets(c->DT_catd, 1, 352, "You must select a component within your application."));
156 char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
157 dialog_popup(c->frame,
160 BUTTON_IDENT, 1, ident1,
161 DIALOG_IMAGE, p->xm_error_pixmap,
173 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
174 XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
178 display_help(c, al, ac);
182 help_cb(Widget w, XtPointer clientData, XtPointer callData)
186 Calendar *c = calendar;
187 char *locationid = (char *) clientData;
190 XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
191 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
192 XtSetArg(al[ac], DtNlocationId, locationid); ac++;
194 display_help(c, al, ac);
197 /* special case where we must determine the view */
199 help_view_cb(Widget w, XtPointer clientData, XtPointer callData)
201 Calendar *c = calendar;
203 switch (c->view->glance) {
205 help_cb(w, (XtPointer)CALENDAR_HELP_DAY_WINDOW, callData);
208 help_cb(w, (XtPointer)CALENDAR_HELP_WEEK_WINDOW, callData);
211 help_cb(w, (XtPointer)CALENDAR_HELP_MONTH_WINDOW, callData);