File: FvwmForm.adoc

package info (click to toggle)
fvwm3 1.0.6a%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,408 kB
  • sloc: ansic: 141,349; perl: 4,891; sh: 4,568; makefile: 785; yacc: 688; lex: 187; sed: 11
file content (728 lines) | stat: -rw-r--r-- 28,637 bytes parent folder | download | duplicates (3)
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
= FvwmForm(1)

:doctype: manpage
:mantitle: FvwmForm
:manname: FvwmForm
:manmanual: Fvwm Modules
:manvolnum: 1
:page-layout: base

== NAME

FvwmForm - input form module for Fvwm

== SYNOPSIS

*Module FvwmForm* [ _Alias_ ]

FvwmForm must be spawned by Fvwm. If invoked from the command line,
FvwmForm prints its version number and exits.

== DESCRIPTION

FvwmForm provides a mechanism to get user input and act accordingly.
This is achieved by means of a form that the user can fill out, and from
which the user can select actions he wants Fvwm to take. A form consists
of five types of items: text labels, single-line text inputs,
mutually-exclusive selections, multiple-choice selections, and action
buttons. These items are arranged into several lines, with a very
flexible layout.

A text label only serves the purpose of explanation. It cannot accept
any input.

A timeout entry provides a mechanism for timing out the form and
performing a certain action when the timeout occurs. The countdown is
displayed similar to a text label except that it updates with the amount
of time left.

A text input field can be used to edit a single-line string. FvwmForm
accepts Emacs-style cursor movement keys. See FvwmFormInput for details.
Mouse copy is not supported, but you can paste.

A selection consists of several choices.

The selection itself is a logical entity that doesn't have any display
feature.

Each choice is displayed as a push-button followed by a explanatory text
label. When selected, an exclusive choice shows a circle in the middle,
while a multiple choice shows a check.

An action button, when activated sends one or more commands to Fvwm or
executes shell commands. The shell commands can contain the content of
the input fields on the form and reflect the setting of choices on the
form.

The action buttons can be activated thru keyboard or mouse.

== INITIALIZATION

FvwmForm invoked without an alias uses configuration commands starting
with "*FvwmForm".

Normally you would invoke FvwmForm with an alias representing the name
of a form, its configuration commands and configuration file. For
example, the command "Module FvwmForm Rlogin" uses configuration
commands starting with "*Rlogin", and reads the optional configuration
file "Rlogin".

All forms, regardless of alias, scan first for configuration commands
that start with "*FvwmFormDefault". These commands normally come from
the builtin form "FvwmForm-Form" which saves commands to the file
".FvwmForm".

The physical reading of the optional input file, ".FvwmForm", is done
only the first time FvwmForm is invoked, or after "FvwmForm-Form"
updates the file.

When the file ".FvwmForm" is read, it is done by sending the command
"Read .FvwmForm Quiet" to fvwm. Because of the way the "read" command
works, the file can reside in your personal fvwm user directory, or be
in the fvwm data directory. See the description of the read command in
the fvwm man page for more information about the environment variable
$FVWM_USERDIR.

Then FvwmForm reads the rest of the configuration fvwm has stored up.
Fvwm stores configuration on an ongoing basis. The initial configuration
comes from the .fvwm2rc file. Other sources, including "Read" commands
can define a form.

When letting FvwmForm and fvwm read files, remember that these files
contain commands that can execute shell commands, so you should be
careful about setting permissions on these files.

When FvwmForm is invoked with a window context, e.g. from a window menu,
all commands it sends to Fvwm will have that window context. This would
allow FvwmForm to control the window it is invoked from.

After all the configuration commands have been read, FvwmForm displays
the form defined by the commands.

== DEFAULTS

FvwmForm creates a built-in form named "FvwmForm-Form" that creates a
file called ".FvwmForm". This file contains saved default form colors
and fonts. Other forms use these defaults unless they are overridden
within the form.

The default creating form would normally be invoked from a "module
menu". For example, if you call your module menu "Module-Popup", you
would add the line: AddToMenu "Module-Popup" "FvwmForm Defaults"
FvwmForm FvwmForm-Form

