 | AutoForms-0.5.0: GUI library based upon generic programming (SYB3) | Contents | Index |
|
| Graphics.UI.AF.General.AutoForm |
|
|
|
|
|
| Synopsis |
|
| class TypePresentation a action comH builder satCxt com where | | mkCom :: (AutoForm action comH builder satCxt com, Sat (satCxt a)) => a -> com a |
| | | class Monad m => SimpleDialog m where | | | | infoDialog :: SimpleDialog m => String -> String -> m () | | | errorDialog :: SimpleDialog m => String -> String -> m () | | | confirmDialog :: SimpleDialog m => String -> String -> Bool -> m Bool | | | window :: AutoForm action comH builder satCxt com => com a -> action () | | | addCom :: AutoForm action comH builder satCxt com => com a -> builder (comH a) | | | mkCom :: (TypePresentation a action comH builder satCxt com, AutoForm action comH builder satCxt com, Sat (satCxt a)) => a -> com a | | | defaultCom :: (AutoForm action comH builder satCxt com, Sat (satCxt a)) => a -> com a | | | builderToCom :: AutoForm action comH builder satCxt com => builder (comH a) -> com a | | | builderCom :: (Sat (satCxt a), AutoForm action comH builder satCxt com, TypePresentation a action comH builder satCxt com) => a -> builder (comH a) | | | button :: AutoForm action comH builder satCxt com => String -> action () -> builder (comH ()) | | | addTimer :: AutoForm action comH builder satCxt com => Int -> action () -> builder () | | | class (Monad m, Monad action) => Process m action | m -> action where | | executeProcess :: String -> ExitCode -> action () -> String -> action () -> String -> action () -> m () |
| | | executeProcess :: Process m action => String -> ExitCode -> action () -> String -> action () -> String -> action () -> m () | | | state :: AutoForm action comH builder satCxt com => s -> builder (comH s) | | | makeChangedState :: (Eq a, AutoForm action comH builder satCxt com) => comH a -> builder (comH (Changed a)) | | | | | class Valued valued where | | mapValue :: old -> new -> old -> new -> old -> valued old -> valued new | | fstValue :: valued (valFst, valSnd) -> valued valFst | | sndValue :: valued (valFst, valSnd) -> valued valSnd | | noValue :: valued a -> valued () |
| | | mapValue :: Valued valued => old -> new -> old -> new -> old -> valued old -> valued new | | | fstValue :: Valued valued => valued (valFst, valSnd) -> valued valFst | | | sndValue :: Valued valued => valued (valFst, valSnd) -> valued valSnd | | | noValue :: Valued valued => valued a -> valued () | | | class Mergeable valued where | | merge :: valued left -> valued right -> valued (left, right) |
| | | postponeAction :: AutoForm action comH builder satCxt com => action a -> builder () | | | class Monad action => Action action comH | action -> comH, comH -> action where | | | | setEnabled :: Action action comH => comH a -> Bool -> action () | | | closeWindow :: Action action comH => action () | | | giveFocus :: Action action comH => comH a -> action () | | | class Monad action => ValuedAction valued action where | | | | modifyValue :: ValuedAction valued action => valued a -> (a -> a) -> action () | | | limit :: (AutoForm action comH builder satCxt com, Show a) => a -> IO Bool -> String -> com a -> com a | | | label :: AutoForm action comH builder satCxt com => String -> com a -> com a | | | class (Action action comH, Valued com, Valued comH, ValuedAction comH action, SimpleDialog action, SimpleDialog builder) => AutoForm action comH builder satCxt com | action -> comH, comH -> builder, builder -> satCxt, satCxt -> com, com -> action where | | defaultCom :: Sat (satCxt a) => a -> com a | | builderToCom :: builder (comH a) -> com a | | addCom :: com a -> builder (comH a) | | state :: s -> builder (comH s) | | postponeAction :: action a -> builder () | | button :: String -> action () -> builder (comH ()) | | addTimer :: Int -> action () -> builder () | | limit :: Show a => a -> IO Bool -> String -> com a -> com a | | label :: String -> com a -> com a | | addListener :: action () -> comH a -> builder (comH a) | | command :: (Sat (satCxt a), Sat (satCxt [String])) => builder () -> com a -> a -> IO String -> IO () | | window :: com a -> action () |
| | | commandImpl :: (AutoForm action comH builder satCxt com, MonadIO action, Sat (satCxt a), Sat (satCxt [String])) => com a -> a -> IO String -> builder () | | | command :: (AutoForm action comH builder satCxt com, Sat (satCxt a), Sat (satCxt [String])) => builder () -> com a -> a -> IO String -> IO () | | | addListener :: AutoForm action comH builder satCxt com => action () -> comH a -> builder (comH a) |
|
|
| Documentation |
|
| class TypePresentation a action comH builder satCxt com where |
| Instantiate this class if you want to specialize behavior for some type.
| | | Methods | | mkCom :: (AutoForm action comH builder satCxt com, Sat (satCxt a)) => a -> com a | | Constructs a component. The default implementation just calls
defaultCom. Override this if you want other behaviour.
|
| | Instances | |
|
|
| class Monad m => SimpleDialog m where |
| The methods of this class shows simple dialogs. E.g. dialogs which
do not take a component as input.
| | | Methods | | errorDialog | | :: String | Title
| | -> String | Message
| | -> m () | |
| | | infoDialog | | :: String | Title
| | -> String | Message
| | -> m () | |
| | | confirmDialog | | :: String | Title
| | -> String | Message
| | -> Bool | Should the dialog defalut to true or to false
| | -> m Bool | |
|
| | Instances | |
|
|
| Creating windows
|
|
| infoDialog |
|
|
| errorDialog |
|
|
| confirmDialog |
| :: SimpleDialog m | | | => String | Title
| | -> String | Message
| | -> Bool | Should the dialog defalut to true or to false
| | -> m Bool | |
|
|
| window :: AutoForm action comH builder satCxt com => com a -> action () |
| Constructs a new non-modal window.
|
|
| Components
|
|
| addCom :: AutoForm action comH builder satCxt com => com a -> builder (comH a) |
| Encapsulates (or adds) a component in the builder monad.
|
|
| Component constructors
|
|
| mkCom :: (TypePresentation a action comH builder satCxt com, AutoForm action comH builder satCxt com, Sat (satCxt a)) => a -> com a |
| Constructs a component. The default implementation just calls
defaultCom. Override this if you want other behaviour.
|
|
| defaultCom :: (AutoForm action comH builder satCxt com, Sat (satCxt a)) => a -> com a |
| Makes a default component. That is, it do not call mkCom.
|
|
| builderToCom :: AutoForm action comH builder satCxt com => builder (comH a) -> com a |
| Takes all components encapsulated in (added to) a builder
monad and packages them in a component.
|
|
| builderCom :: (Sat (satCxt a), AutoForm action comH builder satCxt com, TypePresentation a action comH builder satCxt com) => a -> builder (comH a) |
| Adds any value to AutoForm interface. The following equation holds:
builderCom x = addCom $ mkCom x
|
|
| Valueless components
|
|
| button |
| :: AutoForm action comH builder satCxt com | | | => String | The name displayed on the button
| | -> action () | The action to execute when the button is pressed
| | -> builder (comH ()) | | | Creates a button component.
|
|
|
| addTimer |
| :: AutoForm action comH builder satCxt com | | | => Int | Number of miliseconds between execution of the aciton
| | -> action () | The action to execute repeatedly
| | -> builder () | | | Creates an action which is repeatedly executed
|
|
|
| class (Monad m, Monad action) => Process m action | m -> action where |
| | Methods | | executeProcess | | :: String | The command to execute, including parameters
| | -> ExitCode -> action () | Action executed when the process ends
| | -> String -> action () | Action executed when input is recieved on standard input
| | -> String -> action () | Action executed when input is recieved on standard error
| | -> m () | | | Executes an external process, using the OS build-in command shell.
|
|
| | Instances | |
|
|
| executeProcess |
| :: Process m action | | | => String | The command to execute, including parameters
| | -> ExitCode -> action () | Action executed when the process ends
| | -> String -> action () | Action executed when input is recieved on standard input
| | -> String -> action () | Action executed when input is recieved on standard error
| | -> m () | | | Executes an external process, using the OS build-in command shell.
|
|
|
| State
|
|
| state :: AutoForm action comH builder satCxt com => s -> builder (comH s) |
| Creates a component solely containing some state. It has no visual representation.
|
|
| makeChangedState :: (Eq a, AutoForm action comH builder satCxt com) => comH a -> builder (comH (Changed a)) |
| Makes a state, which reflects whether a components value has changed.
|
|
| data Changed a |
| Constructors | | Instances | |
|
|
| Mapping the component type
|
|
| These functions do not change the GUI-user sees the components -
only how the programmer sees them. E.g. they change state and/or
value, not presentation.
|
|
| Value
|
|
| class Valued valued where |
| | Methods | | mapValue | | :: | | | => 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
|
| | | fstValue :: valued (valFst, valSnd) -> valued valFst | | Hides the second part of a 2-tuple
| | | sndValue :: valued (valFst, valSnd) -> valued valSnd | | Hides the first part of a 2-tuple
| | | noValue :: valued a -> valued () | | Hides the value of a valued object.
|
| | Instances | |
|
|
| 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
|
|
|
| fstValue :: Valued valued => valued (valFst, valSnd) -> valued valFst |
| Hides the second part of a 2-tuple
|
|
| sndValue :: Valued valued => valued (valFst, valSnd) -> valued valSnd |
| Hides the first part of a 2-tuple
|
|
| noValue :: Valued valued => valued a -> valued () |
| Hides the value of a valued object.
|
|
| class Mergeable valued where |
| | Methods | | merge :: valued left -> valued right -> valued (left, right) | | Currently unused. So do not use it.
|
| | Instances | |
|
|
| Actions
|
|
| postponeAction :: AutoForm action comH builder satCxt com => action a -> builder () |
|
| class Monad action => Action action comH | action -> comH, comH -> action where |
| | Methods | | setEnabled :: comH a -> Bool -> action () | | Sets whether the component is enabled. That is, if the user can change it's value
or in case of buttons if it can be pressed.
| | | closeWindow :: action () | | Closes the window this action is attached to.
| | | giveFocus :: comH a -> action () | | Will give this compoment focus
|
| | Instances | |
|
|
| setEnabled :: Action action comH => comH a -> Bool -> action () |
| Sets whether the component is enabled. That is, if the user can change it's value
or in case of buttons if it can be pressed.
|
|
| closeWindow :: Action action comH => action () |
| Closes the window this action is attached to.
|
|
| giveFocus :: Action action comH => comH a -> action () |
| Will give this compoment focus
|
|
| Setting/getting value of component
|
|
| class Monad action => ValuedAction valued action where |
|
|
| modifyValue :: ValuedAction valued action => valued a -> (a -> a) -> action () |
| Updates the value of a component
|
|
| Presentation of component
|
|
| 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.
|
|
|
| label |
| :: AutoForm action comH builder satCxt com | | | => String | The label.
| | -> com a | | | -> com a | | | Labels a component. This label will usually be displayed to the GUI-user.
|
|
|
| Misc
|
|
| class (Action action comH, Valued com, Valued comH, ValuedAction comH action, SimpleDialog action, SimpleDialog builder) => AutoForm action comH builder satCxt com | action -> comH, comH -> builder, builder -> satCxt, satCxt -> com, com -> action where |
| | Methods | | defaultCom :: Sat (satCxt a) => a -> com a | | Makes a default component. That is, it do not call mkCom.
| | | builderToCom :: builder (comH a) -> com a | | Takes all components encapsulated in (added to) a builder
monad and packages them in a component.
| | | addCom :: com a -> builder (comH a) | | Encapsulates (or adds) a component in the builder monad.
| | | state :: s -> builder (comH s) | | Creates a component solely containing some state. It has no visual representation.
| | | postponeAction :: action a -> builder () | | | button | | :: String | The name displayed on the button
| | -> action () | The action to execute when the button is pressed
| | -> builder (comH ()) | | | Creates a button component.
|
| | | addTimer | | :: Int | Number of miliseconds between execution of the aciton
| | -> action () | The action to execute repeatedly
| | -> builder () | | | Creates an action which is repeatedly executed
|
| | | limit | | :: 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.
|
| | | label | | :: | | | => String | The label.
| | -> com a | | | -> com a | | | Labels a component. This label will usually be displayed to the GUI-user.
|
| | | addListener :: action () -> comH a -> builder (comH a) | | Attaches an action to a component. The action is executed each time
the component changes value.
| | | command | | :: (Sat (satCxt a), Sat (satCxt [String])) | | | => builder () | Not used in WxForm, just a proxy to identify AutoForm instance
| | -> com a | The component the user edits before executing the command. It's
value is the input to the action/command to execute.
| | -> a -> IO String | Command to execute
| | -> IO () | | | Creates a window, solely used to execute a command.
|
| | | window :: com a -> action () | | Constructs a new non-modal window.
|
| | Instances | |
|
|
| commandImpl |
| :: (AutoForm action comH builder satCxt com, MonadIO action, Sat (satCxt a), Sat (satCxt [String])) | | | => com a | | | -> a -> IO String | Command to execute
| | -> builder () | |
|
|
| command |
| :: (AutoForm action comH builder satCxt com, Sat (satCxt a), Sat (satCxt [String])) | | | => builder () | Not used in WxForm, just a proxy to identify AutoForm instance
| | -> com a | The component the user edits before executing the command. It's
value is the input to the action/command to execute.
| | -> a -> IO String | Command to execute
| | -> IO () | | | Creates a window, solely used to execute a command.
|
|
|
| addListener :: AutoForm action comH builder satCxt com => action () -> comH a -> builder (comH a) |
| Attaches an action to a component. The action is executed each time
the component changes value.
|
|
| Produced by Haddock version 2.0.0.0 |