Interface for ui descriptions
Author: Christof Kluss
Version: September 2008
showWidgetKind
:: WidgetKind a b c -> String
|
addStyle
:: Widget a b c -> StyleClass -> Widget a b c
|
addStyles
:: Widget a b c -> [StyleClass] -> Widget a b c
|
setStyles
:: Widget a b c -> [StyleClass] -> Widget a b c
|
addHandler
:: Widget a b c -> Handler b c -> Widget a b c
|
addHandlers
:: Widget a b c -> [Handler b c] -> Widget a b c
|
setHandlers
:: Widget a b c -> [Handler b c] -> Widget a b c
|
setRef
:: Widget a b c -> Ref a -> Widget a b c
|
getRef
:: Widget a b c -> (Ref a,Widget a b c)
|
runUI
:: String -> Widget () (UIEnv -> IO ()) () -> IO ()
Run a Widget in a new window. |
exitUI
:: UIEnv -> IO ()
An event handler for terminating the GUI. |
getValue
:: Ref () -> UIEnv -> IO String
Gets the String value of a variable in an UI. |
setValue
:: Ref () -> String -> UIEnv -> IO ()
Sets the String value of a variable in an UI. |
updateValue
:: (String -> String) -> Ref () -> UIEnv -> IO ()
Updates the (String) value of a variable w.r.t. |
appendValue
:: Ref () -> String -> UIEnv -> IO ()
Appends a String value to the contents of a widget. |
changeStyles
:: Ref () -> [StyleClass] -> UIEnv -> IO ()
Changes the style of a widget |
setHandler
:: Ref () -> Event -> (UIEnv -> IO ()) -> UIEnv -> IO ()
Sets a new Handler to a Widget referred by the first argument. |
setDisabled
:: Ref () -> Bool -> UIEnv -> IO ()
Sets the state of a widget to disabled (inactive) or active (inactive widgets do not accept any events) |
addCanvas
:: Ref () -> [CanvasItem] -> UIEnv -> IO ()
Adds a list of canvas items to a canvas referred by the first argument. |
showPopup
:: String -> Widget () (UIEnv -> IO ()) () -> UIEnv -> IO ()
Runs a Widget in a new window. |
showMessage
:: String -> UIEnv -> IO ()
Shows a String Message in a new window. |
colS
:: [StyleClass] -> [Widget a b c] -> Widget a b c
Vertical alignment of widgets. |
col
:: [Widget a b c] -> Widget a b c
|
rowS
:: [StyleClass] -> [Widget a b c] -> Widget a b c
Horizontal alignment of widgets. |
row
:: [Widget a b c] -> Widget a b c
|
matrixS
:: [StyleClass] -> [[Widget a b c]] -> Widget a b c
A 2-dimensional (matrix) alignment of widgets |
matrix
:: [[Widget a b c]] -> Widget a b c
|
entry
:: Ref a -> String -> Widget a b c
An entry widget for entering single lines |
entryS
:: [StyleClass] -> Ref a -> String -> Widget a b c
|
label
:: String -> Widget a b c
A label for showing a text |
labelS
:: [StyleClass] -> String -> Widget a b c
|
button
:: a -> String -> Widget b a c
|
buttonS
:: [StyleClass] -> a -> String -> Widget b a c
|
simpleButton
:: Ref a -> String -> Widget a b c
A button without handler, but reference |
simpleButtonS
:: [StyleClass] -> Ref a -> String -> Widget a b c
|
checkButton
:: Ref a -> b -> String -> Bool -> Widget a b c
A check button: it has value "0" if it is unchecked and value "1" if it is checked |
checkButtonS
:: [StyleClass] -> Ref a -> b -> String -> Bool -> Widget a b c
|
simpleCheckButton
:: Ref a -> String -> Bool -> Widget a b c
|
simpleCheckButtonS
:: [StyleClass] -> Ref a -> String -> Bool -> Widget a b c
|
canvas
:: Ref a -> Int -> Int -> Widget a b c
|
canvasS
:: [StyleClass] -> Ref a -> Int -> Int -> Widget a b c
|
textEdit
:: Ref a -> String -> Int -> Int -> Widget a b c
|
textEditS
:: [StyleClass] -> Ref a -> String -> Int -> Int -> Widget a b c
|
scale
:: Ref a -> b -> Int -> Int -> Widget a b c
A scale widget to input values by a slider |
scaleS
:: [StyleClass] -> Ref a -> b -> Int -> Int -> Widget a b c
|
message
:: Ref a -> Widget a b c
A message for showing simple string values |
messageS
:: [StyleClass] -> Ref a -> Widget a b c
|
:: [Widget a b c] -> Widget a b c
A menubar contains a list of menus |
:: [StyleClass] -> [Widget a b c] -> Widget a b c
|
:: String -> [Widget a b c] -> Widget a b c
A button with a pull-down menu for a menubar |
:: [StyleClass] -> String -> [Widget a b c] -> Widget a b c
|
:: Widget a b c
A separator between menu entries |
:: [StyleClass] -> Widget a b c
|
:: a -> String -> Widget b a c
A button with an associated command and a label string |
:: [StyleClass] -> a -> String -> Widget b a c
|
listBox
:: Int -> [String] -> Ref a -> b -> Widget a b c
A widget containing a list of items for selection |
listBoxS
:: [StyleClass] -> Int -> [String] -> Ref a -> b -> Widget a b c
|
selection
:: Ref a -> [String] -> Widget a b c
A selection button with a reference and a list of name/value pairs. |
selectionInitial
:: Ref a -> [String] -> Int -> Widget a b c
A selection button with a reference, a list of name/value pairs, and a preselected item in this list. |
selectionInitialS
:: [StyleClass] -> Ref a -> [String] -> Int -> Widget a b c
|
radio_main
:: Ref a -> String -> Widget a b c
A main button of a radio (initially "on") with a reference and a value. |
radio_other
:: Ref a -> String -> Widget a b c
A further button of a radio (initially "off") with a reference (identical to the main button of this radio) and a value. |
showBorderStyle
:: BorderStyle -> String
|
showColor
:: Color -> String
Converts a style value into its textual representation. |
showPos
:: Position -> String
|
Constructors:
Cmd
:: a -> Command a b
SpicyDoc
:: b -> Command a b
The data type of references to widgets in a UI window.
Constructors:
Ref
:: a -> Ref a
Constructors:
The generic type of a widget in an UI.
Constructors:
Widget
:: (WidgetKind a b c) -> (Maybe String) -> (Maybe (Ref a)) -> [Handler b c] -> [StyleClass] -> [Widget a b c] -> Widget a b c
The data type of possible events on which handlers can react.
Constructors:
DefaultEvent
:: Event
FocusOut
:: Event
FocusIn
:: Event
MouseButton1
:: Event
MouseButton2
:: Event
MouseButton3
:: Event
KeyPress
:: Event
Return
:: Event
Change
:: Event
Click
:: Event
DoubleClick
:: Event
Constructors:
Col
:: WidgetKind a b c
Row
:: WidgetKind a b c
Matrix
:: [[Widget a b c]] -> WidgetKind a b c
Label
:: WidgetKind a b c
Button
:: WidgetKind a b c
Entry
:: WidgetKind a b c
TextEdit
:: Int -> Int -> WidgetKind a b c
Scale
:: Int -> Int -> WidgetKind a b c
CheckButton
:: Bool -> WidgetKind a b c
Menu
:: WidgetKind a b c
MenuSeparator
:: WidgetKind a b c
MenuBar
:: WidgetKind a b c
MenuItem
:: WidgetKind a b c
Canvas
:: Int -> Int -> WidgetKind a b c
ListBox
:: Int -> [String] -> Int -> WidgetKind a b c
ListBoxItem
:: String -> Bool -> WidgetKind a b c
Name
:: String -> WidgetKind a b c
Link
:: WidgetKind a b c
RadioButton
:: Bool -> WidgetKind a b c
The data type of items in a canvas.
Constructors:
CLine
:: [(Int,Int)] -> String -> CanvasItem
CPolygon
:: [(Int,Int)] -> String -> CanvasItem
CRectangle
:: (Int,Int) -> (Int,Int) -> String -> CanvasItem
COval
:: (Int,Int) -> (Int,Int) -> String -> CanvasItem
CText
:: (Int,Int) -> String -> String -> CanvasItem
Constructors:
Class
:: [Style] -> StyleClass
Constructors:
Center
:: Position
Left
:: Position
Right
:: Position
Top
:: Position
Bottom
:: Position
Constructors:
X
:: Direction
Y
:: Direction
Both
:: Direction
The data type of possible styles.
Constructors:
Align
:: Position -> Style
TextAlign
:: Position -> Style
TextColor
:: Color -> Style
Fill
:: Direction -> Style
Height
:: Int -> Style
Width
:: Int -> Style
Active
:: Bool -> Style
Fg
:: Color -> Style
Bg
:: Color -> Style
Font
:: FontStyle -> Style
Border
:: BorderStyle -> Style
Display
:: Bool -> Style
NameValue
:: String -> String -> Style
Constructors:
Dotted
:: BorderStyle
Dashed
:: BorderStyle
Solid
:: BorderStyle
Constructors:
Bold
:: FontStyle
Italic
:: FontStyle
Underline
:: FontStyle
The data type of possible colors.
Constructors:
Black
:: Color
Blue
:: Color
Brown
:: Color
Cyan
:: Color
Gold
:: Color
Gray
:: Color
Green
:: Color
Magenta
:: Color
Orange
:: Color
Pink
:: Color
Purple
:: Color
Red
:: Color
Tomato
:: Color
Turquoise
:: Color
Violet
:: Color
White
:: Color
Yellow
:: Color
Default
:: Color
Constructors:
|
|
|
|
|
|
|
|
Updates the (String) value of a variable w.r.t. to an update function. |
Appends a String value to the contents of a widget. |
Changes the style of a widget |
Sets a new Handler to a Widget referred by the first argument. An existing Handler for the same event type is overridden |
Sets the state of a widget to disabled (inactive) or active (inactive widgets do not accept any events) |
Adds a list of canvas items to a canvas referred by the first argument. |
Runs a Widget in a new window. |
Shows a String Message in a new window. |
Vertical alignment of widgets.
|
|
Horizontal alignment of widgets.
|
|
A 2-dimensional (matrix) alignment of widgets
|
|
An entry widget for entering single lines
|
|
A label for showing a text
|
|
|
|
A button without handler, but reference
|
|
A check button: it has value "0" if it is unchecked and value "1" if it is checked
|
|
|
|
|
|
|
|
A scale widget to input values by a slider
|
|
A message for showing simple string values
|
|
A widget containing a list of items for selection |
|
A selection button with a reference and a list of name/value pairs. The names are shown in the selection and the value is returned for the selected name. |
A selection button with a reference, a list of name/value pairs, and a preselected item in this list. The names are shown in the selection and the value is returned for the selected name.
|
|
A main button of a radio (initially "on") with a reference and a value. The value is returned of this button is on. A complete radio button suite always consists of a main button (radiomain) and some further buttons (radioothers) with the same reference. Initially, the main button is selected (or nothing is selected if one uses radiomainoff instead of radio_main). The user can select another button but always at most one button of the radio can be selected. The value corresponding to the selected button is returned in the environment for this radio reference.
|
A further button of a radio (initially "off") with a reference (identical to the main button of this radio) and a value. The value is returned of this button is on.
|
|
Converts a style value into its textual representation.
|