As can be seen, mp.form() accepts a list of hashes describing the fields
to be shown to the user and returns an array with the filled values. On
user cancellation, mp.form() return NULL; otherwise, an array with the
same number of elements as the array sent as argument is returned, having
each entered value in each element.

The following widget types exist:

text

A field to enter text.

password

A field to enter text, but hiding its input.

checkbox

A field to enter yes/no values.

list

A field to select an element from a given list of values.

Every widget can have some common attributes:

value

The initial value.

label

A text string to be shown near the field, describing it.

Other attributes can exist for each widget.

Depending on the driver, a dialog box can show OK and Cancel buttons,
and accept cancellation by hitting the escape hey.

Text widgets

Text widgets are used, unsurprisingly, for entering free text. No limit
exist on the string size nor the accepted character set. If a value
attribute is set, it's shown as the default value, allowing edition.

The following additional attributes can be used in text widgets:

history

A tag marking the history set. Every time a dialog is accepted (i.e. not cancelled), the entered value is stored in the history set named by this attribute. History is accesible by pressing the cursor-up and cursor-down keys.

Checkbox widgets

Checkbox widgets are used to set alternatives, i.e., values that can be
true or false. Depending on the driver, they are shown as real checkboxes
or [Y/N] questions. The initial value can be non-zero for true and
zero for false. On return, the value can be 1 or 0.