1*17283Sopcode /*
2*17283Sopcode  * @(#)help.c	1.1	10/21/84
3*17283Sopcode  *
4*17283Sopcode  * Routines to provide help screens for the SUN Gremlin picture editor.
5*17283Sopcode  *
6*17283Sopcode  * Mark Opperman (opcode@monet.BERKELEY)
7*17283Sopcode  *
8*17283Sopcode  */
9*17283Sopcode 
10*17283Sopcode #include <suntool/tool_hs.h>
11*17283Sopcode #include "gremlin.h"
12*17283Sopcode #include "icondata.h"
13*17283Sopcode 
14*17283Sopcode /* imports from main.c */
15*17283Sopcode 
16*17283Sopcode extern struct pixwin *pix_pw;
17*17283Sopcode extern struct rect pix_size;
18*17283Sopcode extern struct pixrect *scratch_pr;
19*17283Sopcode extern struct pixfont *text_pf;
20*17283Sopcode extern pix_fd;
21*17283Sopcode extern menu_fd;
22*17283Sopcode extern text_fd;
23*17283Sopcode extern tool_fd;
24*17283Sopcode 
25*17283Sopcode /* imports from sun.c */
26*17283Sopcode 
27*17283Sopcode extern get_any_button();
28*17283Sopcode 
29*17283Sopcode /* locals */
30*17283Sopcode 
31*17283Sopcode static help_x, help_y;		/* current position on help screen */
32*17283Sopcode 
33*17283Sopcode #define help_dy  (text_pf->pf_defaultsize.y)
34*17283Sopcode #define HELP_LEFT 8
35*17283Sopcode #define HELP_SKIP 16
36*17283Sopcode 
37*17283Sopcode 
38*17283Sopcode /*
39*17283Sopcode  * Display a help screen consisting of a pixrect, a title and some text.
40*17283Sopcode  * The current picture is saved in the scratch pixrect before displaying
41*17283Sopcode  * the help screen.  After the user presses a mouse button, the picture
42*17283Sopcode  * is restored and processing continues.
43*17283Sopcode  */
44*17283Sopcode static
45*17283Sopcode help_screen(icon_pr, title, text)
46*17283Sopcode struct pixrect *icon_pr;
47*17283Sopcode char *title, *text;
48*17283Sopcode {
49*17283Sopcode     /* save current display */
50*17283Sopcode     pw_read(scratch_pr, 0, 0, pix_size.r_width, pix_size.r_height, PIX_SRC,
51*17283Sopcode 			pix_pw, 0, 0);
52*17283Sopcode 
53*17283Sopcode     /* clear picture subwindow before help screen display */
54*17283Sopcode     pw_writebackground(pix_pw, 0, 0, 2000, 2000, PIX_SRC);
55*17283Sopcode 
56*17283Sopcode     help_x = HELP_LEFT;
57*17283Sopcode     help_y = 8;
58*17283Sopcode 
59*17283Sopcode     /* display icon if not a NULL pointer */
60*17283Sopcode     if (icon_pr != NULL) {
61*17283Sopcode 	pw_write(pix_pw, help_x, help_y, icon_pr->pr_size.x, icon_pr->pr_size.y,
62*17283Sopcode 			 PIX_SRC, icon_pr, 0, 0);
63*17283Sopcode 	help_x += icon_pr->pr_size.x + HELP_SKIP;
64*17283Sopcode 	help_message(title);
65*17283Sopcode 	help_y += icon_pr->pr_size.y + HELP_SKIP;
66*17283Sopcode     }
67*17283Sopcode     else {
68*17283Sopcode 	help_message(title);
69*17283Sopcode 	help_y += help_dy + HELP_SKIP;
70*17283Sopcode     }
71*17283Sopcode 
72*17283Sopcode     help_x = HELP_LEFT;
73*17283Sopcode     help_message(text);
74*17283Sopcode 
75*17283Sopcode     help_y += HELP_SKIP;
76*17283Sopcode     help_x = HELP_LEFT;
77*17283Sopcode     help_message("Press a mouse button to continue.");
78*17283Sopcode 
79*17283Sopcode     /* wait for mouse button in any subwindow or tool border */
80*17283Sopcode     get_any_button();
81*17283Sopcode 
82*17283Sopcode     /* restore picture subwindow */
83*17283Sopcode     pw_write(pix_pw, 0, 0, pix_size.r_width, pix_size.r_height, PIX_SRC,
84*17283Sopcode 			scratch_pr, 0, 0);
85*17283Sopcode }
86*17283Sopcode 
87*17283Sopcode 
88*17283Sopcode /*
89*17283Sopcode  * A simple text display tool for help messages.
90*17283Sopcode  * Text is displayed at the current help location (help_x, help_y).
91*17283Sopcode  * Newlines within the text string are handled appropriately.
92*17283Sopcode  * Maximum line length (between newlines) is 80 characters, although
93*17283Sopcode  * only about 64 can be displayed on the default Gremlin screen.
94*17283Sopcode  */
95*17283Sopcode static
96*17283Sopcode help_message(text)
97*17283Sopcode char *text;
98*17283Sopcode {
99*17283Sopcode     char buf[80];
100*17283Sopcode     register i;
101*17283Sopcode 
102*17283Sopcode     while (*text != '\0') {
103*17283Sopcode 	i = 0;
104*17283Sopcode 
105*17283Sopcode 	while ((*text != '\n') && (*text != '\0'))
106*17283Sopcode 	    buf[i++] = *text++;
107*17283Sopcode 	buf[i] = '\0';
108*17283Sopcode 
109*17283Sopcode 	if (*text == '\n')
110*17283Sopcode 	    text++;
111*17283Sopcode 
112*17283Sopcode 	pw_text(pix_pw, help_x, help_y + TEXT_BASELINE + 2, PIX_SRC,
113*17283Sopcode 							    text_pf, buf);
114*17283Sopcode 	help_y += help_dy;
115*17283Sopcode     }
116*17283Sopcode }
117*17283Sopcode 
118*17283Sopcode 
119*17283Sopcode static char help_HELP[] = "\
120*17283Sopcode The three subwindows in Gremlin are used for text entry,\n\
121*17283Sopcode menu display and command selection, and picture display.\n\
122*17283Sopcode In addition, the normal tool manager pop-up menu is available\n\
123*17283Sopcode from the tool borders.\n\
124*17283Sopcode \n\
125*17283Sopcode In the menu subwindow, the left mouse button is used to\n\
126*17283Sopcode invoke commands after selecting the appropriate icon, the\n\
127*17283Sopcode middle mouse button is used to effect the same command on\n\
128*17283Sopcode only the current set (where appropriate), and the right mouse\n\
129*17283Sopcode button provides a help screen for the icon.\n\
130*17283Sopcode \n\
131*17283Sopcode In the picture subwindow, the left mouse button is used to\n\
132*17283Sopcode lay down points, the middle mouse button erases points in the\n\
133*17283Sopcode opposite order from which they were layed down, and the right\n\
134*17283Sopcode mouse button provides a help screen.\n\
135*17283Sopcode \n\
136*17283Sopcode In the text subwindow, command arguments (when required)\n\
137*17283Sopcode are entered from the keyboard.  Arguments must be entered\n\
138*17283Sopcode before the command is selected.  Simple editing commands\n\
139*17283Sopcode (backspace, line and word delete) can be used to modify the\n\
140*17283Sopcode argument.  Again, the right mouse button provides a help\n\
141*17283Sopcode screen display.";
142*17283Sopcode 
143*17283Sopcode help()
144*17283Sopcode {
145*17283Sopcode     help_screen(&question_pr, "Help ('?')", help_HELP);
146*17283Sopcode }
147*17283Sopcode 
148*17283Sopcode 
149*17283Sopcode static char justify_HELP[] = "\
150*17283Sopcode Select text justification by moving marker to one of nine\n\
151*17283Sopcode positioning points within the JUSTIFY icon and pressing the\n\
152*17283Sopcode left mouse button.\n\
153*17283Sopcode \n\
154*17283Sopcode Modify justification of text in the current set by moving the\n\
155*17283Sopcode marker as above and then pressing the middle mouse button.\n\
156*17283Sopcode \n\
157*17283Sopcode When text is displayed in the current set, its justification\n\
158*17283Sopcode mode is indicated by a small dot.";
159*17283Sopcode 
160*17283Sopcode justify_help()
161*17283Sopcode {
162*17283Sopcode     help_screen(&justify_pr, "Text Justification", justify_HELP);
163*17283Sopcode }
164*17283Sopcode 
165*17283Sopcode 
166*17283Sopcode static char size1_HELP[] = "\n\
167*17283Sopcode Set the default font size to one with the left mouse button.\n\
168*17283Sopcode \n\
169*17283Sopcode Modify text in the current set to size one with the middle\n\
170*17283Sopcode mouse button.";
171*17283Sopcode 
172*17283Sopcode size1_help()
173*17283Sopcode {
174*17283Sopcode     help_screen(&size1_pr, "Set Text Size One", size1_HELP);
175*17283Sopcode }
176*17283Sopcode 
177*17283Sopcode 
178*17283Sopcode static char roman_HELP[] = "\
179*17283Sopcode Set the default font to Roman with the left mouse button.\n\
180*17283Sopcode \n\
181*17283Sopcode Modify text in the current set to Roman font with the middle\n\
182*17283Sopcode mouse button.";
183*17283Sopcode 
184*17283Sopcode roman_help()
185*17283Sopcode {
186*17283Sopcode     help_screen(&roman_pr, "Set Roman Text Font", roman_HELP);
187*17283Sopcode }
188*17283Sopcode 
189*17283Sopcode 
190*17283Sopcode static char scale_HELP[] = "\
191*17283Sopcode Scaling uses three points to define a transformation.\n\
192*17283Sopcode The current set is scaled by the ratio of the distances\n\
193*17283Sopcode between the first and second and the first and third points.";
194*17283Sopcode 
195*17283Sopcode scale_help()
196*17283Sopcode {
197*17283Sopcode     help_screen(&scale_pr, "Scale Current Set ('s')", scale_HELP);
198*17283Sopcode }
199*17283Sopcode 
200*17283Sopcode 
201*17283Sopcode static char move_HELP[] = "\
202*17283Sopcode Translation uses two points to define a transformation.\n\
203*17283Sopcode The current set is translated through the relative distance\n\
204*17283Sopcode between the two points.";
205*17283Sopcode 
206*17283Sopcode move_help()
207*17283Sopcode {
208*17283Sopcode     help_screen(&move_pr, "Translate Current Set ('t')", move_HELP);
209*17283Sopcode }
210*17283Sopcode 
211*17283Sopcode 
212*17283Sopcode static char hmirror_HELP[] = "\
213*17283Sopcode Mirroring uses one point to define a transformation.\n\
214*17283Sopcode The current set is reflected about the horizontal line\n\
215*17283Sopcode containing the point.";
216*17283Sopcode 
217*17283Sopcode hmirror_help()
218*17283Sopcode {
219*17283Sopcode     help_screen(&hmirror_pr, "Horizontal Mirror", hmirror_HELP);
220*17283Sopcode }
221*17283Sopcode 
222*17283Sopcode 
223*17283Sopcode static char vmirror_HELP[] = "\
224*17283Sopcode Mirroring uses one point to define a transformation.\n\
225*17283Sopcode The current set is reflected about the vertical line\n\
226*17283Sopcode containing the point.";
227*17283Sopcode 
228*17283Sopcode vmirror_help()
229*17283Sopcode {
230*17283Sopcode     help_screen(&vmirror_pr, "Vertical Mirror", vmirror_HELP);
231*17283Sopcode }
232*17283Sopcode 
233*17283Sopcode 
234*17283Sopcode static char include_HELP[] = "\
235*17283Sopcode The current set is selected by points.  Using the left mouse\n\
236*17283Sopcode button, the current set will include ONLY those elements near\n\
237*17283Sopcode the points.  With the middle mouse button, those elements near\n\
238*17283Sopcode the points will be ADDED to the current set.";
239*17283Sopcode 
240*17283Sopcode include_help()
241*17283Sopcode {
242*17283Sopcode     help_screen(&include_pr, "Define Current Set ('d')", include_HELP);
243*17283Sopcode }
244*17283Sopcode 
245*17283Sopcode 
246*17283Sopcode static char put_HELP[] = "\
247*17283Sopcode The current set is copied into the specified set buffer for\n\
248*17283Sopcode possible later retrieval.  An optional positioning point may\n\
249*17283Sopcode be specified for use in positioning the set when it is later\n\
250*17283Sopcode copied into a picture.  With no positioning point specified,\n\
251*17283Sopcode a point is selected from among the reference points of the\n\
252*17283Sopcode current set.";
253*17283Sopcode 
254*17283Sopcode put1_help()
255*17283Sopcode {
256*17283Sopcode     help_screen(&put1_pr, "Save Current Set in Buffer One ('1')", put_HELP);
257*17283Sopcode }
258*17283Sopcode 
259*17283Sopcode 
260*17283Sopcode put2_help()
261*17283Sopcode {
262*17283Sopcode     help_screen(&put2_pr, "Save Current Set in Buffer Two ('2')", put_HELP);
263*17283Sopcode }
264*17283Sopcode 
265*17283Sopcode 
266*17283Sopcode put3_help()
267*17283Sopcode {
268*17283Sopcode     help_screen(&put3_pr, "Save Current Set in Buffer Three ('3')", put_HELP);
269*17283Sopcode }
270*17283Sopcode 
271*17283Sopcode 
272*17283Sopcode put4_help()
273*17283Sopcode {
274*17283Sopcode     help_screen(&put4_pr, "Save Current Set in Buffer Four ('4')", put_HELP);
275*17283Sopcode }
276*17283Sopcode 
277*17283Sopcode 
278*17283Sopcode static char horizontal_HELP[] = "\
279*17283Sopcode Horizontal adjustment forces each point laid down to lie on\n\
280*17283Sopcode a horizontal line from the previous point.  The left mouse\n\
281*17283Sopcode button toggles this drawing mode.";
282*17283Sopcode 
283*17283Sopcode horizontal_help()
284*17283Sopcode {
285*17283Sopcode     help_screen(&horizontal_pr, "Horizontal Adjustment", horizontal_HELP);
286*17283Sopcode }
287*17283Sopcode 
288*17283Sopcode 
289*17283Sopcode static char vertical_HELP[] = "\
290*17283Sopcode Vertical adjustment forces each point laid down to lie on a\n\
291*17283Sopcode vertical line from the previous point.  The left mouse button\n\
292*17283Sopcode toggles this drawing mode.";
293*17283Sopcode 
294*17283Sopcode vertical_help()
295*17283Sopcode {
296*17283Sopcode     help_screen(&vertical_pr, "Vertical Adjustment", vertical_HELP);
297*17283Sopcode }
298*17283Sopcode 
299*17283Sopcode 
300*17283Sopcode static char stipple_HELP[] = "\
301*17283Sopcode Select the stipple pattern used for drawing polygons with\n\
302*17283Sopcode the left mouse button.\n\
303*17283Sopcode \n\
304*17283Sopcode Modify polygons in the current set to the specified stipple\n\
305*17283Sopcode pattern with the middle mouse button.";
306*17283Sopcode 
307*17283Sopcode stipple1_help()
308*17283Sopcode {
309*17283Sopcode     help_screen(&white_pr, "Set Stipple Pattern One", stipple_HELP);
310*17283Sopcode }
311*17283Sopcode 
312*17283Sopcode 
313*17283Sopcode stipple2_help()
314*17283Sopcode {
315*17283Sopcode     help_screen(&gray_pr, "Set Stipple Pattern Two", stipple_HELP);
316*17283Sopcode }
317*17283Sopcode 
318*17283Sopcode 
319*17283Sopcode stipple3_help()
320*17283Sopcode {
321*17283Sopcode     help_screen(&_50_pr, "Set Stipple Pattern Three", stipple_HELP);
322*17283Sopcode }
323*17283Sopcode 
324*17283Sopcode 
325*17283Sopcode stipple4_help()
326*17283Sopcode {
327*17283Sopcode     help_screen(&black_pr, "Set Stipple Pattern Four", stipple_HELP);
328*17283Sopcode }
329*17283Sopcode 
330*17283Sopcode 
331*17283Sopcode stipple5_help()
332*17283Sopcode {
333*17283Sopcode     help_screen(&stipple5_pr, "Set Stipple Pattern Five", stipple_HELP);
334*17283Sopcode }
335*17283Sopcode 
336*17283Sopcode 
337*17283Sopcode stipple6_help()
338*17283Sopcode {
339*17283Sopcode     help_screen(&stipple6_pr, "Set Stipple Pattern Six", stipple_HELP);
340*17283Sopcode }
341*17283Sopcode 
342*17283Sopcode 
343*17283Sopcode stipple7_help()
344*17283Sopcode {
345*17283Sopcode     help_screen(&stipple7_pr, "Set Stipple Pattern Seven", stipple_HELP);
346*17283Sopcode }
347*17283Sopcode 
348*17283Sopcode 
349*17283Sopcode stipple8_help()
350*17283Sopcode {
351*17283Sopcode     help_screen(&stipple8_pr, "Set Stipple Pattern Eight", stipple_HELP);
352*17283Sopcode }
353*17283Sopcode 
354*17283Sopcode 
355*17283Sopcode static char size2_HELP[] = "\n\
356*17283Sopcode Set the default font size to two with the left mouse button.\n\
357*17283Sopcode \n\
358*17283Sopcode Modify text in the current set to size two with the middle\n\
359*17283Sopcode mouse button.";
360*17283Sopcode 
361*17283Sopcode size2_help()
362*17283Sopcode {
363*17283Sopcode     help_screen(&size2_pr, "Set Text Size Two", size2_HELP);
364*17283Sopcode }
365*17283Sopcode 
366*17283Sopcode 
367*17283Sopcode static char italics_HELP[] = "\
368*17283Sopcode Set the default font to Italics with the left mouse button.\n\
369*17283Sopcode \n\
370*17283Sopcode Modify text in the current set to Italics font with the middle\n\
371*17283Sopcode mouse button.";
372*17283Sopcode 
373*17283Sopcode italics_help()
374*17283Sopcode {
375*17283Sopcode     help_screen(&italics_pr, "Set Italics Text Font", italics_HELP);
376*17283Sopcode }
377*17283Sopcode 
378*17283Sopcode 
379*17283Sopcode static char copy_HELP[] = "\
380*17283Sopcode Copying uses two or more points.  A copy of the current set\n\
381*17283Sopcode is made and translated by a relative distance between the\n\
382*17283Sopcode first and each additional point.  The last copy becomes\n\
383*17283Sopcode the new current set.";
384*17283Sopcode 
385*17283Sopcode copy_help()
386*17283Sopcode {
387*17283Sopcode     help_screen(&copy_pr, "Copy Current Set ('c')", copy_HELP);
388*17283Sopcode }
389*17283Sopcode 
390*17283Sopcode 
391*17283Sopcode static char erase_HELP[] = "\
392*17283Sopcode The current set is erased.  See also the undo command.";
393*17283Sopcode 
394*17283Sopcode erase_help()
395*17283Sopcode {
396*17283Sopcode     help_screen(&erase_pr, "Erase Current Set ('e')", erase_HELP);
397*17283Sopcode }
398*17283Sopcode 
399*17283Sopcode 
400*17283Sopcode static char movepoint_HELP[] = "\
401*17283Sopcode This command uses one or more points.  The element of the\n\
402*17283Sopcode current set which contains the point closest to the first of\n\
403*17283Sopcode these points is redrawn with that point replaced by the\n\
404*17283Sopcode remaining points, or deleted if there is only one point.";
405*17283Sopcode 
406*17283Sopcode movepoint_help()
407*17283Sopcode {
408*17283Sopcode     help_screen(&movepoint_pr, "Move Point", movepoint_HELP);
409*17283Sopcode }
410*17283Sopcode 
411*17283Sopcode 
412*17283Sopcode static char rotate_HELP[] = "\
413*17283Sopcode Three points are used to define a rotation.  The rotation is\n\
414*17283Sopcode performed relative to the first point, through an angle formed\n\
415*17283Sopcode by the lines between points one and two and points one and\n\
416*17283Sopcode three, respectively.";
417*17283Sopcode 
418*17283Sopcode rotate_help()
419*17283Sopcode {
420*17283Sopcode     help_screen(&rotate_pr, "Rotate Current Set ('r')", rotate_HELP);
421*17283Sopcode }
422*17283Sopcode 
423*17283Sopcode 
424*17283Sopcode static char filecabinet_HELP[] = "\
425*17283Sopcode This icon produces a pop-up menu to select commands for\n\
426*17283Sopcode manipulating files: Edit, Path, Read, Write and Save Set.\n\
427*17283Sopcode With each command, parameters should be specified in the\n\
428*17283Sopcode text subwindow before invocation.\n\
429*17283Sopcode \n\
430*17283Sopcode The Edit command causes a new file to be opened for editing.\n\
431*17283Sopcode Picture sets saved in the buffers are preserved across edits.\n\
432*17283Sopcode The file name will be displayed in the Gremlin tool border.\n\
433*17283Sopcode \n\
434*17283Sopcode The Path command is used to set the directory search path\n\
435*17283Sopcode for the Edit and Read commands.  Directory names should be\n\
436*17283Sopcode separated by colons and may include the ~ notation.  If a file\n\
437*17283Sopcode cannot be found using any of the paths, a final check will be\n\
438*17283Sopcode made in the Gremlin library, /usr/local/lib/gremlin.\n\
439*17283Sopcode \n\
440*17283Sopcode The Read command is used to add elements from the specified\n\
441*17283Sopcode file into the current picture.  The new elements become the\n\
442*17283Sopcode current set.  A point may be specified to position the file\n\
443*17283Sopcode in the picture.\n\
444*17283Sopcode \n\
445*17283Sopcode The Write command saves the entire picture in a file.  If no\n\
446*17283Sopcode file name is specified in the text subwindow, the current Edit\n\
447*17283Sopcode file name is used.  An optional point may be specified to aid\n\
448*17283Sopcode in Reading the picture later.\n\
449*17283Sopcode \n\
450*17283Sopcode The Save Set command is similar to the Write command with two\n\
451*17283Sopcode exceptions: only the current set is written, and a file name\n\
452*17283Sopcode must be specified.";
453*17283Sopcode 
454*17283Sopcode filecabinet_help()
455*17283Sopcode {
456*17283Sopcode     help_screen(&filecabinet_pr, "File Commands", filecabinet_HELP);
457*17283Sopcode }
458*17283Sopcode 
459*17283Sopcode 
460*17283Sopcode static char boxinc_HELP[] = "\
461*17283Sopcode Two points must be specified which define a rectangular area\n\
462*17283Sopcode (the endpoints of the diagonal of the rectangle).\n\
463*17283Sopcode \n\
464*17283Sopcode With the left mouse button, all elements contained within the\n\
465*17283Sopcode the rectangle become the current set.\n\
466*17283Sopcode \n\
467*17283Sopcode With the middle mouse button, those same elements are ADDED\n\
468*17283Sopcode to the current set.";
469*17283Sopcode 
470*17283Sopcode boxinc_help()
471*17283Sopcode {
472*17283Sopcode     help_screen(&boxinc_pr, "Select Area for Current Set ('f')", boxinc_HELP);
473*17283Sopcode }
474*17283Sopcode 
475*17283Sopcode 
476*17283Sopcode static char manhattan_HELP[] = "\
477*17283Sopcode Manhattan adjustment forces each point laid down to be either\n\
478*17283Sopcode directly horizontal or vertical with respect to the previous\n\
479*17283Sopcode point, whichever it is closer to.  The left mouse button\n\
480*17283Sopcode toggles this drawing mode.";
481*17283Sopcode 
482*17283Sopcode manhattan_help()
483*17283Sopcode {
484*17283Sopcode     help_screen(&horvert_pr, "Manhattan Adjustment ('z')", manhattan_HELP);
485*17283Sopcode }
486*17283Sopcode 
487*17283Sopcode 
488*17283Sopcode static char gravity_HELP[] = "\
489*17283Sopcode This command toggles each time it is selected.  When on,\n\
490*17283Sopcode gravity forces a point to coincide with the nearest existing\n\
491*17283Sopcode point or reference point.  It will only take affect, however,\n\
492*17283Sopcode if the point is near enough to an element to be gravitiated\n\
493*17283Sopcode to it.";
494*17283Sopcode 
495*17283Sopcode gravity_help()
496*17283Sopcode {
497*17283Sopcode     help_screen(&gravity_pr, "Set Gravity ('g')", gravity_HELP);
498*17283Sopcode }
499*17283Sopcode 
500*17283Sopcode 
501*17283Sopcode static char size3_HELP[] = "\n\
502*17283Sopcode Set the default font size to three with the left mouse button.\n\
503*17283Sopcode \n\
504*17283Sopcode Modify text in the current set to size three with the middle\n\
505*17283Sopcode mouse button.";
506*17283Sopcode 
507*17283Sopcode size3_help()
508*17283Sopcode {
509*17283Sopcode     help_screen(&size3_pr, "Set Text Size Three", size3_HELP);
510*17283Sopcode }
511*17283Sopcode 
512*17283Sopcode 
513*17283Sopcode static char bold_HELP[] = "\
514*17283Sopcode Set the default font to Bold with the left mouse button.\n\
515*17283Sopcode \n\
516*17283Sopcode Modify text in the current set to Bold font with the middle\n\
517*17283Sopcode mouse button.";
518*17283Sopcode 
519*17283Sopcode bold_help()
520*17283Sopcode {
521*17283Sopcode     help_screen(&bold_pr, "Set Bold Text Font", bold_HELP);
522*17283Sopcode }
523*17283Sopcode 
524*17283Sopcode 
525*17283Sopcode static char brush_HELP[] = "\
526*17283Sopcode The left mouse button sets the current brush style.\n\
527*17283Sopcode \n\
528*17283Sopcode The middle mouse button modifies all elements in the current\n\
529*17283Sopcode set (except text) to the selected brush style.";
530*17283Sopcode 
531*17283Sopcode brush1_help()
532*17283Sopcode {
533*17283Sopcode     help_screen(&dotted_pr, "Set Dotted Line Style", brush_HELP);
534*17283Sopcode }
535*17283Sopcode 
536*17283Sopcode 
537*17283Sopcode brush2_help()
538*17283Sopcode {
539*17283Sopcode     help_screen(&broken_pr, "Set Broken Line Style", brush_HELP);
540*17283Sopcode }
541*17283Sopcode 
542*17283Sopcode 
543*17283Sopcode brush3_help()
544*17283Sopcode {
545*17283Sopcode     help_screen(&thick_pr, "Set Thick Line Style", brush_HELP);
546*17283Sopcode }
547*17283Sopcode 
548*17283Sopcode 
549*17283Sopcode brush4_help()
550*17283Sopcode {
551*17283Sopcode     help_screen(&dashed_pr, "Set Dashed Line Style", brush_HELP);
552*17283Sopcode }
553*17283Sopcode 
554*17283Sopcode 
555*17283Sopcode brush5_help()
556*17283Sopcode {
557*17283Sopcode     help_screen(&narrow_pr, "Set Narrow Line Style", brush_HELP);
558*17283Sopcode }
559*17283Sopcode 
560*17283Sopcode 
561*17283Sopcode brush6_help()
562*17283Sopcode {
563*17283Sopcode     help_screen(&medium_pr, "Set Medium Line Style", brush_HELP);
564*17283Sopcode }
565*17283Sopcode 
566*17283Sopcode 
567*17283Sopcode static char arrow_HELP[] = "\
568*17283Sopcode This command requires two points.  The first point indicates\n\
569*17283Sopcode the tip of the arrow.  The second point indicates the\n\
570*17283Sopcode direction from which the arrow points.";
571*17283Sopcode 
572*17283Sopcode arrow_help()
573*17283Sopcode {
574*17283Sopcode     help_screen(&arrow_pr, "Draw Arrowhead ('w')", arrow_HELP);
575*17283Sopcode }
576*17283Sopcode 
577*17283Sopcode 
578*17283Sopcode static char text_HELP[] = "\
579*17283Sopcode Text is positioned using one or two points.  If two points\n\
580*17283Sopcode are used, the text is positioned relative to their locus.\n\
581*17283Sopcode The text specified in the text subwindow is displayed using\n\
582*17283Sopcode the current font, size and justification.\n\
583*17283Sopcode \n\
584*17283Sopcode See the text subwindow help display for an explanation of\n\
585*17283Sopcode quick text entry.";
586*17283Sopcode 
587*17283Sopcode text_help()
588*17283Sopcode {
589*17283Sopcode     help_screen(&text_pr, "Display Text", text_HELP);
590*17283Sopcode }
591*17283Sopcode 
592*17283Sopcode 
593*17283Sopcode static char misc_HELP[] = "\
594*17283Sopcode This command invokes a pop-up menu of infrequently used\n\
595*17283Sopcode commands: Clear Points, Show Points, Gripe (rarely used)\n\
596*17283Sopcode and Point.\n\
597*17283Sopcode \n\
598*17283Sopcode Clear Points will clear all positioning points and reference\n\
599*17283Sopcode points from the display.\n\
600*17283Sopcode \n\
601*17283Sopcode Show Points will display the reference points of those\n\
602*17283Sopcode elements in the current set.\n\
603*17283Sopcode \n\
604*17283Sopcode Gripe displays a message indicating the mail address of\n\
605*17283Sopcode the current Gremlin maintainer.\n\
606*17283Sopcode \n\
607*17283Sopcode Point can be used to lay down a point at a specific location.\n\
608*17283Sopcode The coordinates of the point must first be entered in the\n\
609*17283Sopcode text subwindow.";
610*17283Sopcode 
611*17283Sopcode misc_help()
612*17283Sopcode {
613*17283Sopcode     help_screen(&misc_pr, "Miscellaneous Commands", misc_HELP);
614*17283Sopcode }
615*17283Sopcode 
616*17283Sopcode 
617*17283Sopcode static char get_HELP[] = "\
618*17283Sopcode This command retrieves a set from the specified buffer and\n\
619*17283Sopcode copies it into the picture.  At least one point must be\n\
620*17283Sopcode specified, indicating the position(s) in the picture where\n\
621*17283Sopcode the set is to be copied.";
622*17283Sopcode 
623*17283Sopcode get1_help()
624*17283Sopcode {
625*17283Sopcode     help_screen(&get1_pr, "Add Buffer One To Picture", get_HELP);
626*17283Sopcode }
627*17283Sopcode 
628*17283Sopcode 
629*17283Sopcode get3_help()
630*17283Sopcode {
631*17283Sopcode     help_screen(&get3_pr, "Add Buffer Three To Picture", get_HELP);
632*17283Sopcode }
633*17283Sopcode 
634*17283Sopcode 
635*17283Sopcode get2_help()
636*17283Sopcode {
637*17283Sopcode     help_screen(&get2_pr, "Add Buffer Two To Picture", get_HELP);
638*17283Sopcode }
639*17283Sopcode 
640*17283Sopcode 
641*17283Sopcode get4_help()
642*17283Sopcode {
643*17283Sopcode     help_screen(&get4_pr, "Add Buffer Four To Picture", get_HELP);
644*17283Sopcode }
645*17283Sopcode 
646*17283Sopcode 
647*17283Sopcode static char linestyle_HELP[] = "\
648*17283Sopcode This command toggles symbolic line display.  When highlighted,\n\
649*17283Sopcode this icon indicates that elements will be drawn using their\n\
650*17283Sopcode true line style (or brush).  When not highlighted, all\n\
651*17283Sopcode elements are drawn using the narrow brush, decreasing display\n\
652*17283Sopcode times.";
653*17283Sopcode 
654*17283Sopcode linestyle_help()
655*17283Sopcode {
656*17283Sopcode     help_screen(&linestyle_pr, "Toggle Line Style Mode", linestyle_HELP);
657*17283Sopcode }
658*17283Sopcode 
659*17283Sopcode 
660*17283Sopcode static char align_HELP[] = "\
661*17283Sopcode This command forces points to be aligned on pixel boundaries\n\
662*17283Sopcode as specified in the icon.  Alignment occurs in powers of two.\n\
663*17283Sopcode To select the next alignment value use the left mouse button,\n\
664*17283Sopcode and to select the previous value use the middle mouse button.\n\
665*17283Sopcode \n\
666*17283Sopcode The precedence of point positioning modifiers is as follows:\n\
667*17283Sopcode gravity will override alignment, and adjustment (vertical,\n\
668*17283Sopcode horizontal or manhattan) will be applied to the point to which\n\
669*17283Sopcode the point has been gravitated.";
670*17283Sopcode 
671*17283Sopcode align_help()
672*17283Sopcode {
673*17283Sopcode     help_screen(&align_pr, "Set Point Alignment", align_HELP);
674*17283Sopcode }
675*17283Sopcode 
676*17283Sopcode 
677*17283Sopcode static char size4_HELP[] = "\n\
678*17283Sopcode Set the default font size to four with the left mouse button.\n\
679*17283Sopcode \n\
680*17283Sopcode Modify text in the current set to size four with the middle\n\
681*17283Sopcode mouse button.";
682*17283Sopcode 
683*17283Sopcode size4_help()
684*17283Sopcode {
685*17283Sopcode     help_screen(&size4_pr, "Set Text Size Four", size4_HELP);
686*17283Sopcode }
687*17283Sopcode 
688*17283Sopcode 
689*17283Sopcode static char special_HELP[] = "\
690*17283Sopcode Set the default font to Special with the left mouse button.\n\
691*17283Sopcode \n\
692*17283Sopcode Modify text in the current set to Special font with the middle\n\
693*17283Sopcode mouse button.";
694*17283Sopcode 
695*17283Sopcode special_help()
696*17283Sopcode {
697*17283Sopcode     help_screen(&special_pr, "Set Special Text Font", special_HELP);
698*17283Sopcode }
699*17283Sopcode 
700*17283Sopcode 
701*17283Sopcode static char arc_HELP[] = "\
702*17283Sopcode This command requires two points to draw a full circle or\n\
703*17283Sopcode three points to draw an arc.  The first point determines the\n\
704*17283Sopcode center of a circle.  The second is a point on the circle,\n\
705*17283Sopcode thus defining the radius.  An optional third point determines\n\
706*17283Sopcode a counter-clockwise angle from the second point which is the\n\
707*17283Sopcode extent of the arc.";
708*17283Sopcode 
709*17283Sopcode arc_help()
710*17283Sopcode {
711*17283Sopcode     help_screen(&arc_pr, "Draw Circle or Arc ('a')", arc_HELP);
712*17283Sopcode }
713*17283Sopcode 
714*17283Sopcode 
715*17283Sopcode static char curve_HELP[] = "\
716*17283Sopcode A curve is determined by a number of points distributed along\n\
717*17283Sopcode its trajectory.  Two points yield a straight line.  If the\n\
718*17283Sopcode first and last points of a spline are the same, a smooth\n\
719*17283Sopcode closed figure will be drawn.  Curves are drawn with the left\n\
720*17283Sopcode mouse button using the current brush style.\n\
721*17283Sopcode \n\
722*17283Sopcode With the middle mouse button, vectors and polygons in the\n\
723*17283Sopcode current set are modified to become curves.";
724*17283Sopcode 
725*17283Sopcode curve_help()
726*17283Sopcode {
727*17283Sopcode     help_screen(&curve_pr, "Draw Curve ('b')", curve_HELP);
728*17283Sopcode }
729*17283Sopcode 
730*17283Sopcode 
731*17283Sopcode static char vector_HELP[] = "\
732*17283Sopcode With the left mouse button, a line is drawn connecting each\n\
733*17283Sopcode of the points layed down in order.  The current brush (narrow,\n\
734*17283Sopcode dotted, etc) is used.\n\
735*17283Sopcode \n\
736*17283Sopcode With the middle mouse button, curves and polygons in the\n\
737*17283Sopcode current set are modified to become vectors.";
738*17283Sopcode 
739*17283Sopcode vector_help()
740*17283Sopcode {
741*17283Sopcode     help_screen(&vector_pr, "Draw Vector ('v')", vector_HELP);
742*17283Sopcode }
743*17283Sopcode 
744*17283Sopcode 
745*17283Sopcode static char box_HELP[] = "\
746*17283Sopcode Two points are used to define the endpoints of the diagonal\n\
747*17283Sopcode of a rectangle.  A box is drawn in the current brush which\n\
748*17283Sopcode forms the rectangle.";
749*17283Sopcode 
750*17283Sopcode box_help()
751*17283Sopcode {
752*17283Sopcode     help_screen(&box_pr, "Draw Box ('x')", box_HELP);
753*17283Sopcode }
754*17283Sopcode 
755*17283Sopcode 
756*17283Sopcode static char grid_HELP[] = "\
757*17283Sopcode This command toggles the display of a grid used to aid in\n\
758*17283Sopcode laying down points.  The grid is displayed on 32 pixel\n\
759*17283Sopcode boundaries.";
760*17283Sopcode 
761*17283Sopcode grid_help()
762*17283Sopcode {
763*17283Sopcode     help_screen(&grid_pr, "Toggle Grid Display ('q')", grid_HELP);
764*17283Sopcode }
765*17283Sopcode 
766*17283Sopcode 
767*17283Sopcode static char littlepoint_HELP[] = "\
768*17283Sopcode This command toggles the style of points displayed.  When the\n\
769*17283Sopcode icon is highlighted, points are indicated by a small circle\n\
770*17283Sopcode and are numbered from zero.  When the icon is unhighlighted,\n\
771*17283Sopcode points are displayed as a small diamond.";
772*17283Sopcode 
773*17283Sopcode littlepoint_help()
774*17283Sopcode {
775*17283Sopcode     help_screen(&littlepoint_pr, "Toggle Point Style", littlepoint_HELP);
776*17283Sopcode }
777*17283Sopcode 
778*17283Sopcode 
779*17283Sopcode static char undo_HELP[] = "\
780*17283Sopcode This command undoes the last command which modified the\n\
781*17283Sopcode picture contents.";
782*17283Sopcode 
783*17283Sopcode undo_help()
784*17283Sopcode {
785*17283Sopcode     help_screen(&undo_pr, "Undo Last Command", undo_HELP);
786*17283Sopcode }
787*17283Sopcode 
788*17283Sopcode 
789*17283Sopcode static char pan_HELP[] = "\
790*17283Sopcode With the left mouse button this command requires one point.\n\
791*17283Sopcode The entire picture and current set are translated such that\n\
792*17283Sopcode the specified point is located at the center of the display.\n\
793*17283Sopcode \n\
794*17283Sopcode With the middle mouse button no point is required.  The\n\
795*17283Sopcode picture is translated such that its absolute center is\n\
796*17283Sopcode brought to the center of the display.";
797*17283Sopcode 
798*17283Sopcode pan_help()
799*17283Sopcode {
800*17283Sopcode     help_screen(&pan_pr, "Panning", pan_HELP);
801*17283Sopcode }
802*17283Sopcode 
803*17283Sopcode 
804*17283Sopcode static char polygon_HELP[] = "\
805*17283Sopcode Polygons can be drawn either bordered or unbordered.  At\n\
806*17283Sopcode least three points are required to draw a polygon.  If the\n\
807*17283Sopcode first and the last points are not the same, that line\n\
808*17283Sopcode segment will be added automatically.  With the left mouse\n\
809*17283Sopcode button, a filled polygon will be added to the display in the\n\
810*17283Sopcode current stipple style.  If a border is to be drawn, this\n\
811*17283Sopcode will be added in the current brush style.\n\
812*17283Sopcode \n\
813*17283Sopcode The middle mouse button is used to modify curves, vectors and\n\
814*17283Sopcode other polygons in the current set to be polygons of the\n\
815*17283Sopcode selected type (bordered or unbordered).";
816*17283Sopcode 
817*17283Sopcode bpolygon_help()
818*17283Sopcode {
819*17283Sopcode     help_screen(&bpolygon_pr, "Fill Bordered Polygon", polygon_HELP);
820*17283Sopcode }
821*17283Sopcode 
822*17283Sopcode 
823*17283Sopcode polygon_help()
824*17283Sopcode {
825*17283Sopcode     help_screen(&polygon_pr, "Fill Polygon", polygon_HELP);
826*17283Sopcode }
827*17283Sopcode 
828*17283Sopcode 
829*17283Sopcode static char textsw_HELP[] = "\
830*17283Sopcode Command arguments (when required) are entered here from the\n\
831*17283Sopcode keyboard.  Arguments must be entered before the command is\n\
832*17283Sopcode selected.  Simple editing commands (backspace, line and word\n\
833*17283Sopcode delete) can be used to modify the argument.\n\
834*17283Sopcode \n\
835*17283Sopcode The quick form of the TEXT command is invoked by pressing\n\
836*17283Sopcode RETURN after entering a string to be displayed in the picture.\n\
837*17283Sopcode The string is displayed at the LAST point layed down (using\n\
838*17283Sopcode the current justification mode), and this point is removed\n\
839*17283Sopcode from the display.";
840*17283Sopcode 
841*17283Sopcode textsw_help()
842*17283Sopcode {
843*17283Sopcode     help_screen(NULL, "Text Subwindow Help", textsw_HELP);
844*17283Sopcode }
845*17283Sopcode 
846*17283Sopcode 
847*17283Sopcode static char pixsw_HELP[] = "\
848*17283Sopcode The left mouse button is used to lay down points.  The middle\n\
849*17283Sopcode mouse button erases points in the opposite order from which\n\
850*17283Sopcode they were layed down.";
851*17283Sopcode 
852*17283Sopcode pixsw_help()
853*17283Sopcode {
854*17283Sopcode     help_screen(NULL, "Picture Subwindow Help", pixsw_HELP);
855*17283Sopcode }
856*17283Sopcode 
857*17283Sopcode 
858*17283Sopcode menusw_help()
859*17283Sopcode {
860*17283Sopcode     /* keeps getting invoked by mistake - not useful anyway */
861*17283Sopcode }
862