AutoForms-0.5.0: GUI library based upon generic programming (SYB3)ContentsIndex
Graphics.UI.AF.AFWx
Contents
Example
EC
GUI-layout of EC types
Description
AutoForm functions closely integrated with WxHaskell.
Synopsis
makeWidget :: ECCreator a => a -> Window w -> [Prop (AFWx a)] -> IO (AFWx a)
makeWidget' :: ECCreator a => EC a -> EC a -> a -> Window w -> [Prop (AFWx a)] -> IO (AFWx a)
data AFWx a
module Graphics.UI.AF.General.MySYB
data EC a
class (Data ECCreatorD a, GInstanceCreator a, Show a, TypePresentation a WxAct ComH WxM ECCreatorD EC) => ECCreator a
limit :: (AutoForm action comH builder satCxt com, Show a) => a -> IO Bool -> String -> com a -> com a
giveFocus :: Action action comH => comH a -> action ()
mapValue :: Valued valued => old -> new -> old -> new -> old -> valued old -> valued new
layoutAs :: LayoutManager -> EC a -> EC a
singleColumn :: LayoutManager
dualColumn :: LayoutManager
singleRow :: LayoutManager
finalDepth :: EC a -> EC a
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 aUsed to transform the created widget. See limit, giveFocus and the functions in AF.AutoForm. Also see the EmbeddedTree example.
-> aThe value to represent in a GUI.
-> Window wThe 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.
show/hide Instances
Valued AFWx
Widget (AFWx a)
Able (AFWx a)
Commanding (AFWx a)
module Graphics.UI.AF.General.MySYB
EC
data EC a
Component type for the Wx instance of AutoForm
show/hide Instances
Valued EC
Mergeable EC
AutoForm WxAct ComH WxM SatCxt EC
Dialog WxAct ComH WxM SatCxt EC
Labeled (EC a)
Merge ((,) (EC a) (EC b)) (EC ((,) a b))
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.
show/hide Instances
limit
:: (AutoForm action comH builder satCxt com, Show a)
=> a -> IO BoolThe limit.
-> StringError 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 -> newold to new conversion
-> old -> new -> oldnew to old conversions. This functions also get the current old value as input.
-> valued oldold component
-> valued newnew 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