1 // $Id: Help.cxx 1107 2011-01-19 23:53:52Z martin $
2 //
3 // Help.cxx - routine for DRAWxtl V5.5 - the GUI version
4 //
5 // Coded using the FLTK 1.1.6 widget set
6 //
7 //     Larry W. Finger, Martin Kroeker and Brian Toby
8 //
9 // This module includes the help screens for the GUI
10 //
11 // routines contained within this file:
12 //
13 //  About_Help_cb - callback routine from About menu button
14 //  Color_Help_cb - callback routine to display table of RGB values
15 //  Graphics_Help_cb - callback routine to display graphics help
16 //  Input_Help_cb - callback routine for help on input file
17 //  Spacegroup_Help_cb - callback routine for help on spacegroups with alternate origins
18 //  View_Help_Close_cb - callback routine to hide help windows
19 
20 #include "CrystalView.h"
21 #include "DRAWxtlViewUI.h"
22 #include "draw_ext.h"
23 
24 #include "DRAWxtl_proto.h"
25 
26 void
About_Help_cb(void)27 About_Help_cb (void)
28 {
29     static int two = 2;
30 
31     char string[256];
32 
33     static char outstring[256];
34 
35     char tstring[30];
36 
37     char vstring[30];
38 
39 // callback routine for "About Help" menu button
40     if (helpwindow2) {
41 	helpwindow2->show ();
42 	return;
43     }
44     helpwindow2 = new Fl_Window (100, 100, 500, 430, "About DRAWxtl");
45     helpwindow2->begin ();
46     helpwindow2->callback ((Fl_Callback *) View_Help_Close_cb, &two);
47 
48     int y = 40;
49 
50     Fl_Text_Display *box1 = new Fl_Text_Display (20, y, 460, 0, "DRAWxtl V5.5");
51 
52     box1->box (FL_NO_BOX);
53     box1->labelsize (24);
54     box1->labelcolor ((Fl_Color) 1);
55 
56     y += 30;
57     Fl_Text_Display *box2 =
58 	new Fl_Text_Display (20, y, 460, 0,
59 			     "Copyright C 1996-2011 by Larry Finger, Martin Kroeker and Brian Toby");
60     box2->box (FL_NO_BOX);
61     box2->labelsize (14);
62     box2->labelcolor ((Fl_Color) 186);
63 
64     y += 20;
65     strcpy (string, "$Id: Help.cxx 1107 2011-01-19 23:53:52Z martin $");
66     sscanf (string, "%*s %*s %s %s", vstring, tstring);
67     sprintf (outstring, "Modified  %s, Build %s", tstring, vstring);
68     Fl_Text_Display *box3 = new Fl_Text_Display (20, y, 460, 20, outstring);
69 
70     box3->box (FL_NO_BOX);
71     box3->labelsize (14);
72     box3->labelcolor ((Fl_Color) 186);
73 
74     y += 30;
75     Fl_Text_Display *box4 =
76 	new Fl_Text_Display (20, y, 460, 20,
77 			     "DRAWxtl uses the FLTK 1 Widget" " set by ");
78     box4->box (FL_NO_BOX);
79     box4->labelsize (14);
80     box4->labelcolor ((Fl_Color) 186);
81 
82     y += 20;
83     Fl_Text_Display *box5 =
84 	new Fl_Text_Display (20, y, 460, 20,
85 			     "Bill Spitzak and others, http://www.fltk.org");
86     box5->box (FL_NO_BOX);
87     box5->labelsize (14);
88     box5->labelcolor ((Fl_Color) 186);
89 
90     y += 30;
91     Fl_Text_Display *box7 =
92 	new Fl_Text_Display (20, y, 460, 20,
93 			     "Some classes from FLU 2.14 by Jason Bryan are also employed.");
94     box7->box (FL_NO_BOX);
95     box7->labelsize (14);
96     box7->labelcolor ((Fl_Color) 186);
97 
98     y += 20;
99     Fl_Text_Display *box8 =
100 	new Fl_Text_Display (20, y, 460, 20, "http://www.osc.edu/~jbryan/FLU");
101     box8->box (FL_NO_BOX);
102     box8->labelsize (14);
103     box8->labelcolor ((Fl_Color) 186);
104 
105     y += 30;
106     Fl_Text_Display *box9 =
107 	new Fl_Text_Display (20, y, 460, 20,
108 			     "Virtual Trackball by Gavin Bell, Thant Tessman, and Tom Holroyd");
109     box9->box (FL_NO_BOX);
110     box9->labelsize (14);
111     box9->labelcolor ((Fl_Color) 186);
112 
113     y += 20;
114     Fl_Text_Display *box10 =
115 	new Fl_Text_Display (20, y, 460, 20,
116 			     "with ideas from the August 1988 issue  of SigGraph's");
117     box10->box (FL_NO_BOX);
118     box10->labelsize (14);
119     box10->labelcolor ((Fl_Color) 186);
120 
121     y += 20;
122     Fl_Text_Display *box11 =
123 	new Fl_Text_Display (20, y, 460, 20, "\"Computer Graphics,\" pp. 121-129.");
124     box11->box (FL_NO_BOX);
125     box11->labelsize (14);
126     box11->labelcolor ((Fl_Color) 186);
127 
128     y += 30;
129     Fl_Text_Display *box12 =
130 	new Fl_Text_Display (20, y, 460, 20,
131 			     "Direct Postscript output uses GL2PS by Christophe Geuzaine, ");
132     box12->box (FL_NO_BOX);
133     box12->labelsize (14);
134     box12->labelcolor ((Fl_Color) 186);
135 
136     y += 20;
137     Fl_Text_Display *box13 =
138 	new Fl_Text_Display (20, y, 460, 20, "http://www.geuz.org/gl2ps");
139     box13->box (FL_NO_BOX);
140     box13->labelsize (14);
141     box13->labelcolor ((Fl_Color) 186);
142 
143     y += 30;
144     Fl_Text_Display *box14 =
145 	new Fl_Text_Display (20, y, 460, 20,
146 			     "Marching Cubes implementation" " of Fourier contours from");
147     box14->box (FL_NO_BOX);
148     box14->labelsize (14);
149     box14->labelcolor ((Fl_Color) 186);
150 
151     y += 20;
152     Fl_Text_Display *box15 = new Fl_Text_Display (20, y, 460, 20, "Michael Y. Polyakov, "
153 						  "http://www.angelfire.com/linux/myp");
154     box15->box (FL_NO_BOX);
155     box15->labelsize (14);
156     box15->labelcolor ((Fl_Color) 186);
157 
158     y += 20;
159     Fl_Button *o = new Fl_Button (210, y, 80, 30, "Close");
160 
161     o->callback ((Fl_Callback *) View_Help_Close_cb, &two);
162 #if !defined (WIN32) && !defined (__APPLE__)
163     helpwindow2->icon ((char *) drvui->icon);
164 #endif
165     helpwindow2->end ();
166     helpwindow2->show ();
167 }
168 
169 void
Color_Help_cb(void)170 Color_Help_cb (void)
171 {
172     static int one = 1;
173 
174 // Callback routine to show RBG values
175     const char *colortext = {
176 	"This default color table is taken from the POV file 'colors.inc'\n"
177 	    "and is sorted by RGB Values - Red first, etc.. If you wish to use\n"
178 	    "custom colors, edit the above file and use the 'Configure' screen\n"
179 	    "to include the path to the file."
180 	    "\n"
181 	    "\n"
182 	    "Color Name        R             G               B\n"
183 	    "\n"
184 	    "Black		  0		0		0\n"
185 	    "Mica		  0		0		0\n"
186 	    "NewMidnightBlue	  0		0		0.61\n"
187 	    "Blue		  0		0		1\n"
188 	    "SlateBlue	  0		0.498039	1\n"
189 	    "Green		  0		1		0\n"
190 	    "SpringGreen	  0		1		0.498039\n"
191 	    "Cyan		  0		1		1\n"
192 	    "Gray05		  0.05		0.05		0.05\n"
193 	    "Gray10		  0.1		0.1		0.1\n"
194 	    "HuntersGreen	  0.13		0.37		0.31\n"
195 	    "Navy		  0.137255	0.137255	0.556863\n"
196 	    "NavyBlue	  0.137255	0.137255	0.556863\n"
197 	    "SteelBlue	  0.137255	0.419608	0.556863\n"
198 	    "ForestGreen	  0.137255	0.556863	0.137255\n"
199 	    "SeaGreen	  0.137255	0.556863	0.419608\n"
200 	    "Gray15		  0.15		0.15		0.15\n"
201 	    "MidnightBlue	  0.184314	0.184314	0.309804\n"
202 	    "DarkGreen	  0.184314	0.309804	0.184314\n"
203 	    "DarkSlateGray	  0.184314	0.309804	0.309804\n"
204 	    "DarkSlateGrey	  0.184314	0.309804	0.309804\n"
205 	    "MediumBlue	  0.196078	0.196078	0.8\n"
206 	    "SkyBlue		  0.196078	0.6		0.8\n"
207 	    "LimeGreen	  0.196078	0.8		0.196078\n"
208 	    "MediumAquamarine  0.196078	0.8		0.6\n"
209 	    "Gray20		  0.2		0.2		0.2\n"
210 	    "SummerSky	  0.22		0.69		0.87\n"
211 	    "Gray25		  0.25		0.25		0.25\n"
212 	    "CornflowerBlue	  0.258824	0.258824	0.435294\n"
213 	    "MediumSeaGreen	  0.258824	0.435294	0.258824\n"
214 	    "DkGreenCopper	  0.29		0.46		0.43\n"
215 	    "Gray30		  0.3		0.3		0.3\n"
216 	    "NeonBlue	  0.3		0.3		1\n"
217 	    "IndianRed	  0.309804	0.184314	0.184314\n"
218 	    "Violet		  0.309804	0.184314	0.309804\n"
219 	    "DarkOliveGreen	  0.309804	0.309804	0.184314\n"
220 	    "GreenCopper	  0.32		0.49		0.46\n"
221 	    "DimGray		  0.329412	0.329412	0.329412\n"
222 	    "DimGrey		  0.329412	0.329412	0.329412\n"
223 	    "VeryDarkBrown	  0.35		0.16		0.14\n"
224 	    "Gray35		  0.35		0.35		0.35\n"
225 	    "RichBlue          0.35          0.35            0.67\n"
226 	    "BakersChoc	  0.36		0.2		0.09\n"
227 	    "DarkBrown	  0.36		0.25		0.2\n"
228 	    "CadetBlue	  0.372549	0.623529	0.623529\n"
229 	    "Gray40		  0.4		0.4		0.4\n"
230 	    "DarkSlateBlue	  0.119608	0.137255	0.556863\n"
231 	    "MediumForestGreen 0.419608	0.556863	0.137255\n"
232 	    "SemiSweetChoc	  0.42		0.26		0.15\n"
233 	    "Salmon		  0.435294	0.258824	0.258824\n"
234 	    "DarkTurquoise	  0.439216	0.576471	0.858824\n"
235 	    "Aquamarine	  0.439216	0.858824	0.576471\n"
236 	    "MediumTurquoise	  0.439216	0.858824	0.858824\n"
237 	    "Gray45		  0.45		0.45		0.45\n"
238 	    "MediumSlateBlue	  0.498039	0		1\n"
239 	    "MediumSpringGreen 0.498039	1		0		\n"
240 	    "Gray50		  0.5		0.5		0.5\n"
241 	    "DarkWood	  0.52		0.37		0.26\n"
242 	    "DustyRose	  0.52		0.39		0.39\n"
243 	    "DarkPurple	  0.53		0.12		0.47\n"
244 	    "Scarlet		  0.55		0.09		0.09\n"
245 	    "Bronze		  0.55		0.47		0.14\n"
246 	    "Gray55		  0.55		0.55		0.55\n"
247 	    "Firebrick	  0.556863	0.137255	0.137255\n"
248 	    "Maroon		  0.556863	0.137255	0.419608\n"
249 	    "Sienna		  0.556863	0.419608	0.137255\n"
250 	    "LightSteelBlue	  0.560784	0.560784	0.737255\n"
251 	    "PaleGreen	  0.560784	0.737255	0.560784\n"
252 	    "MediumOrchid	  0.576471	0.439216	0.858824\n"
253 	    "GreenYellow	  0.576471	0.858824	0.439216\n"
254 	    "DarkTan		  0.59		0.41		0.31\n"
255 	    "DarkOrchid	  0.6		0.196078	0.8\n"
256 	    "Gray60		  0.6		0.6		0.6\n"
257 	    "YellowGreen	  0.6		0.8		0.196078\n"
258 	    "BlueViolet	  0.62352	0.372549	0.623529\n"
259 	    "\n"
260 	    "Khaki		  0.623529	0.623529	0.372549\n"
261 	    "Brown		  0.647059	0.164706	0.164706\n"
262 	    "Bronze2		  0.65		0.49		0.24\n"
263 	    "MediumWood	  0.65		0.5		0.39\n"
264 	    "Gray65		  0.65		0.65		0.65\n"
265 	    "LightGray	  0.658824	0.658824	0.658824\n"
266 	    "LightGrey	  0.658824	0.658824	0.658824\n"
267 	    "Turquoise	  0.678431	0.917647	0.917647\n"
268 	    "Gray70		  0.7		0.7		0.7\n"
269 	    "Brass		  0.71		0.65		0.26\n"
270 	    "Copper		  0.72		0.45		0.2\n"
271 	    "Pink		  0.737255	0.560784	0.560784\n"
272 	    "LightBlue	  0.74902	0.847059	0.847059\n"
273 	    "Gray75		  0.75		0.75		0.75\n"
274 	    "Gray		  0.752941	0.752941	0.752941\n"
275 	    "Grey		  0.752941	0.752941	0.752941\n"
276 	    "VioletRed	  0.8		0.196078	0.6\n"
277 	    "Gold		  0.8		0.498039	0.196078\n"
278 	    "Gray80		  0.8		0.8		0.8\n"
279 	    "VLightGrey	  0.8		0.8		0.8\n"
280 	    "OldGold		  0.81		0.71		0.23\n"
281 	    "Feldspar	  0.82		0.57		0.46\n"
282 	    "Thistle		  0.847059	0.74902		0.847059\n"
283 	    "Wheat		  0.847059	0.847059	0.74902\n"
284 	    "CoolCopper	  0.85		0.53		0.1\n"
285 	    "BrightGold	  0.85		0.85		0.1\n"
286 	    "Gray85		  0.85		0.85		0.85\n"
287 	    "Quartz		  0.85		0.85		0.95\n"
288 	    "MediumVioletRed	  0.858824	0.439216	0.576471\n"
289 	    "Orchid		  0.858824	0.439216	0.858824\n"
290 	    "Tan		  0.858824	0.576471	0.439216\n"
291 	    "Goldenrod	  0.858824	0.858824	0.439216\n"
292 	    "MandarinOrange	  0.89		0.47		0.2\n"
293 	    "Gray90		  0.9		0.9		0.9\n"
294 	    "Silver		  0.9		0.91		0.98\n"
295 	    "LightWood	  0.91		0.76		0.65\n"
296 	    "Plum		  0.917647	0.678431	0.917647\n"
297 	    "MediumGoldenrod	  0.917647	0.917647	0.678431\n"
298 	    "NewTan		  0.92		0.78		0.62\n"
299 	    "Gray95		  0.95		0.95		0.95\n"
300 	    "Flesh		  0.96		0.8		0.69\n"
301 	    "Red		  1		0		0\n"
302 	    "Magenta		  1		0		1\n"
303 	    "SpicyPink	  1		0.11		0.68\n"
304 	    "NeonPink	  1		0.43		0.78\n"
305 	    "Coral		  1		0.498039	0\n"
306 	    "OrangeRed	  1		0.498039	0\n"
307 	    "Orange		  1		0.5		0\n"
308 	    "Yellow		  1		1		0\n"
309 	    "Clear		  1		1		1\n"
310 	    "White		  1		1		1"
311     };
312 
313     if (helpwindow1) {
314 	helpwindow1->show ();
315 	return;
316     }
317     helpwindow1 = new Fl_Window (50, 50, 680, 550, "Color RGB Values");
318     helpwindow1->resizable (helpwindow1);
319     helpwindow1->begin ();
320     helpwindow1->callback ((Fl_Callback *) View_Help_Close_cb, &one);
321     Fl_Text_Editor *display = new Fl_Text_Editor (0, 0, 680, 510);
322 
323     display->textfont (FL_COURIER);
324     helpbuf1 = new Fl_Text_Buffer;
325     display->buffer (helpbuf1);
326     helpbuf1->text (colortext);
327     Fl_Button *o = new Fl_Button (300, 515, 80, 30, "Close");
328 
329     o->callback ((Fl_Callback *) View_Help_Close_cb, &one);
330 #if !defined (WIN32) && !defined (__APPLE__)
331     helpwindow1->icon ((char *) drvui->icon);
332 #endif
333     helpwindow1->end ();
334     helpwindow1->show ();
335 }
336 
337 void
Graphics_Help_cb(void)338 Graphics_Help_cb (void)
339 {
340     static int four = 4;
341 
342 // routine to display graphics help
343     if (helpwindow4) {
344 	helpwindow4->show ();
345 	return;
346     }
347     const char Text[] =
348 	{ "\n                                   Graphics Keyboard Shortcuts and Help\n\n"
349 "    'C' or 'c' - turn the graphics cursor on. Each successive press reduces the size of the\n"
350 "                   steps. When the size is reduced below 0.01 A, the cursor is turned off.\n"
351 "                   When atoms are selected as described below, the various distances, angles,\n"
352 "                   and the torsion angle 1-2-3-4 are shown in the display area.\n\n"
353 "    'x', 'y', 'z' - move the cursor in the positive direction parallel to the x-, y- or z-axis.\n\n"
354 "    'X', 'Y', 'Z' - move the cursor in the negative direction parallel to the x-, y- or z-axis.\n\n"
355 "    'P' or 'p' - place the graphics cursor on the atom nearest the mouse position.\n\n"
356 "    'A' or 'a' - place the cursor at the position of the atom nearest the cursor.\n\n"
357 "    'M' or 'm' - move the cursor to the min (M) or max (m) in the electron-density.\n\n"
358 "    'S' or 's' - draw the electron density in a plane through the last three atoms.\n\n"
359 "    'L' or 'l' - label the atom at the cursor position.\n\n"
360 "    'B' or 'b' - Label the bond distance between atoms 1 and 2.\n\n"
361 "    Left mouse and drag - rotate the graphics object using a virtual trackball.\n\n"
362 #if !defined(__APPLE__)
363 	    "    Right mouse and drag - zoom in/out.\n\n"
364 	    "    Middle mouse (both on 2-button mouse) and drag - pan motion.\n"
365 #else
366 	    "    Command (Apple) key and drag - zoom in/out.\n\n"
367 	    "    Alt (option) key and drag - pan the graphics view.\n"
368 #endif
369 	"                       The arrow keys may also be used to move the object.\n\n"
370 	    "    HOME key - remove all zoom and pan motions.\n\n"
371 	    "    Shift/leftclick - drag labels or the triple vector to a desired position. If the triple\n"
372 	    "                        vector is dragged, all 3 of its labels are moved with it.\n\n"
373 	    "    Ctrl/leftclick - remove the object at the position of the mouse.\n"
374     };
375     helpwindow4 = new Fl_Window (200, 100, 600, 650, "DRAWxtl V5.5 Screen Graphics Help");
376     helpwindow4->resizable (helpwindow4);
377     helpwindow4->begin ();
378     helpwindow4->callback ((Fl_Callback *) View_Help_Close_cb, &four);
379     int y = 40;
380 
381     Fl_Multiline_Output *a = new Fl_Multiline_Output (0, 0, 600, 580);
382 
383     a->textsize (13);
384     a->box (FL_FLAT_BOX);
385     a->textfont (FL_HELVETICA_BOLD);
386     a->value (Text);
387     a->color (FL_WHITE);
388     y = 600;
389     Fl_Button *o = new Fl_Button (260, y, 80, 30, "Close");
390 
391     o->callback ((Fl_Callback *) View_Help_Close_cb, &four);
392     o->take_focus ();
393 #if !defined (WIN32) && !defined (__APPLE__)
394     helpwindow4->icon ((char *) drvui->icon);
395 #endif
396     helpwindow4->end ();
397     helpwindow4->show ();
398 }
399 
400 void
Input_Help_cb(void)401 Input_Help_cb (void)
402 {
403 // callback routine for help on input - from menu item
404     const char *helptext = {
405 	"Input Instructions for DRAWxtl:\n"
406 	    "\n"
407 	    "In this program, color is represented in symbolic form, and must be one of the color names\n"
408 	    "from POV's 'colors.inc' file. The color names, sorted by RGB values, are available in the colors\n"
409 	    "entry under the Help menu. Any of these colors may be made transparent by appending the phrase\n"
410 	    "'filter xx' after it, where xx is a number from 0.0 to 1.0. (The larger the value of xx, the more\n"
411 	    "transparent will be the entity.\n"
412 	    "\n"
413 	    "Each line of the input file is preceded by a character sequence that describes the type of\n"
414 	    "information, as follows:\n"
415 	    "\n"
416 	    "\n"
417 	    " aimsurf name number filename style color\n"
418 	    "\n"
419 	    "causes the program to read from the given file a precalculated surface mesh to display at the\n"
420 	    "position of the specified atom. The file must be in the format used by the aim program (part of\n"
421 	    "the WIEN2k program suite) for calculating Bader surfaces of atoms according to the AIM concept.\n"
422 	    "(The calculated surface should cover the whole range of 0 to pi in theta and 0 to 2*pi in phi,\n"
423 	    "as no symmetry expansion is performed.) The rendering style can be 'dots', 'mesh' or 'solid'.\n"
424 	    "\n"
425 	    "\n"
426 	    " arrow       xp yp zp xc yc zc length diameter color\n"
427 	    "\n"
428 	    "defines the position in fractional coordinates (xp, yp, zp) of the triclinic, nuclear cell, the\n"
429 	    "components (xc, yc, zc) of the spin vector, and the length diameter and color of the arrow.. The\n"
430 	    "reference direction for xc is parallel to direct space axis a, yc is parallel (a x b) x a,\n"
431 	    "and the reference direction for zc is perpendicular to xc and yc. The only space-group symmetry\n"
432 	    "elements used in placing arrows are the translations described by the mag_trans command below.\n"
433 	    "\n"
434 	    "\n"
435 	    " atom           name number x y z\n"
436 	    "\n"
437 	    "defines the atoms. The 1- to 4-character name will be used on the commands that describe the\n"
438 	    "objects to be created, the number is to identify which atom of this type, and x y z are the\n"
439 	    "fractional coordinates in the unit cell. If the position is more easily represented as a fraction\n"
440 	    "such as 1/3, 1/4, 5/6, etc., it may be given in this form.\n"
441 	    "\n"
442 	    "\n"
443 	    "average\n"
444 	    "\n"
445 	    "\n"
446 	    "causes the program to draw the average structure of an incommensurately modulated crystal\n"
447 	    "even if information about positional or occupancy modulation is available in its CIF file.\n"
448 	    "\n"
449 	    "\n"
450 	    "axislines    width color\n"
451 	    "\n"
452 	    "defines the width and color of the lines that depict the principal axes of ellipsoids. The color\n"
453 	    "defaults to dark gray (Gray20). If this is not given, any ellipsoids will be drawn with principal\n"
454 	    "axes of 0.00015 times the overall scale factor, which should normally be appropriate.\n"
455 	    "\n"
456 	    "\n"
457 	    " background color\n"
458 	    "\n"
459 	    "sets the color of the background of the graphical views. The default color is white.\n"
460 	    "\n"
461 	    "\n"
462 	    " bestplane number name1 name2 ... nameN width height color\n"
463 	    "\n"
464 	    "causes the program to calculate the best fitting plane through a subset of atoms, where number\n"
465 	    "is the number of unique atom names (name and number, e.g. C8) name1 to nameN that follow.\n"
466 	    "The plane is drawn as a rectangle of dimensions width x height in the given color.\n"
467 	    "\n"
468 	    "\n"
469 	    " betaij         name number color\n"
470 	    "\n"
471 	    "defines the anisotropic thermal coefficients for an atom and color of the ellipsoid. The name and\n"
472 	    "number should correspond to the atom input described above. In the POV version of the program, the\n"
473 	    "principal ellipses are drawn in black. The ellipses will, of course, be invisible if the ellipsoid\n"
474 	    "is also black.\n"
475 	    "\n"
476 	    "\n"
477 	    " bij or Bij     name color\n"
478 	    "\n"
479 	    "defines the anisotropic thermal coefficients for an atom and the color of the ellipsoid to be drawn.\n"
480 	    "The name and number should correspond to the atom input described above.\n"
481 	    "\n"
482 	    "\n"
483 	    " bond           name1 name2 radius min max color\n"
484 	    "\n"
485 	    "where name1 and name2 indicate the types of atoms to be connected by a bond, radius is the radius\n"
486 	    "of the resulting cylinder, and the minimum and maximum lengths are given in the same units as the\n"
487 	    "unit cell.\n"
488 	    "\n"
489 	    "\n"
490 	    " box            radius color\n"
491 	    "\n"
492 	    "defines the radius and color of the cylinders that form the unit cell boundary. If radius is 0.0,\n"
493 	    "plotting of the unit cell is suppressed. The radius of the cylinders will be scaled with the size\n"
494 	    "of the drawing. The default size is 0.02.\n"
495 	    "\n"
496 	    "\n"
497 	    " cell           a b c alpha beta gamma\n"
498 	    "\n"
499 	    "unit-cell lengths and angles. If no angles are listed, they are assumed to be the fixed values for\n"
500 	    "the symmetry class.\n"
501 	    "\n"
502 	    "\n"
503 	    " clip          xmin xmax ymin ymax zmin zmax\n"
504 	    "\n"
505 	    "defines a-,b-,c- clipping range in fractions of the axes. Any bonds extending beyond these limits\n"
506 	    "will be cut off at half-length. This command is to be used in conjunction with the pack keyword to\n"
507 	    "produce 'dangling' bonds in the display of framework structures.\n"
508 	    "\n"
509 	    "\n"
510 	    " cutout         color     (used only for POV and openGL)\n"
511 	    "\n"
512 	    "sets the POV generation of thermal ellipsoids to have one octant removed, as in the program ORTEP.\n"
513 	    "If this command is not given, all ellipsoids will be complete. The color is for the planes that\n"
514 	    "describe the edges of the cutout.\n"
515 	    "\n"
516 	    "\n"
517 	    " dash           name1 name2 radius min max color\n"
518 	    "\n"
519 	    "where name1 and name2 indicate the types of atoms to be connected by a dashed bond, radius is the\n"
520 	    "radius of the resulting cylinder, and the minimum and maximum lengths are given in the same units\n"
521 	    "as the unit cell.\n"
522 	    "\n"
523 	    "\n"
524 	    " depthcue       depth (POV and openGL only)\n"
525 	    "\n"
526 	    "defines the extent to which the size of polyhedral edges is increased as the edge is closer to the\n"
527 	    "viewer.\n"
528 	    "\n"
529 	    "\n"
530 	    " edges          radius color\n"
531 	    "\n"
532 	    "defines the thickness and color of cylinders along the edges of polyhedra that may be used to\n"
533 	    "emphasize the faces. The radius of these cylinders will also be scaled with the size of the drawing.\n"
534 	    "By default, black edges of size 0.02 will be drawn.\n"
535 	    "\n"
536 	    "\n"
537 	    " ellipcolor     name number color\n"
538 	    "\n"
539 	    "defines the color for ellipsoids when the thermal ellipsoid information has been read from a CIF,\n"
540 	    "GSAS, SCHAKAL or SHELX import or inline file. The name and number must match the identification\n"
541 	    "information in the input file. The parameter number may be an asterisk (*) to indicate all atoms\n"
542 	    "with that name. In addition, these input lines must be after the import or inline command.\n"
543 	    "\n"
544 	    "\n"
545 	    " ellipsoids     probability\n"
546 	    "\n"
547 	    "sets the size of the ellipsoid such that that fraction of the electron density is contained within\n"
548 	    "the bounding surface. Use either 0.50 or 50 to get the standard (default) 50% ellipsoids.\n"
549 	    "\n"
550 	    "\n"
551 	    " finish        ambient diffuse specular roughness\n"
552 	    "\n"
553 	    "defines parameters for the POV lighting functions that are applied to\n"
554 	    "all surfaces. Suggested values are 0.7 0.3 0.08 0.01 to reduce the harsh\n"
555 	    "contrasts that can result from the default material properties in POV.\n"
556 	    "\n"
557 	    "\n"
558 	    " frame        comment\n"
559 	    "\n"
560 	    "similar to 'end', marks the division between two complete sets of input that are to be superimposed\n"
561 	    "in a single output file. Use this where you would otherwise have to create separate datafiles (e.g.\n"
562 	    "one showing polyhedra, the other selected bonds) and join the resulting POV or VRML files.\n"
563 	    "For V4.1 and later, each frame may have different space groups, pack range, and object descriptions.\n"
564 	    "With this functionality, a single drawing can represent a cage-compound framework with an adsorbed\n"
565 	    "molecule that has lower symmetry than the framework. Another option is to draw ball-and-stick and\n"
566 	    "polyhedral pictures in side-by-side unit cells.\n"
567 	    "\n"
568 	    "\n"
569 	    " import         cif filename datablock\n"
570 	    " import         csd filename (or fdat filename)\n"
571 	    " import         gsas filename phasenumber\n"
572 	    " import         pcr filename phasenumber\n"
573 	    " import         schakal filename\n"
574 	    " import         shelx filename\n"
575 	    " import         wien2k filename\n"
576 	    " import         discus filename\n"
577 	    " import	 exciting filename\n"
578 	    " import	 elk filename\n"
579 	    "\n"
580 	    "causes the program to read information from the external file specified.\n"
581 	    "Import filters have been written for the CIF, FDAT (Cambridge Structure Database=CSD), FullProf (pcr),\n"
582 	    "GSAS, SCHAKAL, SHELX, DISCUS, WIEN2k and ELK (Exciting) formats.\n"
583 	    "For GSAS and FullProf format, the number of the phase should also be given. For CIF format, the\n"
584 	    "data block number should be given.\n"
585 	    "From these files, the atomic coordinates, thermal parameters, unit cell, and space group will be read.\n"
586 	    "To turn on ellipsoid output, and to set colors for the ellipsoids, use the ellipcolor command.\n"
587 	    "\n"
588 	    "\n"
589 	    " inline          csd (or fdat)\n"
590 	    " inline          schakal\n"
591 	    " inline          shelx\n"
592 	    " inline          wien2k\n"
593 	    "\n"
594 	    "is similar to import, except that the foreign input information is included in the DRAWxtl input file\n"
595 	    "in the lines immediately following this command. This form presently works for FDAT,\n"
596 	    "SCHAKAL, SHELX and WIEN2k data. To turn on ellipsoid output, and to set colors for the ellipsoids,\n"
597 	    "use the ellipcolor command.\n"
598 	    "\n"
599 	    "\n"
600 	    " labelscale size\n"
601 	    "\n"
602 	    "changes the relative size of 'labeltext' entries. The default is 1.0\n"
603 	    "\n"
604 	    "\n"
605 	    " labeltext x y z text\n"
606 	    "\n"
607 	    "places the text at position x,y,z\n"
608 	    "\n"
609 	    "\n"
610 	    " list maxdist\n"
611 	    "\n"
612 	    "causes the program to list bond distances up to 'maxdist' in the preliminary scan. If this command is\n"
613 	    "not given, 'maxdist' defaults to 3.5 of the input units. If pm are used, this input will definitely be needed\n"
614 	    "\n"
615 	    "\n"
616 	    " lonepair name number height radius1 radius2 color\n"
617 	    "\n"
618 	    "creates the specified 'number' (either 1 or 2) of cones representing free electron pairs extending from\n"
619 	    "atom 'name', where 'height' is the length of the cone, 'radius1' is the size of the tip, and 'radius2'\n"
620 	    "is the size of the spherical end cap. The position of the cone is derived from those of the neighboring\n"
621 	    "atoms within a search range governed by the 'list' keyword (or 3.0 units by default).\n"
622 	    "Electron pairs point at the vertices of a tetrahedron by default - use a negative value for\n"
623 	    "'number' to create one or two electron pairs on an atom in a planar environment.\n"
624 	    "\n"
625 	    "\n"
626 	    " lookat u1 u2 u3 v1 v2 v3\n"
627 	    "\n"
628 	    "causes the program to select an orientation such that vector u is towards the viewer, and\n"
629 	    "(u x v) * u is horizontal.\n"
630 	    "\n"
631 	    "\n"
632 	    " mag_trans      Aa Ab Ac Ba Bb Bc Ca Cb Cc\n"
633 	    "\n"
634 	    "describes the relationship between the magnetic and nuclear unit cells. In this notation, the\n"
635 	    "upper-case letter states which of the magnetic axes is being described, and the lower-case\n"
636 	    "letter corresponds to the nuclear cell axis. This matrix defaults to the identity.\n"
637 	    "\n"
638 	    "\n"
639 	    " magnification  factor\n"
640 	    "\n"
641 	    "sets the factor to modify the overall scaling in case the automatic value is not correct.\n"
642 	    "\n"
643 	    "\n"
644 	    " mapcalclimits xmin xmax ymin ymax zmin zmax\n"
645 	    "\n"
646 	    "describes the region of direct space (in fractional coordinates) for which the map has been calculated.\n"
647 	    "Map types that are self documenting such as FullProf's GFOURIER and JANA2000 do not need this line.\n"
648 	    " For other types, 0 to 1 in all three directions will be assumed.\n"
649 	    "\n"
650 	    "\n"
651 	    " mapcontour level style color\n"
652 	    "\n"
653 	    "defines a new contour at 'level'. The style can be either 'mesh' or 'solid', and the color is\n"
654 	    "set by 'color'\n"
655 	    "\n"
656 	    "\n"
657 	    " mapcontour2d lower step upper color\n"
658 	    "\n"
659 	    "defines a new set of 2d contours beginning at 'lower', with 'step' between contours. No contours\n"
660 	    "beyond 'top' will be drawn. The color is set by 'color'. See the 'mapregion' command to see how\n"
661 	    " to set 2d mode.\n"
662 	    "\n"
663 	    "\n"
664 	    " maplegend\n"
665 	    "\n"
666 	    "draws a color ramp legend in the top left corner of the image\n"
667 	    "\n"
668 	    "\n"
669 	    " mapread  maptype filename calctype resol\n"
670 	    "\n"
671 	    "reads a Fourier map of type 'maptype' from the file named 'filename'. At present, GSAS-style\n"
672 	    "(maptype = grd), JANA2000-style (maptype = stf), WIEN2k (maptype = w2k), VASP (maptype = vsp),\n"
673 	    "FullProf (GFOURIER output, maptype = flp), and O Format (maptype = dn6) electron density maps \n"
674 	    "are read, as are electron density and ELF files from the FP-LAPW program EXCITING (maptype=exc)\n"
675 	    "or its successor ELK and files in XCrysDen format (maptype=xsf).\n"
676 	    "If a Shelx/Cif-style Fo/Fc file (maptype = fcf) or a JANA-style M80 file (maptype = m80) is given,\n"
677 	    " the electron density is calculated during the initial read, which may take a few seconds. Both\n"
678 	    " A/B and Fo/phi data formats (Shelx commands LIST 3 and LIST 6) are supported. The calctype may be\n"
679 	    " 'Fo', 'Fc', 'Fo-Fc', or '2Fo-Fc' to indicate the type of map to calculate. If this parameter is not\n"
680 	    " given, an 'Fo' map is calculated. Parameter resol indicates the number of steps per cell unit.\n"
681 	    " If not given, the value is set to 4\n"
682 	    "\n"
683 	    "\n"
684 	    " mapregion xmin xmax ymin ymax zmin zmax\n"
685 	    "\n"
686 	    "describes the region of direct space (in fractional coordinates) that the map is to be displayed\n"
687 	    "in the output. If not entered, these values default to the values given under 'mapcalclimits'. If\n"
688 	    "the difference between the maximum and the minimum along one direction is zero, a 2d map will be\n"
689 	    "plotted for the other two coordinates.\n"
690 	    "\n"
691 	    "\n"
692 	    " mapslice px py pz nx ny nz type\n"
693 	    "\n"
694 	    "describes a planar slice through a fourier map at the location given by the coordinates px,py,pz\n"
695 	    "of a point in the plane and in the orientation determined by the plane normal nx,ny,nz.\n"
696 	    "Possible type values are 1 (contoured slice), 2 (solid, color-coded blue to red) or 3 (solid, black\n"
697 	    "to white).\n"
698 	    "\n"
699 	    "\n"
700 	    " molcomp        dist\n"
701 	    "\n"
702 	    "causes any incomplete molecules in the display box to be completed. The value of dist defines the\n"
703 	    "maximum intramolecular distance. Caution: If this distance is greater than any intermolecular distance,\n"
704 	    "or if the material is not molecular, the display list will overflow.\n"
705 	    "\n" "\n"
706 /*
707 " molecule       atom_name atom_number  dist\n"
708 "\n"
709 "sets up a molecular completion command about the atom specified by the atom name and number.\n"
710 "This command is identical to a pack command about the position of the specified atom, followed\n"
711 "by a molcomp command. The caution stated in the molcomp command also applies here.\n"
712 "\n"
713 "\n"
714 */
715 	" nolabels\n"
716 	    "\n"
717 	    "removes all axis labels from the output diagrams.\n"
718 	    "\n"
719 	    "\n"
720 	    " noshadow\n"
721 	    "\n"
722 	    "causes objects in the POV file not to cast shadows.\n"
723 	    "\n"
724 	    "\n"
725 	    " occupancy     name  average  minimum\n"
726 	    "\n"
727 	    "defines the occupancy of the named site in the average structure of a modulated system,\n"
728 	    "and the occupancy threshold for including individual copies in a plot of the modulated\n"
729 	    "structure.\n"
730 	    "Use a negative value for the sphere radius to scale atom sizes by their individual site\n"
731 	    "occupancies.\n"
732 	    "\n"
733 	    "\n"
734 	    " origin         xcenter ycenter zcenter\n"
735 	    "\n"
736 	    "defines center of view box in crystal coordinates (defaults to 0.5 0.5 0.5).\n"
737 	    "\n"
738 	    "\n"
739 	    " orthographic\n"
740 	    "\n"
741 	    "causes the camera to be changed from the normal perspective view to an orthographic view.\n"
742 	    "\n"
743 	    "\n"
744 	    " pack           xmin xmax ymin ymax zmin zmax\n"
745 	    "\n"
746 	    "defines a-,b-,c- plotting range in fractions of the axes, similar to the PLUTO (Motherwell & Clegg 1978))\n"
747 	    "PACK RANGE command (this is especially useful for highly oblique cells, where the orthorhombic\n"
748 	    "view box does not always give satisfactory results). When drawing multiple frames, each frame can\n"
749 	    "have distinct packing values. If new values are not defined, they will be derived from the previous\n"
750 	    "frame.\n"
751 	    "\n"
752 	    "\n"
753 	    " phaseshift     value1   value2   value3\n"
754 	    "\n"
755 	    "defines the initial phases  t_n  of the n'th modulation wave in a modulated structure.\n"
756 	    "\n"
757 	    "\n"
758 	    " phong          value size                (used only for POV and openGL)\n"
759 	    "\n"
760 	    "defines the amount of Phong highlighting on spheres and ellipsoids.  The value ranges between 0.0\n"
761 	    "and 1.0, where 0.0 gives no highlight, and 1.0 causes complete saturation at the center of the highlight.\n"
762 	    "The size ranges from 1.0 (very dull) to 250 highly) polished). The default quantities are 0.1 and 1.0,\n"
763 	    "which gives a large, dull highlight.  If value is 0.0, the image can be rendered much more quickly.\n"
764 	    "\n"
765 	    "\n"
766 	    " plane          name length color\n"
767 	    "\n"
768 	    "defines the center of a plane group, such as CO3 that is to be drawn in a structure, where name is the\n"
769 	    "name of the atom at the center and length is the maximum distance to coordinating anions.\n"
770 	    "\n"
771 	    "\n"
772 	    " polyedge name radius color\n"
773 	    "\n"
774 	    "defines the thickness and color of cylinders used to emphasize the faces along the edges of polyhedra\n"
775 	    "for atom 'name'. The radius of these cylinders will also be scaled with the size of the drawing.\n"
776 	    "\n"
777 	    "\n"
778 	    " polysz         name length color\n"
779 	    "\n"
780 	    "defines a polyhedron, where name is the name of an atom at the center of a polyhedron and length is\n"
781 	    "the maximum length of distances to atoms that are to be considered as the vertices of the polyhedron.\n"
782 	    "The polyhedra can be of any desired complexity. For polyhedra with both upper and lower limits\n"
783 	    "(which might be desirable for intermetallic compounds), use the 'shell' command. To control both\n"
784 	    "center and target atoms, use the 'polyvert' command\n"
785 	    "\n"
786 	    "\n"
787 	    " polytolerance      factor\n"
788 	    "\n"
789 	    "modifies the internal limit for the deviation of vertices from the common plane. While the default\n"
790 	    "value (0.1) will always generate correct drawings, it may sometimes be desirable to increase it to\n"
791 	    "create idealized views of nearly symmetrical polyhedra that would otherwise show creased surfaces.\n"
792 	    "\n"
793 	    "\n"
794 	    " polyvert       name1 name2 length color\n"
795 	    "\n"
796 	    "defines a polyhedron, where atoms of type name1 are at the center of the polyhedron, atoms of\n"
797 	    "type name2 are at the vertices and length is the maximum distance to be included.\n"
798 	    "\n"
799 	    "\n"
800 	    " qvector       value1 value2 value3\n"
801 	    "\n"
802 	    "defines the components of the wave vector q for a modulated structure\n"
803 	    "\n"
804 	    "\n"
805 	    " rem            text\n"
806 	    " REM            text\n"
807 	    "\n"
808 	    "Any line preceded by this command is ignored.\n"
809 	    "\n"
810 	    "\n"
811 	    " shell         name length1 length2 color\n"
812 	    "\n"
813 	    "defines a polyhedral hull, where name is the name of an atom at the center of a polyhedron and\n"
814 	    "length1 and length2 are the minimum and maximum lengths of distances to atoms that are to be\n"
815 	    "considered as the vertices of the polyhedron. The polyhedra can be of any desired complexity,\n"
816 	    "and can be stacked as desired.\n"
817 	    "\n"
818 	    "\n"
819 	    " slab a b c alpha beta gamma xoff yoff zoff xrot yrot zrot flag\n"
820 	    "\n"
821 	    "defines a (possibly oblique) cutout box of the specified axis lengths and\n"
822 	    "angles that is offset by xoff,yoff zoff from the origin of the structure\n"
823 	    "and rotated at angles xrot yrot zrot relative to it. If flag is set to 1,\n"
824 	    "any part of the structure outside the box is deleted. If flag is 2, the\n"
825 	    "outline of the box is overlaid on the unchanged image to allow accurate\n"
826 	    "placement of the cutout box.\n"
827 	    "\n"
828 	    "\n"
829 	    " spgp    symbol\n"
830 	    " spgr    symbol\n"
831 	    " sgrp    symbol\n"
832 	    "\n"
833 	    "Space Group name consisting of the Bravais lattice symbol (must be upper case) followed by a space,\n"
834 	    "the elements parallel to the first axis followed by a space, etc. Examples are I 41/a m d, P 21/n, I a 3 d,\n"
835 	    "P b n m, etc. The generators will always select the origin choice with a center of symmetry at the\n"
836 	    "origin. Furthermore, all monoclinic cells will have the unique axis parallel to the b axis, unless the\n"
837 	    "full symbol is used, i.e. P 1 1 21/n describes a monoclinic cell with c as the unique axis. N.B.:\n"
838 	    "Rhombohedral space groups must be represented in the hexagonal form.\n"
839 	    "\n"
840 	    "\n"
841 	    " sphere         name radius color\n"
842 	    " sphere         name number radius color\n"
843 	    "\n"
844 	    "where name is a one- or two-character symbol of the atom type, radius is the radius of the sphere in\n"
845 	    "the input units, and color is the color of the sphere to be drawn. If the first form is used, all atoms with\n"
846 	    "that name will be drawn. The second restricts the command to that name and number only\n"
847 	    "\n"
848 	    "\n"
849 	    " title, titl    text\n"
850 	    "\n"
851 	    "General description of the structure - this line may appear anywhere in the file, but is generally first.\n"
852 	    "\n"
853 	    "\n"
854 	    " uij, Uij       name number u color\n"
855 	    "\n"
856 	    "defines the anisotropic thermal coefficients for an atom and color of the ellipsoid. The name and\n"
857 	    "number should correspond to the atom input described above.\n"
858 	    "\n"
859 	    "\n"
860 	    " values         name * radius\n"
861 	    " values         name number radius\n"
862 	    "\n"
863 	    "defines additional atomic properties for the given element or individual atom. Currently the\n"
864 	    "only supported property is the van der Waals radius to be used in cavity calculations (see the\n"
865 	    "''voids'' keyword).\n"
866 	    "\n"
867 	    "\n"
868 	    " vectors     posx  posy  posz\n"
869 	    "\n"
870 	    "turns on the orientation vector triple at a corner of the diagram. The optional parameters pos[xyz]\n"
871 	    "specify the location of the origin. If not given, the program will guess at a location\n"
872 	    "\n"
873 	    "\n"
874 	    " view  xrot  yrot  zrot\n"
875 	    "\n"
876 	    "where xrot, yrot and zrot are view rotation angles in Cartesian space. These values correspond to a\n"
877 	    "rotation of xrot about the x axis, followed by a rotation of yrot about the new y axis, and, a rotation\n"
878 	    "of zrot about the new z axis.\n"
879 	    "\n"
880 	    "\n"
881 	    " voids method probe_radius gridx gridy gridz color\n"
882 	    "\n"
883 	    "causes cavities in the structure to be determined using the given method and probe radius (e.g.\n"
884 	    "1.4 for a water molecule). gridx, gridy and gridz determine the resolution of the grid used\n"
885 	    "for subdividing the unit cell. Currently supported methods are 1 for a slow but reliable, sequential\n"
886 	    "test at all gridpoints, 2 for using the MSMS program of Sanner, and 3 for a pseudorandom sampling\n"
887 	    "of points. Methods 2 and 3 should be considered experimental.\n"
888 	    "\n"
889 	    "\n"
890 	    " vrml1\n"
891 	    "\n"
892 	    "causes the output VRML file to have the VRML1 syntax (as opposed to the newer VRML97 standard)\n"
893 	    "\n"
894 	    "\n"
895 	    " x3d\n"
896 	    "\n"
897 	    "causes the output VRML file to have X3D 'Classic VRML' encoding and .x3dv extension\n"
898 	    "\n"
899 	    "\n"
900 	    " xyzoff         u1  u2 u3\n"
901 	    "\n"
902 	    "causes all atom coordinates to be shifted by -u.  This command is used whenever the origin defined for\n"
903 	    "a structure does not conform to the standard origin selected by the space-group generator.\n"
904 	    "\n"
905 	    "\n"
906 	    " end\n"
907 	    " END\n"
908 	    "\n"
909 	    "The last line of a file that is read. Any information past this point will be ignored.\n"
910 	    "\n"
911 	    "\n"
912 	    "The maximum line length is 255 characters - everything beyond this limit is ignored.\n"
913 	    "\n"
914 	    "Sample input file\n"
915 	    "\n"
916 	    "title Buckyball with balls and sticks\n"
917 	    "cell 14.16 14.16  14.16\n"
918 	    "pack -.3 .3 -.3 .3 -.3 .3\n"
919 	    "spgp F m 3\n"
920 	    "sphere c 0.4 Red filter 0.3\n"
921 	    "bond c c 0.1 1.2 1.5 Gray30\n"
922 	    "atom c 1 0.04908 0.00000 0.24510\n"
923 	    "atom c 2 0.10028 0.08284 0.21346\n"
924 	    "atom c 3 0.18313 0.05120 0.16226\n"
925 	    "origin 0 0 0\n" "magnification 0.7\n" "view -18 0 0\n" "end\n"
926     };
927 
928     static int zero = 0;
929 
930     if (helpwindow) {
931 	helpwindow->show ();
932 	return;
933     }
934     helpwindow = new Fl_Window (50, 50, 680, 450, "Input File Commands");
935     helpwindow->resizable (helpwindow);
936     helpwindow->begin ();
937     helpwindow->callback ((Fl_Callback *) View_Help_Close_cb, &zero);
938     Fl_Text_Editor *display = new Fl_Text_Editor (0, 0, 680, 410);
939 
940     helpbuf = new Fl_Text_Buffer;
941     display->buffer (helpbuf);
942     display->textsize (13);
943     display->textfont (FL_HELVETICA_BOLD);
944     helpbuf->text (helptext);
945     Fl_Button *o = new Fl_Button (300, 415, 80, 30, "Close");
946 
947     o->callback ((Fl_Callback *) View_Help_Close_cb, &zero);
948 #if !defined (WIN32) && !defined (__APPLE__)
949     helpwindow->icon ((char *) drvui->icon);
950 #endif
951     helpwindow->end ();
952     helpwindow->show ();
953 }
954 
955 void
Spacegroup_Help_cb(void)956 Spacegroup_Help_cb (void)
957 {
958 // callback routine for help on alternate origin space groups
959     int y;
960 
961     char string2[100];
962 
963     static int five = 5;
964 
965     if (helpwindow5) {
966 	helpwindow5->show ();
967 	return;
968     }
969     y = 160 + 100 * drvui->origin1_flag;
970     helpwindow5 = new Fl_Window (50, 50, 440, y, "Space Groups with Alternate Origin");
971     helpwindow5->begin ();
972     helpwindow5->callback ((Fl_Callback *) View_Help_Close_cb, &five);
973 #if !defined (WIN32) && !defined (__APPLE__)
974     helpwindow5->icon ((char *) drvui->icon);
975 #endif
976     y = 40;
977     Fl_Text_Display *box1 = new Fl_Text_Display (20, y, 380, 0, "Space Group Help");
978 
979     box1->box (FL_NO_BOX);
980     box1->labelsize (24);
981     box1->labelcolor ((Fl_Color) 1);
982     y += 30;
983     if (drvui->origin1_flag) {
984 	Fl_Text_Display *box2 = new Fl_Text_Display (20, y, 380, 0,
985 						     "The current space group has multiple origins.");
986 
987 	box2->box (FL_NO_BOX);
988 	box2->labelsize (16);
989 	box2->labelcolor ((Fl_Color) 186);
990 	y += 20;
991 	Fl_Text_Display *box3 = new Fl_Text_Display (20, y, 380, 0,
992 						     "The generator used by DRAWxtl always selects");
993 
994 	box3->box (FL_NO_BOX);
995 	box3->labelsize (16);
996 	box3->labelcolor ((Fl_Color) 186);
997 	y += 20;
998 	Fl_Text_Display *box4 = new Fl_Text_Display (20, y, 380, 0,
999 						     "the origin at a center of inversion. If your structure");
1000 
1001 	box4->box (FL_NO_BOX);
1002 	box4->labelsize (16);
1003 	box4->labelcolor ((Fl_Color) 186);
1004 	y += 20;
1005 	Fl_Text_Display *box5 = new Fl_Text_Display (20, y, 380, 0,
1006 						     "does not display correctly, remove the 'rem' from the");
1007 
1008 	box5->box (FL_NO_BOX);
1009 	box5->labelsize (16);
1010 	box5->labelcolor ((Fl_Color) 186);
1011 	y += 20;
1012 	Fl_Text_Display *box6 = new Fl_Text_Display (20, y, 380, 0,
1013 						     "following line of your input 'str' file:");
1014 
1015 	box6->box (FL_NO_BOX);
1016 	box6->labelsize (16);
1017 	box6->labelcolor ((Fl_Color) 186);
1018 	y += 15;
1019 	sprintf (string2, "  rem xyzoff  %.3f %.3f %.3f", -drvui->origin_offset[0],
1020 		 -drvui->origin_offset[1], -drvui->origin_offset[2]);
1021 	Fl_Text_Display *box7 = new Fl_Text_Display (20, y, 380, 20);
1022 
1023 	box7->box (FL_NO_BOX);
1024 	Fl_Text_Buffer *buff = new Fl_Text_Buffer;
1025 
1026 	box7->textsize (16);
1027 	box7->textcolor ((Fl_Color) 186);
1028 	box7->buffer (buff);
1029 	buff->text (string2);
1030 	y += 40;
1031     } else {
1032 	Fl_Text_Display *box2 = new Fl_Text_Display (20, y, 380, 0,
1033 						     "The current space group has a single choice of origin, or an");
1034 
1035 	box2->box (FL_NO_BOX);
1036 	box2->labelsize (16);
1037 	box2->labelcolor ((Fl_Color) 186);
1038 	y += 20;
1039 	Fl_Text_Display *box3 = new Fl_Text_Display (20, y, 380, 0,
1040 						     "'xyzoff' command is specified. No further action is required.");
1041 
1042 	box3->box (FL_NO_BOX);
1043 	box3->labelsize (16);
1044 	box3->labelcolor ((Fl_Color) 186);
1045 	y += 20;
1046     }
1047     Fl_Button *p = new Fl_Button (160, y, 80, 30, "Close");
1048 
1049     p->callback ((Fl_Callback *) View_Help_Close_cb, &five);
1050     helpwindow5->end ();
1051     helpwindow5->show ();
1052 }
1053 
1054 void
View_Help_Close_cb(Fl_Window *,int * arg)1055 View_Help_Close_cb (Fl_Window *, int *arg)	// callback to destruct help window
1056 {
1057 // callback to close the STR help screens
1058     switch (*arg) {
1059     case 0:
1060 	helpwindow->hide ();
1061 	break;
1062     case 1:
1063 	helpwindow1->hide ();
1064 	break;
1065     case 2:
1066 	helpwindow2->hide ();
1067 	break;
1068     case 3:
1069 	helpwindow3->hide ();
1070 	break;
1071     case 4:
1072 	helpwindow4->hide ();
1073 	break;
1074     case 5:
1075 	helpwindow5->hide ();
1076 	break;
1077     case 6:
1078 	helpwindow6->hide ();
1079 	break;
1080     }
1081 }
1082