Library for creating tcl/tk applications from ui descriptions with combinators you can create your own widgets Ideas and parts of documentation from PAKCS WUI library
Author: Christof Kluss
Version: September 2008
renderOf
:: (a,b,c) -> a
|
errorOf
:: (a,b,c) -> b
|
conditionOf
:: (a,b,c) -> c
|
withRendering
:: UISpec a -> ([Widget WidgetRef (UIEnv -> IO ()) ()] -> Widget WidgetRef (UIEnv -> IO ()) ()) -> UISpec a
Puts a new rendering function into a UI specification. |
withError
:: UISpec a -> String -> UISpec a
Puts a new error message into a UI specification. |
withConditionIO
:: UISpec a -> (a -> IO Bool) -> UISpec a
Puts a new condition into a UI specification. |
withCondition
:: UISpec a -> (a -> Bool) -> UISpec a
Puts a new condition into a UI specification. |
transformWSpec
:: (a -> b,b -> a) -> UISpec a -> UISpec b
Transforms a UI specification from one type to another. |
adaptWSpec
:: (a -> b) -> UISpec a -> UISpec b
Adapt a UI specification to a new type. |
wInt
:: UISpec Int
A widget for editing integer values. |
wConstant
:: (a -> Widget WidgetRef (UIEnv -> IO ()) ()) -> UISpec a
A widget for values that are shown but cannot be modified. |
wHidden
:: UISpec a
A hidden widget for a value that is not shown in the UI. |
wStringStyles
:: [StyleClass] -> UISpec String
A widget for editing string values |
wString
:: UISpec String
A widget for editing string values |
wStringSize
:: a -> UISpec String
A widget for editing string values |
wRequiredString
:: UISpec String
A widget for editing string values that are required to be non-empty. |
wRequiredStringSize
:: a -> UISpec String
A widget for editing string values that are required to be non-empty. |
errorStyle
:: StyleClass
|
showError
:: ErrorRefs -> Maybe String -> UIEnv -> IO ()
|
renderError
:: Widget WidgetRef (UIEnv -> IO ()) () -> ErrorRefs -> Widget WidgetRef (UIEnv -> IO ()) ()
|
wPair
:: UISpec a -> UISpec b -> UISpec (a,b)
WUI combinator for pairs. |
wTriple
:: UISpec a -> UISpec b -> UISpec c -> UISpec (a,b,c)
WUI combinator for triples. |
w4Tuple
:: UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec (a,b,c,d)
WUI combinator for tuples of arity 4. |
w5Tuple
:: UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec (a,b,c,d,e)
WUI combinator for tuples of arity 5. |
w6Tuple
:: UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec (a,b,c,d,e,f)
WUI combinator for tuples of arity 6. |
w7Tuple
:: UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec g -> UISpec (a,b,c,d,e,f,g)
WUI combinator for tuples of arity 7. |
w8Tuple
:: UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec g -> UISpec h -> UISpec (a,b,c,d,e,f,g,h)
WUI combinator for tuples of arity 8. |
w11Tuple
:: UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec g -> UISpec h -> UISpec i -> UISpec j -> UISpec k -> UISpec (a,b,c,d,e,f,g,h,i,j,k)
WUI combinator for tuples of arity 11. |
wCons2
:: (a -> b -> c) -> UISpec a -> UISpec b -> UISpec c
UI combinator for constructors of arity 2. |
wTextArea
:: (Int,Int) -> UISpec String
A widget for editing string values in a text area. |
wList
:: UISpec a -> UISpec [a]
|
renderList
:: [Widget WidgetRef (UIEnv -> IO ()) ()] -> Widget WidgetRef (UIEnv -> IO ()) ()
|
wMultiCheckSelect
:: (a -> [Widget WidgetRef (UIEnv -> IO ()) ()]) -> [a] -> UISpec [a]
A widget to select a list of values from a given list of values via check boxes. |
newVars
:: [a]
|
wSelect
:: (a -> String) -> [a] -> UISpec a
A widget to select a value from a given list of values. |
wSelectInt
:: [Int] -> UISpec Int
A widget to select a value from a given list of integers (provided as the argument). |
wSelectBool
:: String -> String -> UISpec Bool
A widget to select a Boolean value via a selection box. |
renderTuple
:: [Widget WidgetRef (UIEnv -> IO ()) ()] -> Widget WidgetRef (UIEnv -> IO ()) ()
standard rendering of tuples as a row: |
tupleError
:: String
|
typedui2ui
:: UISpec a -> a -> (Widget WidgetRef (UIEnv -> IO ()) (),UIEnv -> IO (Maybe a),a -> UIEnv -> IO (),(a -> a) -> UIEnv -> IO ())
Generates an UI Widget and a handlers from a UI data specification, an initial value. |
typeduistore2ui
:: UISpec a -> a -> (a -> UIEnv -> IO ()) -> (Widget WidgetRef (UIEnv -> IO ()) (),UIEnv -> IO ())
Generates HTML editors and a handler from a WUI data specification, an initial value and an update form. |
runUISpec
:: UISpec a -> a -> (a -> UIEnv -> IO ()) -> IO ()
|
wCons3
:: (a -> b -> c -> d) -> UISpec a -> UISpec b -> UISpec c -> UISpec d
|
wCons4
:: (a -> b -> c -> d -> e) -> UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e
|
wCons5
:: (a -> b -> c -> d -> e -> f) -> UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f
|
wCons6
:: (a -> b -> c -> d -> e -> f -> g) -> UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec g
|
wCons7
:: (a -> b -> c -> d -> e -> f -> g -> h) -> UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec g -> UISpec h
|
wCons8
:: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec g -> UISpec h -> UISpec i
|
wCons11
:: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l) -> UISpec a -> UISpec b -> UISpec c -> UISpec d -> UISpec e -> UISpec f -> UISpec g -> UISpec h -> UISpec i -> UISpec j -> UISpec k -> UISpec l
|
A rendering is a function that combines the visualization of components of a data structure into some HTML expression.
Type synonym: Rendering = [UIWidget] -> UIWidget
UIParams specify the parameters of an individual UI component type:
Type synonym: UIParams a = (Rendering,String,a -> IO Bool)
The type of UI specifications. The first component are parameters specifying the behavior of this UI type (rendering, error message, and constraints on inputs). The second component is a "show" function returning an UI Widget, a "read" function and a "set" function The "read" function extract the values from the Widget. If the value is not legal, Nothing is returned.
Constructors:
UISpec
:: (UIParams a) -> (UIParams a -> a -> (UIWidget,UIEnv -> IO (Maybe a),a -> UIEnv -> IO ())) -> UISpec a
|
|
|
Puts a new rendering function into a UI specification.
|
Puts a new error message into a UI specification.
|
Puts a new condition into a UI specification.
|
Puts a new condition into a UI specification.
|
Transforms a UI specification from one type to another. |
Adapt a UI specification to a new type. For this purpose,
the first argument must be a transformation mapping values
from the old type to the new type. This function must be bijective
and operationally invertible (i.e., the inverse must be computable
by narrowing). Otherwise, use |
A widget for values that are shown but cannot be modified. The first argument is a mapping of the value into a UI Widget to show this value. |
A hidden widget for a value that is not shown in the UI. Usually, this is used in components of larger structures, e.g., internal identifiers, data base keys. |
A widget for editing string values |
A widget for editing string values |
A widget for editing string values that are required to be non-empty. |
A widget for editing string values that are required to be non-empty. |
|
|
WUI combinator for tuples of arity 4. |
WUI combinator for tuples of arity 5. |
WUI combinator for tuples of arity 6. |
WUI combinator for tuples of arity 7. |
WUI combinator for tuples of arity 8. |
WUI combinator for tuples of arity 11. |
UI combinator for constructors of arity 2. The first argument is the binary constructor. The second and third arguments are the UI specifications for the argument types. |
A widget for editing string values in a text area. The argument specifies the height and width of the text area. |
|
A widget to select a list of values from a given list of values via check boxes. The current values should be contained in the value list and are preselected. The first argument is a mapping from values into HTML expressions that are shown for each item after the check box. |
|
A widget to select a value from a given list of values. The current value should be contained in the value list and is preselected. The first argument is a mapping from values into strings to be shown in the selection widget. |
A widget to select a value from a given list of integers (provided as the argument). The current value should be contained in the value list and is preselected. |
A widget to select a Boolean value via a selection box. The arguments are the strings that are shown for the values True and False in the selection box, respectively.
|
standard rendering of tuples as a row:
|
|
Generates an UI Widget and a handlers from a UI data specification, an initial value. |
Generates HTML editors and a handler from a WUI data specification, an initial value and an update form. |
|
|
|