When you select "FvwmForm Defaults" from your module menu, a form is
displayed that shows the current defaults and allows you to change them.
If you activate the "Save Restart Me" button, the ".FvwmForm" file is
written and "FvwmForm-Form" exits and restarts to show the new defaults.

An example of what this file might contain after a save is:

....
# This file last created by FvwmForm-Form on Sun Nov 28 11:18:26 EST 1999.
*FvwmFormDefault: Font 10x20
*FvwmFormDefault: InputFont 8x13bold
*FvwmFormDefault: ButtonFont 10x20
*FvwmFormDefault: TimeoutFont 10x20
*FvwmFormDefault: Fore white
*FvwmFormDefault: Back cornflowerblue
*FvwmFormDefault: Colorset -1
*FvwmFormDefault: ItemFore green
*FvwmFormDefault: ItemBack gray40
*FvwmFormDefault: ItemColorset -1
*FvwmFormDefault: ButtonPointer hand2
*FvwmFormDefault: ButtonInPointer star
*FvwmFormDefault: InputPointer gumby
*FvwmFormDefault: ButtonPointerFore blue
*FvwmFormDefault: ButtonPointerBack gray
*FvwmFormDefault: ButtonInPointerFore gray
*FvwmFormDefault: ButtonInPointerBack blue
*FvwmFormDefault: InputPointerFore
*FvwmFormDefault: InputPointerBack
....

The commands in this file are just like any other FvwmForm command
except that they start with "*FvwmFormDefault".

FvwmForm only reads the file ".FvwmForm" the first time it is started or
after the file is changed by "FvwmForm-Form". It does so by sending the
command "*FvwmFormDefault: Read x". With "x" set to "y" or "n". "n"
makes FvwmForm send a "read .FvwmForm quiet" command to fvwm.

== VARIABLE SUBSTITUTION

If you supply variables and values on the command line used to start
FvwmForm (like this):

Module FvwmForm MyForm ACTION=Browse "TITLE=Browse Form"

Then all FvwmForm input commands undergo variable substitution. The
variables from the command line are exported. Then every command gets
expanded using the variables from the environment. For example, assuming
the above invocation of "MyForm", commands would be changed like this:

Before *MyForm: Text "$TITLE, Home $HOME, Going to $ACTION" After
*MyForm: TEXT "Browse Form, Home /home/me, Going to Browse"

Using this facility should make it possible for one form to be used for
different sets of input data.

== CONFIGURATION

The following commands can be set in the .fvwm2rc file or thru any of
the other ways that fvwm can accept commands. The simplest technique is
to create a file in the read-only architecture-independent data
directory, [PREFIX/share/fvwm] or your personal fvwm directory
[$HOME/.fvwm], that matches the form alias.

In the following paragraphs the string "FvwmForm" would normally be the
form alias.

FvwmForm reads commands before the form is ever displayed, and while the
form is being displayed.

The following commands are accepted before the form is displayed:

 Back
 Button
 ButtonFont
 ButtonInPointer
 ButtonInPointerFore
 ButtonInPointerBack
 ButtonPointer
 ButtonPointerFore
 ButtonPointerBack
 Choice
 Command
 Colorset
 Font
 Fore
 GrabServer
 Input
 InputFont
 InputPointer
 ItemBack
 ItemColorset
 ItemFore
 InputPointerFore
 InputPointerBack
 Line
 Message
 PadVText
 Position
 Selection
 Separator
 Text
 Timeout
 TimeoutFont
 Title
 UseData
 WarpPointer

The following commands are accepted while the form is displayed:

 Map
 Stop
 UnMap

The "Map", "UnMap" and "Stop" facility is under development and is
currently not explained in this document, since it is likely to change.

The order of the options DOES matter. The first background text color,
"*FvwmFormBack", encountered before a displayable item sets the default
background color for the entire form.

Other than that, colors, fonts, text, choices and buttons can be
intermixed in any order. The are no builtin limits on form size, number
of items on a form, or number of fonts or colors used.

**FvwmForm: GrabServer*::
  This option makes FvwmForm grab the mouse pointer on startup. This
  feature is useful for things like logout verification.

