1 /* $XConsortium: HelpCB.c /main/5 1996/03/25 00:51:28 pascale $ */
3 ****************************************************************************
9 ** Description: Contains the callbacks for Help
12 ****************************************************************************/
14 * (c) Copyright 1996 Digital Equipment Corporation.
15 * (c) Copyright 1990, 1996 Hewlett-Packard Company.
16 * (c) Copyright 1996 International Business Machines Corp.
17 * (c) Copyright 1996 Sun Microsystems, Inc.
18 * (c) Copyright 1996 Novell, Inc.
19 * (c) Copyright 1996 FUJITSU LIMITED.
20 * (c) Copyright 1996 Hitachi.
23 #include <Dt/HelpDialog.h>
34 char *helpVolume, *locationId;
37 topic = (int) client_data;
38 helpVolume = HELP_VOLUME;
42 case HELP_MAIN_WINDOW:
43 locationId = HELP_MAIN_WINDOW_STR;
46 locationId = HELP_MENUBAR_STR;
48 case HELP_FILE_BUTTON:
49 locationId = HELP_FILE_BUTTON_STR;
51 case HELP_HELP_BUTTON:
52 locationId = HELP_HELP_BUTTON_STR;
55 locationId = HELP_FILE_MENU_STR;
58 locationId = HELP_HELP_MENU_STR;
61 locationId = HELP_EXIT_STR;
63 case HELP_INTRODUCTION:
64 locationId = HELP_INTRODUCTION_STR;
67 locationId = HELP_TASKS_STR;
70 locationId = HELP_REFERENCE_STR;
73 locationId = HELP_ITEM_STR;
76 locationId = HELP_USING_STR;
77 helpVolume = HELP_USING_HELP_VOLUME;
80 locationId = HELP_VERSION_STR;
82 case HELP_COLOR_BUTTON:
83 locationId = HELP_COLOR_BUTTON_STR;
85 case HELP_FONT_BUTTON:
86 locationId = HELP_FONT_BUTTON_STR;
88 case HELP_BACKDROP_BUTTON:
89 locationId = HELP_BACKDROP_BUTTON_STR;
91 case HELP_KEYBOARD_BUTTON:
92 locationId = HELP_KEYBOARD_BUTTON_STR;
94 case HELP_MOUSE_BUTTON:
95 locationId = HELP_MOUSE_BUTTON_STR;
97 case HELP_AUDIO_BUTTON:
98 locationId = HELP_AUDIO_BUTTON_STR;
100 case HELP_SCREEN_BUTTON:
101 locationId = HELP_SCREEN_BUTTON_STR;
103 case HELP_DTWM_BUTTON:
104 locationId = HELP_DTWM_BUTTON_STR;
106 case HELP_STARTUP_BUTTON:
107 locationId = HELP_STARTUP_BUTTON_STR;
109 case HELP_I18N_BUTTON:
110 locationId = HELP_I18N_BUTTON_STR;
112 case HELP_COLOR_DIALOG:
113 locationId = HELP_COLOR_DIALOG_STR;
115 case HELP_ADD_PALETTE_DIALOG:
116 locationId = HELP_ADD_PALETTE_DIALOG_STR;
118 case HELP_ADD_PALETTE_WARNING_DIALOG:
119 locationId = HELP_ADD_PALETTE_WARNING_DIALOG_STR;
121 case HELP_DELETE_PALETTE_DIALOG:
122 locationId = HELP_DELETE_PALETTE_DIALOG_STR;
124 case HELP_DELETE_PALETTE_WARNING_DIALOG:
125 locationId = HELP_DELETE_PALETTE_WARNING_DIALOG_STR;
127 case HELP_MODIFY_PALETTE_DIALOG:
128 locationId = HELP_MODIFY_PALETTE_DIALOG_STR;
130 case HELP_COLOR_USE_DIALOG:
131 locationId = HELP_COLOR_USE_DIALOG_STR;
133 case HELP_FONT_DIALOG:
134 locationId = HELP_FONT_DIALOG_STR;
136 case HELP_BACKDROP_DIALOG:
137 locationId = HELP_BACKDROP_DIALOG_STR;
139 case HELP_KEYBOARD_DIALOG:
140 locationId = HELP_KEYBOARD_DIALOG_STR;
142 case HELP_MOUSE_DIALOG:
143 locationId = HELP_MOUSE_DIALOG_STR;
145 case HELP_AUDIO_DIALOG:
146 locationId = HELP_AUDIO_DIALOG_STR;
148 case HELP_SCREEN_DIALOG:
149 locationId = HELP_SCREEN_DIALOG_STR;
151 case HELP_DTWM_DIALOG:
152 locationId = HELP_DTWM_DIALOG_STR;
154 case HELP_STARTUP_DIALOG:
155 locationId = HELP_STARTUP_DIALOG_STR;
157 case HELP_I18N_DIALOG:
158 locationId = HELP_I18N_DIALOG_STR;
162 Help(helpVolume, locationId);
182 switch(DtHelpReturnSelectedWidgetId(style.shell, (Cursor)NULL, &widget))
185 * There are additional cases (e.g. user aborts request) but I
186 * don't feel they warrant an error dialog.
188 case DtHELP_SELECT_VALID:
190 while (!XtIsShell(widget))
192 if (XtHasCallbacks(widget, XmNhelpCallback) == XtCallbackHasSome)
194 XtCallCallbacks(widget, XmNhelpCallback, (XtPointer)NULL);
197 widget = XtParent(widget);
201 case DtHELP_SELECT_INVALID:
203 ErrDialog((char *)GETMESSAGE(2, 8, "You must select an item\nwithin the Style Manager."), style.shell);
215 DtHelpDialogCallbackStruct *pHyper =
216 (DtHelpDialogCallbackStruct *) call_data;
218 switch(pHyper->hyperType)
220 case DtHELP_LINK_JUMP_NEW:
221 DisplayHelp(pHyper->helpVolume, pHyper->locationId);
225 /* application defined link code goes here */
236 HelpStruct *pHelpCache = (HelpStruct *)client_data;
240 * empty for loop just marches pHelp to the right place
242 for(pHelp = pHelpCache;
243 pHelp != (HelpStruct *)NULL && pHelp->dialog != w;
244 pHelp = pHelp->pNext);
246 if(pHelp != (HelpStruct *)NULL)
248 /* this should always happen */
249 pHelp->inUse = False;
252 XtUnmapWidget(XtParent(w));