| AutoForms-0.5.0: GUI library based upon generic programming (SYB3) | Contents | Index |
|
|
|
|
|
Description |
AutoForm functions closely integrated with WxHaskell.
|
|
Synopsis |
|
|
|
|
Example
|
|
An example of using AutoForm and WxHaskell together:
import Graphics.UI.WX
import Graphics.UI.AF.AFWx
main :: IO ()
main = start $
do w <- frame [text := "Small example"]
p <- panel w []
wid <- makeWidget (0.96::Double, 123::Int, "asdf") p [ ]
setWidButton <- button p [ text := "Set widget"
, on command := set wid [ value := (0.32, 456, "New Value") ]
]
set w [ layout := container p $ fill $ column 10
[ widget wid, widget setWidButton ]
]
|
|
makeWidget :: ECCreator a => a -> Window w -> [Prop (AFWx a)] -> IO (AFWx a) |
A more constrained version of makeWidget'.
|
|
makeWidget' |
:: ECCreator a | | => EC a -> EC a | Used to transform the created widget. See limit, giveFocus
and the functions in AF.AutoForm.
Also see the EmbeddedTree example.
| -> a | The value to represent in a GUI.
| -> Window w | The window (or panel) to represent the value in.
| -> [Prop (AFWx a)] | Initial properties to set.
| -> IO (AFWx a) | | Creating a widget for any type, which is an instance of ECCreator.
|
|
|
data AFWx a |
Contains a widget representing an arbitrary type.
| Instances | |
|
|
module Graphics.UI.AF.General.MySYB |
|
EC
|
|
data EC a |
Component type for the Wx instance of AutoForm
| Instances | |
|
|
class (Data ECCreatorD a, GInstanceCreator a, Show a, TypePresentation a WxAct ComH WxM ECCreatorD EC) => ECCreator a |
Main class for generic construction of EC - see also
genericEC. Instantiate this class to make custom construction of
ECs.
| | Instances | |
|
|
limit |
:: (AutoForm action comH builder satCxt com, Show a) | | => a -> IO Bool | The limit.
| -> String | Error message displayed to the GUI-user, if the limit is violated.
| -> com a | | -> com a | | Limits the values a GUI-user can set a component to.
|
|
|
giveFocus :: Action action comH => comH a -> action () |
Will give this compoment focus
|
|
mapValue |
:: Valued valued | | => old -> new | old to new conversion
| -> old -> new -> old | new to old conversions. This functions also get the current
old value as input.
| -> valued old | old component
| -> valued new | new component
| Maps the value of a compoent
|
|
|
GUI-layout of EC types
|
|
layoutAs :: LayoutManager -> EC a -> EC a |
Attach a new layout manager to an EC. Layout manager such as
dualColumn or singleRow can be used.
|
|
singleColumn :: LayoutManager |
Puts one or more Layouts in a column, without any heading (label).
|
|
dualColumn :: LayoutManager |
|
singleRow :: LayoutManager |
Arranges all gui components (widgets) in a row.
|
|
finalDepth :: EC a -> EC a |
Tells WxForm to try to keep the GUI as small as possible. It will
only work from this EC and it's sub-components (sub-ECs).
|
|
Produced by Haddock version 2.0.0.0 |