1 /* $XConsortium: SmHelp.c /main/4 1995/10/30 09:35:21 rswiston $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
4 * (c) Copyright 1993, 1994 International Business Machines Corp. *
5 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
6 * (c) Copyright 1993, 1994 Novell, Inc. *
9 /*************************************<+>*************************************
10 *****************************************************************************
14 ** Project: HP DT Session Manager (dtsession)
18 ** This module is in charge of all interaction between the session
19 ** manager and the help subsystem. Anytime the user requests help,
20 ** it goes through this routine.
24 *******************************************************************
25 ** (c) Copyright Hewlett-Packard Company, 1990. All rights are
26 ** reserved. Copying or other reproduction of this program
27 ** except for archival purposes is prohibited without prior
28 ** written consent of Hewlett-Packard Company.
29 ********************************************************************
33 *****************************************************************************
34 *************************************<+>*************************************/
37 #include <X11/Intrinsic.h>
38 #include <X11/Shell.h>
40 #include <Xm/MwmUtil.h>
41 #include <Dt/HelpQuickD.h>
46 #include "SmGlobals.h"
49 #include <X11/apollosys.h>
63 * Local Function Declarations
66 static void CloseHelpDialog (Widget, XtPointer, XtPointer);
70 /*************************************<->*************************************
72 * TopicHelpRequested ()
77 * When a user requests help on a given topic - display that topic in a
78 * new or cached help dialog
83 * client_data - the id that is sent to Cache Creek which tells it which
95 *************************************<->***********************************/
99 XtPointer client_data,
100 XtPointer call_data )
104 char *locationId = (char *) client_data;
105 Widget transientShell;
108 Widget printButton = NULL;
109 Widget helpButton = NULL;
110 Widget backButton = NULL;
111 Widget okButton = NULL;
114 * Find the shell to make this a transient for for
117 while(!XtIsSubclass(transientShell, shellWidgetClass))
119 transientShell = XtParent(transientShell);
122 if((smDD.smHelpDialog != NULL) &&
123 (XtIsManaged(smDD.smHelpDialog)))
130 * Use the help dialog already created if it has been - otherwise
133 if (smDD.smHelpDialog != NULL)
136 XtSetArg(uiArgs[i], DtNlocationId,locationId); i++;
137 XtSetValues(smDD.smHelpDialog, uiArgs, i);
140 XtSetArg(uiArgs[i], XmNtransientFor, transientShell); i++;
141 XtSetValues(XtParent(smDD.smHelpDialog), uiArgs, i);
143 XtManageChild(smDD.smHelpDialog);
148 XtSetArg(uiArgs[i], XmNtitle, GETMESSAGE(29, 1,
149 "Session Manager Help")); i++;
150 XtSetArg (uiArgs[i],DtNhelpVolume, SM_HELP_VOLUME); i++;
151 XtSetArg (uiArgs[i],DtNhelpType, DtHELP_TYPE_TOPIC); i++;
152 XtSetArg (uiArgs[i], DtNlocationId,locationId); i++;
153 smDD.smHelpDialog = DtCreateHelpQuickDialog(smGD.topLevelWid,
154 "helpWidget", uiArgs, i);
157 XtSetArg(uiArgs[i], XmNtransientFor, transientShell); i++;
158 XtSetValues(XtParent(smDD.smHelpDialog), uiArgs, i);
161 XtAddCallback(smDD.smHelpDialog, DtNcloseCallback,
162 CloseHelpDialog, NULL);
164 okButton = DtHelpQuickDialogGetChild(smDD.smHelpDialog,
165 DtHELP_QUICK_CLOSE_BUTTON );
167 XtSetArg (setArgs2[n2], XmNlabelString, smDD.okString); n2++;
168 XtSetValues(okButton, setArgs2, n2);
170 printButton = DtHelpQuickDialogGetChild(smDD.smHelpDialog,
171 DtHELP_QUICK_PRINT_BUTTON );
172 helpButton = DtHelpQuickDialogGetChild(smDD.smHelpDialog,
173 DtHELP_QUICK_HELP_BUTTON );
174 backButton = DtHelpQuickDialogGetChild(smDD.smHelpDialog,
175 DtHELP_QUICK_BACK_BUTTON );
176 XtUnmanageChild(printButton);
177 XtUnmanageChild(helpButton);
178 XtUnmanageChild(backButton);
180 XtAddCallback (XtParent(smDD.smHelpDialog), XmNpopupCallback,
183 XtManageChild(smDD.smHelpDialog);
189 /*************************************<->*************************************
196 * This callback is called when the user wishes to dismiss the help callback
210 *************************************<->***********************************/
212 CloseHelpDialog (Widget w,
213 XtPointer clientData,
216 XtUnmanageChild(smDD.smHelpDialog);