uni-htk-2.2.1.3: 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

Functor Form Source # 

Methods

fmap :: (a -> b) -> Form a -> Form b #

(<$) :: a -> Form b -> Form a #

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 #

Minimal complete definition

makeFormEntry

Methods

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

Instances

FormValue Bool Source # 

Methods

makeFormEntry :: Frame -> Bool -> IO (EnteredForm Bool) Source #

FormValue () Source # 

Methods

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

FormTextFieldIO value => FormValue value Source # 

Methods

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

(HasConfigRadioButton value, Bounded value, Enum value) => FormValue (Radio value) Source # 

Methods

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

FormTextFieldIO value => FormValue (Password value) Source # 

Methods

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

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

newtype Password value Source #

Constructors

Password value 

Instances

FormTextFieldIO value => FormValue (Password value) Source # 

Methods

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

class FormLabel label where Source #

Minimal complete definition

formLabel

Methods

formLabel :: Frame -> label -> IO (IO ()) Source #

data EmptyLabel Source #

Constructors

EmptyLabel 

Instances

data Radio x Source #

Constructors

Radio x 
NoRadio 

Instances

(HasConfigRadioButton value, Bounded value, Enum value) => FormValue (Radio value) Source # 

Methods

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

(Monad m, HasBinary x m) => HasBinary (Radio x) m Source # 

Methods

writeBin :: WriteBinary m -> Radio x -> m () #

readBin :: ReadBinary m -> m (Radio x) #

class HasConfigRadioButton value where Source #

Minimal complete definition

configRadioButton

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.