-
Notifications
You must be signed in to change notification settings - Fork 1
/
ezwhelp.c
366 lines (300 loc) · 14.6 KB
/
ezwhelp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
/*
* ezwhelp.c
*
* Routines related to the EZ help widget for xdisp
* (imlemented using EZwgl).
*
* Initialize_Help_Widget()
* Open_Help_Widget()
* Close_Help_Widget()
* EZW_Online_Help()
*
* Copyright Bruce Pike, 1993-2000
*/
#include "xdisp.h"
/*-------------------- Initialize_Help_Widget() ---------------------*/
void Initialize_Help_Widget()
{
EZ_Widget *tmp_w1, *tmp_w2;
/* create and configure the help display widget */
Help_Widget = EZ_CreateFrame(NULL, fname);
EZ_ConfigureWidget(Help_Widget,
EZ_PADX, 0,
EZ_PADY, 0,
EZ_STACKING, EZ_VERTICAL,
EZ_WIDTH, 650, EZ_HEIGHT, 500,
EZ_FILL_MODE, EZ_FILL_BOTH,
EZ_LABEL_STRING, "Help",
0);
tmp_w1 = EZ_CreateFrame(Help_Widget, NULL);
EZ_ConfigureWidget(tmp_w1,
EZ_PADX, 8,
EZ_PADY, 0,
EZ_EXPAND, True,
EZ_HEIGHT, 0,
EZ_STACKING, EZ_HORIZONTAL_LEFT,
0);
Help_Close_Button = EZ_CreateButton(tmp_w1,"Close",-1);
/* create a widget for the actual help text */
tmp_w2 = EZ_CreateFrame(Help_Widget, NULL);
EZ_ConfigureWidget(tmp_w2,
EZ_FILL_MODE, EZ_FILL_BOTH,
0);
Help_Text_Widget = EZ_CreateTextWidget(tmp_w2,0,1,1);
/* define the help text */
EZW_Online_Help();
/* add the callback for shutdown of the help widget */
EZ_AddWidgetCallBack(Help_Close_Button,
EZ_CALLBACK, Close_Help_Widget, NULL,0);
/* set WM hints for user placement */
EZ_SetWMHintsAndSizeHints(File_Save_Widget, 0);
}
/*---------------------- Open_Help_Widget() ------------------------*/
int Open_Help_Widget()
{
/* activate and display the widget */
EZ_ActivateWidget(Help_Widget);
EZ_DisplayWidget(Help_Widget);
/* force the title we want */
XStoreName(theDisp,EZ_GetWidgetWindow(Help_Widget),"xdisp: Help\0");
}
/*-------------------- Close_Help_Widget() --------------------------*/
void Close_Help_Widget()
{
EZ_DeActivateWidget(Help_Widget);
}
/*--------------------- EZW_Online_Help() ---------------------------*/
int EZW_Online_Help()
{
EZ_TextProperty *title=NULL,
*command=NULL,
*plain=NULL;
char str[1024];
/* get text properties */
title = EZ_GetTextProperty(EZ_FONT_NAME,
"-Adobe-Helvetica-Bold-R-Normal-*-14-*-*-*-*-*-*-*",
EZ_FOREGROUND, "red", 0);
command = EZ_GetTextProperty(EZ_FONT_NAME,
"-*-Courier-bold-r-normal-*-*-*-*-*-*-*-*-*",
EZ_FOREGROUND, "blue", 0);
plain = EZ_GetTextProperty(EZ_FONT_NAME,
"-*-Courier-medium-r-normal-*-12-*-*-*-*-*-*-*",
EZ_FOREGROUND, "black", 0);
/* start pumping out the text */
sprintf(str,"xdisp (%s): An image display utility for X systems.\n\n",version);
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, title);
sprintf(str,"xdisp uses two primary windows: an ");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"image ");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str,"window and a ");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"command ");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str,"window.\n\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"The image window is always open (unless it has been explicitly iconified) whereas\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"the command window is, by default, closed. Within the image window, pressing the\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"right mouse button opens or closes the command window. Moving the mouse with the\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"middle mouse button depressed changes the image window/level. Moving the mouse\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"with the left button depressed draws an ROI on the image. In the command window\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"are multiple buttons and sliders with variuos (hopefully self evident) functions.\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"Within the image window the following keys are defined:\n\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," q");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> quit\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," a");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> auto-scale image\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," b");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> toggle the color bar state\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," B");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> save image to file in byte format\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," c");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> crop image to current roi size\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," C");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> cycle through color maps (grey, hot metal, spectral)\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," d");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> toggle current volume dimension\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," f");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> output image to an ecapsulated postscript (EPSF) file\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," G");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> create a GIF file\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," h");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> this help text\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," H");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> this help text\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," i");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> toggle between bilinear and nearest neighbour interpolation\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," l");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> load all images from file\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," L");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> enter Lower value for color map\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," m");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> calculate maximum intensity projection image\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," M");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> save image to a file in matlab format\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> reload image as a new file\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," o");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> reorient entire volume\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," p");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> print image\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," P");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> suspend plotting\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," r");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> rescale image to current window/level range\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," R");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> refresh image (erase any overlays)\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," s");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> image statistics\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," S");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> save image to file in short integer format\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," t");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> toggle (invert) greyscale\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," T");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> create a TIFF file\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," u");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> unzoom image (restore original size)\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," U");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> enter Upper value for color map\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," v");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> print version number\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," w");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> toggle window/level display\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," +");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> increment image number by 1\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," -");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> decrement image number by 1\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," *");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> increment image number by 10\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," /");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> decrement image number by 10\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ?");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> this help text\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," x/X");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> shrink/enlarge image width by a factor of 2\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," y/Y");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> shrink/enlarge image height by a factor of 2\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," z/Z");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> shrink/enlarge image by a factor of 2\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^T");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> toggle external roi display state\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^h/^v");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> horizontal/vertical profiles\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^X/^Y");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> flip in x/y direction\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^F");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> open file selector to load new image\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^I");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> open minc header information window\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^S");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> open file selector to spawn a new xdisp\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^P");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> plot a time intensity curve for the current ROI\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str," ^R");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
sprintf(str," -> rotate image clockwise\n\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"More detailed information on the operation of xdisp and a complete listing of\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"command line options can be found in the man pages.\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, plain);
sprintf(str,"\n\nB Pike \nbruce@bic.mni.mcgill.ca\n");
EZ_TextInsertStringWithProperty(Help_Text_Widget, str, command);
}