**FvwmForm: WarpPointer*::
  This option makes FvwmForm warp the mouse pointer into its window on
  startup. It saves the user some mouse-travelling.

**FvwmForm: Geometry ``_geometry_``*::
  Specifies the FvwmForm window location. This is similar to what the
  Position option does but is more flexible.

**FvwmForm: Position ``_x_ _y_``*::
  Puts the FvwmForm window at location (_x_, _y_) on the screen. By
  convention, a negative _x_ (_y_) value measures distance from the
  right (bottom) of the screen.
+
If this option is omitted, FvwmForm starts at the center of the screen.

**FvwmForm: Colorset ``_n_``*::
  Tells the module to use colorset _n_.

**FvwmForm: Back ``_color_``*::
  Specifies the background color of the FvwmForm window and any text in
  the window. The first background color FvwmForm reads determines the
  overall screen background color. Switches off the Colorset option. See
  DEFAULTS.

**FvwmForm: Fore ``_color_``*::
  Specifies the foreground color for displaying text labels. Switches
  off the Colorset option. See DEFAULTS.

**FvwmForm: ItemColorset ``_n_``*::
  Tells the module to use colorset _n_ for items.

**FvwmForm: ItemBack ``_color_``*::
  Specifies the background color for the text input windows, and the
  buttons. Buttons are displayed as 3D depressable buttons. Inputs are
  displayed as 3D indented fields. Medium shade background colors work
  best. Switches off the ItemColorset option. See DEFAULTS.

**FvwmForm: ItemFore ``_color_``*::
  Specifies the foreground color for the text input strings and button
  text. Switches off the ItemColorset option. See DEFAULTS.

**FvwmForm: Font ``_font_``*::
  Specifies the font for displaying plain text. See DEFAULTS.

**FvwmForm: ButtonFont ``_font_``*::
  Specifies the font for text in the action buttons. See DEFAULTS.

**FvwmForm: InputFont ``_font_``*::
  Specifies the font for text input. See DEFAULTS.

**FvwmForm: TimeoutFont ``_font_``*::
  Specifies the font for display the timeout counter and related text.
  See DEFAULTS.

**FvwmForm: Line ``_justification_``*::
  Starts a new line. A line can contain any number of text, input,
  buttons and choice items. A FvwmForm window can have any number of
  lines. The width of the window is that of the longest line.
+
Justification of items in the line is specified by _justification_,
which can be one of the following:
+
*``_left_``*:::
  Items are justified to the left of the window.
*``_right_``*:::
  Items are justified to the right of the window.
*``_center_``*:::
  Items are placed in the center of the window.
*``_expand_``*:::
  If there is only one item in the line, the item is centered in the
  window. If two or more items are present, they are spread to fill the
  whole width of the window.

**FvwmForm: Message*::
  Defines a text area on the form that contains the last error message
  from fvwm. For purposes of determining form size, the message area is
  considered to be 80 bytes long. Its actual length is the same as the
  message received. If the message exceeds 80 bytes, you can see the
  rest of the message by resizing the form.
+
You should not attempt to put any text, buttons or input fields on the
same line after a message field. Messages greater than 80 bytes will
overlay the remainder of the line.

**FvwmForm: PadVText ``_Pixels_``*::
  The number of pixels used as vertical padding between text items, line
  to line. The default is 6 which looks good on lines containing text
  intermixed with input boxes, choices or buttons.
+
For straight text, such as might appear on a help form, padding of zero
looks better.
+
(There are lots of other padding values used in form layout which can't
currently be changed with commands.)

**FvwmForm: Text ``_string_``*::
  Displays _string_ as plain text. Line breaks must be achieved by
  multiple *FvwmForm: Line and *FvwmForm: Text options. Blanks may be
  used to provide extra padding between items.

**FvwmForm: Title ``_string_``*::
  Displays _string_ as the window's title. The string must be enclosed
  in double quotes. Using this command with anything other than a string
  enclosed in quotes creates a blank title. If this command is not used,
  the window title is the form alias.

**FvwmForm: Input ``_name_ _size_ _init_string_``*::
  Specifies a text input item with name _name_. A sub window of _size_
  characters in width is used for editing. If _init_string_ is present,
  it is the initial string when FvwmForm starts or resets itself. The
  default initial string is "".
