ยค inputPairF, InF, et al

Combining data entry fields

Types

inputPairF :: InF a1 b1 -> InF a2 b2 -> InF (a1, a2) (b1, b2)
type InF a b = F a (InputMsg b)

inputListF :: Eq a => [(a, InF b c)] -> InF [(a, b)] [(a, c)]
inputThroughF :: InF a a -> InF a a

Synopsis

inputPairF f1 f2

Description

These functions are used to create fill-in forms (fudgets for inputting composite values). These can, e.g., be used as arguments to inputPopupF to create popup dialog windows.

Arguments

f1 :: InF a1 b1
one input fudget.
f2 :: InF a2 b2
another input fudget.

Input

pairs that are split and sent to the argument fudgets.

Output

an InputMsg containing (x1,y0) if f1 outputs an InputMsg containing x1 and analogously (x0,y1) if f2 outputs something. Here, x0 and y0 are values previously received from f1 and f2.

We use the type InF for fudgets that are suitable as form elements. For the forms to work properly, such a fudget should produce output that allows its state (the value it displays and allows the user to edit) to be accurately tracked. This amounts to the following:

  1. Whenever the state changes, it should output an InputMsg indicating the new state. Most input fudgets in the library have this property. (inputThroughF can be used to make a fudget propagate changes received on the input to the output, in case a fudget doesn't do that by itself.)

  2. At creation time, it should output its initial state. Most fudgets in the library do not have this property. However, for forms used as arguments to inputPopupF, this may not be necessary, since you can see to it that the fudget receives some input (a default value) and hence produces some output (assuming to property 1 holds) when the dialog window is popped up.

To use fudgets like radioGroupF and toggleButtonF, whose output aren't of type InputMsg, as form elements, the function inputChange can be used as a postprocessor.

Example

 inputPairF ("Login:" `labLeftOfF` stringF) ("Password:" `labLeftOfF` passwdF)

See Also

InputMsg, inputPopupF.