uni-htk-2.2.1.2: Graphical User Interface for Haskell Programs

Safe HaskellNone
LanguageHaskell98

HTk.Toolkit.SimpleForm

Description

This module defines SimpleForms, a simple interface to filling in forms using HTk. (Indeed, it is simple enough that it might be ported to some other GUI sometime.)

Synopsis

Documentation

data Form value Source

Instances

newFormEntry :: (FormLabel label, FormValue value) => label -> value -> Form value Source

nullForm :: FormLabel label => label -> Form () Source

newFormMenu :: FormLabel label => label -> HTkMenu value -> Form (Maybe value) Source

newFormOptionMenu2 :: (Eq a, GUIValue a) => [(a, b)] -> Form b Source

(//) :: Form value1 -> Form value2 -> Form (value1, value2) infixr 8 Source

(\\) :: Form x -> Form y -> Form (x, y) infixr 9 Source

column :: [Form value] -> Form [value] Source

row :: [Form value] -> Form [value] Source

doForm :: String -> Form value -> IO (Maybe value) Source

doFormMust :: String -> Form value -> IO value Source

doFormList :: String -> [(Form x, String)] -> IO (Event (WithError x), IO ()) Source

mapForm :: (x -> WithError y) -> Form x -> Form y Source

mapFormIO :: (x -> IO (WithError y)) -> Form x -> Form y Source

guardForm :: (x -> Bool) -> String -> Form x -> Form x Source

guardFormIO :: (x -> IO Bool) -> String -> Form x -> Form x Source

class FormValue value where Source

Methods

makeFormEntry :: Frame -> value -> IO (EnteredForm value) Source

Instances

FormValue Bool 
FormValue () 
FormTextFieldIO value => FormValue value 
(HasConfigRadioButton value, Bounded value, Enum value) => FormValue (Radio value) 
FormTextFieldIO value => FormValue (Password value) 

mapMakeFormEntry :: FormValue value2 => (value1 -> value2) -> (value2 -> value1) -> Frame -> value1 -> IO (EnteredForm value1) Source

class FormTextField value where Source

Instances

class FormTextFieldIO value where Source

Instances

newtype Password value Source

Constructors

Password value 

Instances

data EmptyLabel Source

Constructors

EmptyLabel 

data WrappedFormLabel Source

Constructors

forall label . FormLabel label => WrappedFormLabel label 

data Radio x Source

Constructors

Radio x 
NoRadio 

Instances

(HasConfigRadioButton value, Bounded value, Enum value) => FormValue (Radio value) 
(Monad m, HasBinary x m) => HasBinary (Radio x) m 
Typeable (* -> *) Radio 

editableTextForm :: [Config Editor] -> Form String Source

An editable text window as a form entry Useful config options: (value String) to set initial contents (height i), (width i) to set the height and width in characters. (background s) to set the background colour to s.

editableTextForm0 :: [Config Editor] -> Form String Source

Like editableTextForm but no scrollbars are displayed.