+
You can mouse paste into an input field using button 2. Buttons 1 and 3
move the cursor in an input field.
+
Input fields are always in insert mode, overtyping is not supported.
+
Emacs type keystrokes are supported.
+
Control-a, Home and Begin move to the front of an input field. Control-e
and End move to the end of an input field. Control-b and Left move left
in an input field. Control-f and Right move right in an input field.
Control-p, Up, and Shift-Tab move to a previous input field if any, if
the form has one input field, recall previous value. Control-n, Down,
Return, Line-feed and Tab move to the next input field if any, if the
form has one input field, for control-n and Down, restore previous input
value. Control-h moves backward in an input field erasing a character.
Control-d and Delete delete the next character in an input field.
Control-k erases for the cursor to the end of an input field. Control-u
erases the entire input field.
+
When a form executes a command, all the input values are saved in a ring
of input history 50 items deep.
+
Meta(mod2)-"<" retrieves the previous value of an input field.
Meta(mod2)-">" retrieves the next value of an input field.
+
(For forms with one input field, use the much easier arrow keys.)

**FvwmForm: Selection ``_name_ _type_``*::
  This option starts a selection item with name _name_. Its choices are
  specified in following configuration commands. The option _type_ is
  one of the following:
+
*``_single_``*:::
  The selections are mutually exclusive.
+
*``_multiple_``*:::
  This is a multiple-choice selection.

**FvwmForm: Separator*::
  Draws a 2 pixel shaded line across the form as a visual indication of
  a separate area.

**FvwmForm: Choice ``_name_ _value_`` on | off ``_string_``*::
  Specifies a choice for a proceeding selection. The choice item has a
  _name_ and a _value_ these are used in commands. See *FvwmForm:
  Command. The _string_ is displayed to the right of the choice button
  as a label.
+
The choice assumes the specified initial state ("on" means selected)
when FvwmForm starts or resets. If the selections are mutually
exclusive, FvwmForm does NOT detect inconsistencies in the initial
states of the choices, i.e. two or none of the choices can be selected.
However, once the user selects a choice, FvwmForm assures only one is
selected.

**FvwmForm: Button ``_type_ _string_`` [``_key_``]*::
  This option specifies an action button. The button has _string_ as a
  label, and executes a set of Fvwm _command_ when it is activated. The
  commands are the following *FvwmForm: Commands.
+
The optional _key_ specifies a keyboard shortcut that activates the
button. It is in either a control character, specified as ^@, ^A, ...,
^_, or a function key, specified as F1, F2, ..., F35. Control keys that
are used for cursor movement in text input fields cannot activate any
buttons, with the exception of TAB (^I), RETURN (^M), LINEFEED (^J),
which can activate a button when the cursor is in the last text input
field.
+
The behavior of the button is determined by _type_:
+
continue:::
  FvwmForm continues execution after sending the commands.
restart:::
  After sending the commands, FvwmForm resets all the values to the
  initial ones, and then continues execution.
quit:::
  FvwmForm quits after sending the commands.

**FvwmForm: Command ``_command_``*::
  This option specifies an Fvwm command associated with the current
  button. There can be more than one command attached to a button.
  Commands that appear before any *FvwmForm: Button option are executed
  at start-up time. This is usually a beep that gets the user's
  attention.
+
Commands starting with an exclamation mark (!) are executed by FvwmForm,
all other commands are sent to Fvwm for execution. Before sending each
command to Fvwm, FvwmForm recognizes variables of the following forms,
and supply values to them.

*$(``_name_``)*::
  If _name_ corresponds to a text input field, the result is the user's
  input string. The special chars single-quote, double-quote and
  backslash are preceded by a backslash.
+
If _name_ corresponds to a choice, the result is the value of the choice
(as specified in *FvwmForm: Choice) if the choice is selected. If the
choice is not selected, the result is a blank string.
+
If _name_ corresponds to a selection, the result will be a list of the
selected values of all its choices separated by spaces.

*$(``_name_``?``_string_``)*::
  If _name_ is a text input field and its value is not an empty string,
  the result is _string_, with recursive variable substitution applied.
  If the input value is empty, the result is empty.
