| AutoForms-0.5.0: GUI library based upon generic programming (SYB3) | Contents | Index |
|
Graphics.UI.AF.WxForm.ComIO |
|
|
|
|
Description |
The ComIO type
|
|
Synopsis |
|
io :: MonadIO m => IO a -> m a | | type ComIO = ComActions IO IORef | | guiComM :: (RefMonad builder ref, Show a, MonadIO builder) => AddGui builder com a -> IO EventID -> Maybe (a -> a -> Bool) -> a -> (a -> IO ()) -> Window w -> GUI -> builder (com a, GuiComHelper a) | | data GuiComHelper a = GuiComHelper {} | | type AddGui builder com a = forall w. Window w -> GUI -> ComIO a -> builder (com a) | | tellUserOfIllegalValue :: String -> IO () | | type LimitIO a = Limit IO a | | type OnChangeVarsIO = OnChangeVars IO IORef | | type ListenerIO = Listener IORef IO | | data Monad act => ComActions act ref a | | setAppendValue :: RefMonad act ref => (a -> act x) -> ComActions act ref a -> ComActions act ref a | | comActionsAddListener :: (RefMonad m ref, Monad act) => ComActions act ref a -> Listener ref act () -> m () | | setParentListener :: (RefMonad m ref, Monad act) => ComActions act ref a -> Listener ref act () -> m () | | mkComActions :: MkComActions act ref a | | type MkComActions act ref a = RefMonad act ref => act a -> (a -> Listener ref act ()) -> OnChangeVars act ref -> act Bool -> (Bool -> act ()) -> (Limit act a -> act ()) -> ComActions act ref a | | staticComActions :: (RefMonad act ref, RefMonad m ref, InterleaveMonad act) => a -> m (ComActions act ref a) | | getterSetterComActions :: (RefMonad builder ref, RefMonad act ref, InterleaveMonad act, Monad act) => act a -> (a -> Listener ref act ()) -> builder (ComActions act ref a) | | makeComProxy :: (RefMonad builder ref, RefMonad act ref) => ComActions act ref a -> builder (ComActions act ref a -> Listener ref act (), ComActions act ref a) | | type Limit m a = a -> m LimitResult | | type LimitRef m ref a = ref [Limit m a] | | | | makeLimitVar :: (RefMonad m ref, RefMonad act ref) => m (LimitRef act ref a) | | addToLimitVar :: RefMonad m ref => LimitRef m ref a -> Limit m a -> m () | | checkLimits :: (RefMonad m ref, Show a) => LimitRef m ref a -> a -> m LimitResult | | | | testInput :: (RefMonad act ref, Show a, Observable oc (Listener ref act)) => (String -> act ()) -> act EventID -> oc -> (a -> act ()) -> ref a -> LimitRef act ref a -> Maybe (a -> a -> Bool) -> SetOn -> a -> act () | | newtype RefMonad act ref => Listener ref act a = Listener {} | | data EventID | | runListener :: RefMonad act ref => act EventID -> Listener ref act a -> act a | | signalGuiChange :: (Observable o (Listener ref act), RefMonad act ref) => act EventID -> o -> act () | | runNoSignalingListener :: RefMonad act ref => Listener ref act a -> act a | | data OnChangeVars act ref = OnChangeVars {} | | makeOnChangeVar :: (Monad act, RefMonad m ref) => m (OnChangeVars act ref) | | data ListenerT eid m a | | class Monad m => MonadListener m where | | | eventIDFactory :: (Num n, RefMonad m r, RefMonad m2 r) => m2 (m n) | | runListenerTWithFactory :: Monad m => m eid -> ListenerT eid m a -> m a | | class MonadListener m => Observable o m where | | | whenNotVisitedHelper :: (Eq eid, Monad m) => (o -> ListenerT eid m eid) -> o -> ListenerT eid m () -> ListenerT eid m () | | visitHelper :: Monad m => (t -> eid -> m a) -> t -> ListenerT eid m a | | signalChangeHelper :: Observable o t => (o -> t ()) -> o -> t () | | debugPrintEID :: Show eid => ListenerT eid IO () | | debugListenerPrintEID :: RefMonad IO ref => Listener ref IO () | | spliterToComActions :: forall act ref builder a. (InterleaveMonad act, RefMonad act ref, RefMonad builder ref) => Spliter act ref a a -> builder (ComActions act ref a) | | |
|
|
Documentation |
|
io :: MonadIO m => IO a -> m a |
|
ComIO
|
|
type ComIO = ComActions IO IORef |
|
Component construction
|
|
guiComM :: (RefMonad builder ref, Show a, MonadIO builder) => AddGui builder com a -> IO EventID -> Maybe (a -> a -> Bool) -> a -> (a -> IO ()) -> Window w -> GUI -> builder (com a, GuiComHelper a) |
|
data GuiComHelper a |
IO-commands helped in the construction of components. Is used by
function that construct components via guiComM.
| Constructors | GuiComHelper | | testInputParm' :: SetOn -> a -> IO () | | readGuiOnGetValParm' :: Eq a => IO a -> IO () | |
|
|
|
|
type AddGui builder com a = forall w. Window w -> GUI -> ComIO a -> builder (com a) |
|
Handle limits
|
|
tellUserOfIllegalValue :: String -> IO () |
Use this function to tell the GUI-user that he violated some limit.
|
|
type LimitIO a = Limit IO a |
|
Listener monad and signaling of change
|
|
type OnChangeVarsIO = OnChangeVars IO IORef |
|
type ListenerIO = Listener IORef IO |
|
ComAction manipulation
|
|
data Monad act => ComActions act ref a |
Component actions
| Instances | |
|
|
setAppendValue :: RefMonad act ref => (a -> act x) -> ComActions act ref a -> ComActions act ref a |
|
comActionsAddListener :: (RefMonad m ref, Monad act) => ComActions act ref a -> Listener ref act () -> m () |
|
setParentListener :: (RefMonad m ref, Monad act) => ComActions act ref a -> Listener ref act () -> m () |
|
ComAction-creator functions
|
|
mkComActions :: MkComActions act ref a |
Creates a ComActions object.
|
|
type MkComActions act ref a = RefMonad act ref => act a -> (a -> Listener ref act ()) -> OnChangeVars act ref -> act Bool -> (Bool -> act ()) -> (Limit act a -> act ()) -> ComActions act ref a |
|
staticComActions :: (RefMonad act ref, RefMonad m ref, InterleaveMonad act) => a -> m (ComActions act ref a) |
Returns a ComActions type, which just stores values when setVal is
called and retrieves values when getVal is called. It should be
used when no GUI can be created for a type.
|
|
getterSetterComActions :: (RefMonad builder ref, RefMonad act ref, InterleaveMonad act, Monad act) => act a -> (a -> Listener ref act ()) -> builder (ComActions act ref a) |
Creates a ComActions object with custom getter/setter -functions.
|
|
makeComProxy :: (RefMonad builder ref, RefMonad act ref) => ComActions act ref a -> builder (ComActions act ref a -> Listener ref act (), ComActions act ref a) |
Creates a ComAction proxy. That is, a ComAction which contains another ComAction.
The contained ComAction can be updated by using the returned Listener action.
|
|
type Limit m a = a -> m LimitResult |
|
type LimitRef m ref a = ref [Limit m a] |
|
data LimitResult |
|
|
makeLimitVar :: (RefMonad m ref, RefMonad act ref) => m (LimitRef act ref a) |
Constructs a LimitRef with no limits in it.
|
|
addToLimitVar :: RefMonad m ref => LimitRef m ref a -> Limit m a -> m () |
Adds a limit to a LimitRef
|
|
checkLimits |
:: (RefMonad m ref, Show a) | | => LimitRef m ref a | | -> a | The new value
| -> m LimitResult | The result of the limit check
| Checks if a value violates any limit.
|
|
|
data SetOn |
|
|
testInput :: (RefMonad act ref, Show a, Observable oc (Listener ref act)) => (String -> act ()) -> act EventID -> oc -> (a -> act ()) -> ref a -> LimitRef act ref a -> Maybe (a -> a -> Bool) -> SetOn -> a -> act () |
Tests input to see if it respects the limits attached to some
object (the oc parameter below).
|
|
newtype RefMonad act ref => Listener ref act a |
Listeners listens for signals send from Observable objects
OnChangeVars and ComActions).
| Constructors | | Instances | |
|
|
data EventID |
The event identification type used by ComActions and Listener.
| Instances | |
|
|
runListener |
:: RefMonad act ref | | => act EventID | The event-id factory to use.
| -> Listener ref act a | | -> act a | | Runs a listener using a specific event-id factory.
|
|
|
signalGuiChange :: (Observable o (Listener ref act), RefMonad act ref) => act EventID -> o -> act () |
Signals a change which occured in the GUI, such as the user
changed some components value, a timer was triggered, a menu item
were choosen by the user, ...
|
|
runNoSignalingListener :: RefMonad act ref => Listener ref act a -> act a |
Used to bring action upto listener level (see WxHaskell.Valued instance)
The listener is runned with noSignalEID. That means the event will not
propagate though the network of listeners and observers.
|
|
data OnChangeVars act ref |
Constructors | | Instances | |
|
|
makeOnChangeVar :: (Monad act, RefMonad m ref) => m (OnChangeVars act ref) |
Constructs an OnChangeVar with no listeners.
|
|
Listener transformer
|
|
data ListenerT eid m a |
Instances | |
|
|
class Monad m => MonadListener m where |
| Methods | postponeEvent :: m () -> m () |
| | Instances | |
|
|
Invocating the network
|
|
eventIDFactory :: (Num n, RefMonad m r, RefMonad m2 r) => m2 (m n) |
|
runListenerTWithFactory :: Monad m => m eid -> ListenerT eid m a -> m a |
|
Observable class
|
|
class MonadListener m => Observable o m where |
| Methods | whenNotVisited | :: o | Object to ask
| -> m () | Monad to execute if the object has not been visited
| -> m () | |
| | visit :: o -> m () | | signalChange :: o -> m () |
| | Instances | |
|
|
Functions used to help construct Observable instances
|
|
whenNotVisitedHelper :: (Eq eid, Monad m) => (o -> ListenerT eid m eid) -> o -> ListenerT eid m () -> ListenerT eid m () |
|
visitHelper :: Monad m => (t -> eid -> m a) -> t -> ListenerT eid m a |
|
signalChangeHelper :: Observable o t => (o -> t ()) -> o -> t () |
|
Debug
|
|
debugPrintEID :: Show eid => ListenerT eid IO () |
|
Debug
|
|
debugListenerPrintEID :: RefMonad IO ref => Listener ref IO () |
|
spliterToComActions :: forall act ref builder a. (InterleaveMonad act, RefMonad act ref, RefMonad builder ref) => Spliter act ref a a -> builder (ComActions act ref a) |
Constructs a ComAction from a Spliter type.
|
|
data Spliter act ref a master |
Contains ComActions, getters, and setters for each element in a product type.
| Constructors | Constructor a | | forall b . Part ComActions act ref b Getter master b Setter master b Spliter act ref (b -> a) master | |
|
|
|
Produced by Haddock version 2.0.0.0 |