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 /* $XConsortium: HelpCB.c /main/5 1996/03/25 00:51:28 pascale $ */
25 ****************************************************************************
31 ** Description: Contains the callbacks for Help
34 ****************************************************************************/
36 * (c) Copyright 1996 Digital Equipment Corporation.
37 * (c) Copyright 1990, 1996 Hewlett-Packard Company.
38 * (c) Copyright 1996 International Business Machines Corp.
39 * (c) Copyright 1996 Sun Microsystems, Inc.
40 * (c) Copyright 1996 Novell, Inc.
41 * (c) Copyright 1996 FUJITSU LIMITED.
42 * (c) Copyright 1996 Hitachi.
45 #include <Dt/HelpDialog.h>
56 char *helpVolume, *locationId;
59 topic = (int) client_data;
60 helpVolume = HELP_VOLUME;
64 case HELP_MAIN_WINDOW:
65 locationId = HELP_MAIN_WINDOW_STR;
68 locationId = HELP_MENUBAR_STR;
70 case HELP_FILE_BUTTON:
71 locationId = HELP_FILE_BUTTON_STR;
73 case HELP_HELP_BUTTON:
74 locationId = HELP_HELP_BUTTON_STR;
77 locationId = HELP_FILE_MENU_STR;
80 locationId = HELP_HELP_MENU_STR;
83 locationId = HELP_EXIT_STR;
85 case HELP_INTRODUCTION:
86 locationId = HELP_INTRODUCTION_STR;
89 locationId = HELP_TASKS_STR;
92 locationId = HELP_REFERENCE_STR;
95 locationId = HELP_ITEM_STR;
98 locationId = HELP_USING_STR;
99 helpVolume = HELP_USING_HELP_VOLUME;
102 locationId = HELP_VERSION_STR;
104 case HELP_COLOR_BUTTON:
105 locationId = HELP_COLOR_BUTTON_STR;
107 case HELP_FONT_BUTTON:
108 locationId = HELP_FONT_BUTTON_STR;
110 case HELP_BACKDROP_BUTTON:
111 locationId = HELP_BACKDROP_BUTTON_STR;
113 case HELP_KEYBOARD_BUTTON:
114 locationId = HELP_KEYBOARD_BUTTON_STR;
116 case HELP_MOUSE_BUTTON:
117 locationId = HELP_MOUSE_BUTTON_STR;
119 case HELP_AUDIO_BUTTON:
120 locationId = HELP_AUDIO_BUTTON_STR;
122 case HELP_SCREEN_BUTTON:
123 locationId = HELP_SCREEN_BUTTON_STR;
125 case HELP_DTWM_BUTTON:
126 locationId = HELP_DTWM_BUTTON_STR;
128 case HELP_STARTUP_BUTTON:
129 locationId = HELP_STARTUP_BUTTON_STR;
131 case HELP_I18N_BUTTON:
132 locationId = HELP_I18N_BUTTON_STR;
134 case HELP_COLOR_DIALOG:
135 locationId = HELP_COLOR_DIALOG_STR;
137 case HELP_ADD_PALETTE_DIALOG:
138 locationId = HELP_ADD_PALETTE_DIALOG_STR;
140 case HELP_ADD_PALETTE_WARNING_DIALOG:
141 locationId = HELP_ADD_PALETTE_WARNING_DIALOG_STR;
143 case HELP_DELETE_PALETTE_DIALOG:
144 locationId = HELP_DELETE_PALETTE_DIALOG_STR;
146 case HELP_DELETE_PALETTE_WARNING_DIALOG:
147 locationId = HELP_DELETE_PALETTE_WARNING_DIALOG_STR;
149 case HELP_MODIFY_PALETTE_DIALOG:
150 locationId = HELP_MODIFY_PALETTE_DIALOG_STR;
152 case HELP_COLOR_USE_DIALOG:
153 locationId = HELP_COLOR_USE_DIALOG_STR;
155 case HELP_FONT_DIALOG:
156 locationId = HELP_FONT_DIALOG_STR;
158 case HELP_BACKDROP_DIALOG:
159 locationId = HELP_BACKDROP_DIALOG_STR;
161 case HELP_KEYBOARD_DIALOG:
162 locationId = HELP_KEYBOARD_DIALOG_STR;
164 case HELP_MOUSE_DIALOG:
165 locationId = HELP_MOUSE_DIALOG_STR;
167 case HELP_AUDIO_DIALOG:
168 locationId = HELP_AUDIO_DIALOG_STR;
170 case HELP_SCREEN_DIALOG:
171 locationId = HELP_SCREEN_DIALOG_STR;
173 case HELP_DTWM_DIALOG:
174 locationId = HELP_DTWM_DIALOG_STR;
176 case HELP_STARTUP_DIALOG:
177 locationId = HELP_STARTUP_DIALOG_STR;
179 case HELP_I18N_DIALOG:
180 locationId = HELP_I18N_DIALOG_STR;
184 Help(helpVolume, locationId);
204 switch(DtHelpReturnSelectedWidgetId(style.shell, (Cursor)NULL, &widget))
207 * There are additional cases (e.g. user aborts request) but I
208 * don't feel they warrant an error dialog.
210 case DtHELP_SELECT_VALID:
212 while (!XtIsShell(widget))
214 if (XtHasCallbacks(widget, XmNhelpCallback) == XtCallbackHasSome)
216 XtCallCallbacks(widget, XmNhelpCallback, (XtPointer)NULL);
219 widget = XtParent(widget);
223 case DtHELP_SELECT_INVALID:
225 ErrDialog((char *)GETMESSAGE(2, 8, "You must select an item\nwithin the Style Manager."), style.shell);
237 DtHelpDialogCallbackStruct *pHyper =
238 (DtHelpDialogCallbackStruct *) call_data;
240 switch(pHyper->hyperType)
242 case DtHELP_LINK_JUMP_NEW:
243 DisplayHelp(pHyper->helpVolume, pHyper->locationId);
247 /* application defined link code goes here */
258 HelpStruct *pHelpCache = (HelpStruct *)client_data;
262 * empty for loop just marches pHelp to the right place
264 for(pHelp = pHelpCache;
265 pHelp != (HelpStruct *)NULL && pHelp->dialog != w;
266 pHelp = pHelp->pNext);
268 if(pHelp != (HelpStruct *)NULL)
270 /* this should always happen */
271 pHelp->inUse = False;
274 XtUnmapWidget(XtParent(w));