+
If _name_ is a choice and it is selected, the result is _string_, with
recursive variable substitution applied. If the choice is not selected,
the result is empty.

*$(``_name_``!``_string_``)*::
  The same as the above, except that the converse conditions are taken.
+
When using the "?" and "!" forms to pass a string, the string is
delimited by a right parenthesis. If you need to put a right parenthesis
in a string, precede the right parenthesis with a backslash.

**FvwmForm: UseData ``_datafile_ _leading_``*::
  Tells FvwmForm to read a data file and extract data from module
  commands that match the "leading" argument and an input, choice, or
  selection variable in a form.
+
This lets a form display current fvwm module configuration data. For an
example of how this works, examine the file "FvwmForm-Rlogin" which is
installed in read-only architecture-independent data directory,
[PREFIX/share/fvwm] and shown below.
+
For choices, the setting of the button is represented as the word "on",
all other values for a setting are treated as off.
+
For selections, the setting of each choice button is determined by
matching the current value of the selection against each choice.
Currently, this only works correctly for selections that allow a single
choice.

**FvwmForm: ButtonPointer ``_pointername_``*::
  Change the default mouse pointer (hand2) used when hovering over a
  button. The pointername must be one of the names defined in the
  include file X11/cursorfont.h (without the XC_ prefix). See DEFAULTS.

**FvwmForm: ButtonInPointer ``_pointername_``*::
  Change the default mouse pointer (hand1) used while a button is
  pressed in. The pointername must be one of the names defined in the
  include file X11/cursorfont.h (without the XC_ prefix). See DEFAULTS.

**FvwmForm: InputPointer ``_pointername_``*::
  Change the default mouse pointer (xterm) used while the pointer is
  over a text field. The pointername must be one of the names defined in
  the include file X11/cursorfont.h (without the XC_ prefix). See
  DEFAULTS.

**FvwmForm: ButtonPointerFore|Back ``_color_``*::
  Change the default mouse pointer foreground and background colors used
  when hovering over a button. See DEFAULTS.

**FvwmForm: ButtonInPointerFore|Back ``_color_``*::
  Change the default mouse pointer foreground and background colors used
  while a button is pressed in. See DEFAULTS.

**FvwmForm: InputPointerFore|Back ``_color_``*::
  Change the default mouse pointer foreground and background colors used
  while the pointer is over a text field. See DEFAULTS.

**FvwmForm: Timeout ``_tenth_of_seconds_ _command_`` ``_"text"_``*::
  Set up FvwmForm to time out after the amount of _tenth of seconds_
  specified. When the timer hits zero, _command_ executes. The _text_
  field is displayed much like a _Text_ field, except that a '%%' in the
  line is replaced automatically by the amount of time left on the
  timer. The value gets updated every tenth of second as the timer
  counts down. There can only be one timeout field per form.

== EXAMPLES

All of the following "examples" are installed in the read-only
architecture-independent data directory, [PREFIX/share/fvwm], during
fvwm installation.

The following commands create a menu to invoke the examples:

....
DestroyMenu Forms
AddToMenu Forms "&Q. QuitVerify" Module FvwmForm FvwmForm-QuitVerify
AddToMenu Forms "&C. Capture"    Module FvwmForm FvwmForm-Capture
AddToMenu Forms "&R. Rlogin"     Module FvwmForm FvwmForm-Rlogin
AddToMenu Forms "&T. Talk"       Module FvwmForm FvwmForm-Talk
....

== EXAMPLE 1 - Quit Verify

This example simulates the mwm way of confirming logout. Return does the
logout, Escape cancels logout. It times out after 20 seconds and
performs the equivalent of the 'Logout' button.

