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 /*******************************************************************************
27 ** $XConsortium: help.c /main/7 1996/04/19 15:47:41 rswiston $
29 ** RESTRICTED CONFIDENTIAL INFORMATION:
31 ** The information in this document is subject to special
32 ** restrictions in a confidential disclosure agreement between
33 ** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
34 ** document outside HP, IBM, Sun, USL, SCO, or Univel without
35 ** Sun's specific written approval. This document and all copies
36 ** and derivative works thereof must be returned or destroyed at
39 ** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
41 *******************************************************************************/
44 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
45 * (c) Copyright 1993, 1994 International Business Machines Corp. *
46 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
47 * (c) Copyright 1993, 1994 Novell, Inc. *
51 static char sccsid[] = "@(#)help.c 1.19 95/03/28 Copyr 1991 Sun Microsystems, Inc.";
54 #include <EUSCompat.h>
58 #include <sys/param.h> /* MAXPATHLEN defined here */
60 #include <sys/utsname.h> /* SYS_NMLN */
61 #endif /* SVR4 specific includes */
66 #include <sys/signal.h>
68 #include <sys/resource.h>
70 #include <netinet/in.h>
74 #include <Xm/LabelG.h>
76 #include <Xm/DialogS.h>
77 #include <Xm/PushBG.h>
78 #include <Xm/RowColumn.h>
80 #include <Xm/SeparatoG.h>
83 #include <Xm/ToggleB.h>
84 #include <Xm/ToggleBG.h>
85 #include <Dt/HourGlass.h>
86 #include <Dt/HelpDialog.h>
92 static void display_help(Calendar *, ArgList, int);
95 display_help(Calendar *c, ArgList args, int nargs)
97 if (!c->mainhelpdialog)
100 char *title = XtNewString(catgets(c->DT_catd, 1, 1076, "Calendar : Help"));
102 XtSetArg(oneArg, XmNtitle, title);
104 (Widget)DtCreateHelpDialog(c->frame, "mainhelpdialog", &oneArg, 1);
108 XtSetValues(c->mainhelpdialog, args, nargs);
109 XtManageChild(c->mainhelpdialog);
112 void show_main_help(Widget w, XtPointer clientData, XtPointer cbs)
116 Calendar *c = calendar;
117 Props_pu *p = (Props_pu *) c->properties_pu;
118 Widget selWidget = NULL;
119 int status = DtHELP_SELECT_ERROR;
122 XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
123 switch ((intptr_t)clientData) {
125 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
126 XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
129 XtSetArg(al[ac], DtNhelpVolume, "Help4Help"); ac++;
130 XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
133 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
134 XtSetArg(al[ac], DtNlocationId, "TASKS"); ac++;
137 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
138 XtSetArg(al[ac], DtNlocationId, "REFERENCE"); ac++;
140 case HELP_ABOUTCALENDAR:
141 XtSetArg(al[ac], DtNhelpVolume, "Help4Help"); ac++;
142 XtSetArg(al[ac], DtNlocationId, "_COPYRIGHT"); ac++;
145 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
146 XtSetArg(al[ac], DtNlocationId, "TOC"); ac++;
149 while (!XtIsSubclass(w, applicationShellWidgetClass))
152 status = DtHelpReturnSelectedWidgetId(w, 0, &selWidget);
155 case DtHELP_SELECT_ERROR:
156 printf("%s", catgets(c->DT_catd, 1, 350, "Selection Error, cannot continue\n"));
158 case DtHELP_SELECT_VALID:
159 while (selWidget != NULL)
161 if ((XtHasCallbacks(selWidget, XmNhelpCallback) == XtCallbackHasSome))
163 XtCallCallbacks((Widget)selWidget,
164 XmNhelpCallback,NULL);
168 selWidget = XtParent(selWidget);
171 case DtHELP_SELECT_ABORT:
174 case DtHELP_SELECT_INVALID:
176 char *title = XtNewString(catgets(c->DT_catd, 1, 110, "Calendar : Error - Help"));
177 char *text = XtNewString(catgets(c->DT_catd, 1, 352, "You must select a component within your application."));
178 char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue"));
179 dialog_popup(c->frame,
182 BUTTON_IDENT, 1, ident1,
183 DIALOG_IMAGE, p->xm_error_pixmap,
195 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
196 XtSetArg(al[ac], DtNlocationId, "_HOMETOPIC"); ac++;
200 display_help(c, al, ac);
204 help_cb(Widget w, XtPointer clientData, XtPointer callData)
208 Calendar *c = calendar;
209 char *locationid = (char *) clientData;
212 XtSetArg(al[ac], DtNhelpType, DtHELP_TYPE_TOPIC); ac++;
213 XtSetArg(al[ac], DtNhelpVolume, "Calendar"); ac++;
214 XtSetArg(al[ac], DtNlocationId, locationid); ac++;
216 display_help(c, al, ac);
219 /* special case where we must determine the view */
221 help_view_cb(Widget w, XtPointer clientData, XtPointer callData)
223 Calendar *c = calendar;
225 switch (c->view->glance) {
227 help_cb(w, (XtPointer)CALENDAR_HELP_DAY_WINDOW, callData);
230 help_cb(w, (XtPointer)CALENDAR_HELP_WEEK_WINDOW, callData);
233 help_cb(w, (XtPointer)CALENDAR_HELP_MONTH_WINDOW, callData);