....
DestroyModuleConfig  FvwmForm-QuitVerify: *
*FvwmForm-QuitVerify: GrabServer
*FvwmForm-QuitVerify: WarpPointer
*FvwmForm-QuitVerify: Command     Beep
*FvwmForm-QuitVerify: Line        center
*FvwmForm-QuitVerify: Text        "Do you really want to logout?"
*FvwmForm-QuitVerify: Line        expand
*FvwmForm-QuitVerify: Button      quit "Logout" ^M
*FvwmForm-QuitVerify: Command     Quit
*FvwmForm-QuitVerify: Button      restart   "Restart" ^R
*FvwmForm-QuitVerify: Command     Restart
*FvwmForm-QuitVerify: Button      quit "Cancel" ^[
*FvwmForm-QuitVerify: Command     Nop
*FvwmForm-QuitVerify: Timeout     200 Quit "Automatic logout will occur in %% tenth of seconds."
....

== EXAMPLE 2 - Remote Login

This example lets the user type in a host name, an optional user name,
and opens an xterm window from the remote host.

....
DestroyModuleConfig  FvwmForm-Rlogin: *
*FvwmForm-Rlogin: WarpPointer
*FvwmForm-Rlogin: Line         center
*FvwmForm-Rlogin: Text         "Login to Remote Host"
*FvwmForm-Rlogin: Line         center
*FvwmForm-Rlogin: Text         "Host:"
*FvwmForm-Rlogin: Input        HostName        20      ""
*FvwmForm-Rlogin: Line         center
*FvwmForm-Rlogin: Selection    UserSel single
*FvwmForm-Rlogin: Choice       Default Default on      "same user"
*FvwmForm-Rlogin: Choice       Custom  Custom  off     "user:"
*FvwmForm-Rlogin: Input        UserName        10      ""
*FvwmForm-Rlogin: Line         expand
*FvwmForm-Rlogin: Button       quit    "Login"         ^M
*FvwmForm-Rlogin: Command      Exec exec ssh $(Custom?-l $(UserName)) $(HostName) xterm -T x
term@$(HostName) -display $HOSTDISPLAY &
       # Before saving the data, remove any previously saved data:
       *FvwmForm-Rlogin: Command DestroyModuleConfig FvwmForm-RloginDefault: *
       # The "Login" button causes a login and a saving of the current data:
       *FvwmForm-Rlogin: Command !(                        /bin/echo \
         "# Created by FvwmForm-Rlogin on: `/bin/date`.";  /bin/echo \
         '*FvwmForm-RloginDefault: HostName $(HostName)';  /bin/echo \
         '*FvwmForm-RloginDefault: UserName $(UserName)';  /bin/echo \
         '*FvwmForm-RloginDefault: Default $(Default?on)'; /bin/echo \
         '*FvwmForm-RloginDefault: Custom $(Custom?on)' \
       ) > ${FVWM_USERDIR}/.FvwmForm-Rlogin
       *FvwmForm-Rlogin: Button       restart "Reset"
       *FvwmForm-Rlogin: Button       quit    "Cancel"        ^[
       *FvwmForm-Rlogin: Command      Nop
       # Tell FvwmForm to read vars from the .FvwmForm-RloginDefault file:
       *FvwmForm-Rlogin: UseData .FvwmForm-Rlogin *FvwmForm-RloginDefault
....

== EXAMPLE 3 - Capture Window

This example provides a front-end to xwd, xwud, and xpr.

....
DestroyModuleConfig  FvwmForm-Capture: *
*FvwmForm-Capture: Line       center
*FvwmForm-Capture: Text       "Capture Window"
*FvwmForm-Capture: Line       left
*FvwmForm-Capture: Text       "File: "
*FvwmForm-Capture: Input      file            25      "/tmp/Capture"
*FvwmForm-Capture: Line       left
*FvwmForm-Capture: Text       "Printer: "
*FvwmForm-Capture: Input      printer         20      "$PRINTER"
*FvwmForm-Capture: Line       expand
*FvwmForm-Capture: Selection  PtrType single
*FvwmForm-Capture: Choice     PS      ps      on      "PostScript"
*FvwmForm-Capture: Choice     Ljet    ljet    off     "HP LaserJet"
*FvwmForm-Capture: Line       left
*FvwmForm-Capture: Text       "xwd options:"
*FvwmForm-Capture: Line       expand
*FvwmForm-Capture: Selection  Options multiple
*FvwmForm-Capture: Choice     Brd     -nobdrs off     "No border"
*FvwmForm-Capture: Choice     Frm     -frame  on      "With frame"
*FvwmForm-Capture: Choice     XYZ     -xy     off     "XY format"
*FvwmForm-Capture: Line       expand
*FvwmForm-Capture: Button     continue        "Capture"       ^M
*FvwmForm-Capture: Command    Exec exec xwd -out $(file) $(Options) &
*FvwmForm-Capture: Button     continue        "Preview"
*FvwmForm-Capture: Command    Exec exec xwud -in $(file) &
*FvwmForm-Capture: Button     continue        "Print"
*FvwmForm-Capture: Command    Exec exec xpr -device $(PtrType) $(file) | lpr -P $(printer) &
*FvwmForm-Capture: Button     quit            "Quit"
....

== EXAMPLE 4 - Talk Form

This example provides a replacement for the module FvwmTalk. There are 2
forms, "FvwmForm-Talk." which executes commands, or sends commands to
fvwm for execution, and "FvwmForm-TalkHelp." which is a help form.

In the help form, notice how vertical line spacing is changed. Normal
FvwmForm line spacing assumes text is intermixed with buttons, help
forms require different spacing.

....
# FvwmForm-Talk - Basic replacement for FvwmTalk
DestroyModuleConfig  FvwmForm-Talk: *
*FvwmForm-Talk: WarpPointer
# Layout
*FvwmForm-Talk: Line         center
*FvwmForm-Talk: Text         "Talk to Fvwm"
*FvwmForm-Talk: Line         left
*FvwmForm-Talk: Text         "Command:"
*FvwmForm-Talk: Input        Command 80 ""
*FvwmForm-Talk: Line         left
*FvwmForm-Talk: Text         "Msg:"
*FvwmForm-Talk: Message
*FvwmForm-Talk: Line         center
# Buttons
*FvwmForm-Talk: Button       restart    "Return - Execute"         ^M
*FvwmForm-Talk: Command        $(Command)
*FvwmForm-Talk: Button       continue    "F1 - Help" F1
*FvwmForm-Talk: Command        Module FvwmForm FvwmForm-TalkHelp
*FvwmForm-Talk: Button       restart     "F3 - Reset input" F3
*FvwmForm-Talk: Command        Nop
*FvwmForm-Talk: Button       quit        "F4 - Dismiss"  F4
*FvwmForm-Talk: Command        Nop
....

....
# FvwmForm-TalkHelp - Help Text for FvwmForm-Talk
DestroyModuleConfig  FvwmForm-TalkHelp: *
*FvwmForm-TalkHelp: WarpPointer
# Layout
*FvwmForm-TalkHelp: Line    center
*FvwmForm-TalkHelp: Text    "Talk to Fvwm - Help"
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: Text    " "
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: PadVText 0
*FvwmForm-TalkHelp: Text    "Enter commands in the
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: Text    "Commands beginning with
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: Text    "shell as a sub-process of the form."
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: Text    "All other commands are sent to fvwm for execution."
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: Text    ""
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: Text    "Fvwm error messages are shown on the
*FvwmForm-TalkHelp: Line    left
*FvwmForm-TalkHelp: Text    ""
# Buttons
*FvwmForm-TalkHelp: Line    center
*FvwmForm-TalkHelp: Button  quit    "Return - Dismiss"         ^M
*FvwmForm-TalkHelp: Command   Nop
....

== BUGS AND LIMITATIONS

FvwmForm is a fairly simple method of providing input. There is no input
validation facility. FvwmForm has no way of dealing with lists.

Report bugs to the fvwm-workers list.

== COPYRIGHTS

FvwmForm is original work of Thomas Zuwei Feng
(ztfeng@math.princeton.edu).

Copyright Feb 1995, Thomas Zuwei Feng. No guarantees or warranties are
provided or implied in any way whatsoever. Use this program at your own
risk. Permission to use, modify, and redistribute this program is hereby
given, provided that this copyright is kept intact.

== CHANGES

During the fall of 1998, Dan Espen removed all form size limits, added
unlimited font and color changing, form spacing control, configuration
file reading, global control of appearance, synchronous command
execution, Error message display, variable substitution, configurable
pointers, and lots of other damage. No additional copyright is imposed.