This module defines SimpleForm
s, a simple interface
to filling in forms using HTk. (Indeed, it is simple enough that it might
be ported to some other GUI sometime.)
- data Form value
- newFormEntry :: (FormLabel label, FormValue value) => label -> value -> Form value
- emptyForm :: Form ()
- nullForm :: FormLabel label => label -> Form ()
- newFormMenu :: FormLabel label => label -> HTkMenu value -> Form (Maybe value)
- newFormOptionMenu :: GUIValue a => [a] -> Form a
- newFormOptionMenu2 :: (Eq a, GUIValue a) => [(a, b)] -> Form b
- (//) :: Form value1 -> Form value2 -> Form (value1, value2)
- (\\) :: Form x -> Form y -> Form (x, y)
- column :: [Form value] -> Form [value]
- row :: [Form value] -> Form [value]
- doForm :: String -> Form value -> IO (Maybe value)
- doFormMust :: String -> Form value -> IO value
- doFormList :: String -> [(Form x, String)] -> IO (Event (WithError x), IO ())
- mapForm :: (x -> WithError y) -> Form x -> Form y
- mapFormIO :: (x -> IO (WithError y)) -> Form x -> Form y
- guardForm :: (x -> Bool) -> String -> Form x -> Form x
- guardFormIO :: (x -> IO Bool) -> String -> Form x -> Form x
- guardNothing :: String -> Form (Maybe x) -> Form x
- class FormValue value where
- makeFormEntry :: Frame -> value -> IO (EnteredForm value)
- mapMakeFormEntry :: FormValue value2 => (value1 -> value2) -> (value2 -> value1) -> Frame -> value1 -> IO (EnteredForm value1)
- class FormTextField value where
- makeFormString :: value -> String
- readFormString :: String -> WithError value
- class FormTextFieldIO value where
- makeFormStringIO :: value -> IO String
- readFormStringIO :: String -> IO (WithError value)
- newtype Password value = Password value
- class FormLabel label where
- data EmptyLabel = EmptyLabel
- data WrappedFormLabel = forall label . FormLabel label => WrappedFormLabel label
- data Radio x
- class HasConfigRadioButton value where
- configRadioButton :: value -> Config (RadioButton Int)
- editableTextForm :: [Config Editor] -> Form String
- editableTextForm0 :: [Config Editor] -> Form String
Documentation
newFormEntry :: (FormLabel label, FormValue value) => label -> value -> Form valueSource
newFormOptionMenu :: GUIValue a => [a] -> Form aSource
newFormOptionMenu2 :: (Eq a, GUIValue a) => [(a, b)] -> Form bSource
doFormMust :: String -> Form value -> IO valueSource
class FormValue value whereSource
makeFormEntry :: Frame -> value -> IO (EnteredForm value)Source
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 whereSource
makeFormString :: value -> StringSource
readFormString :: String -> WithError valueSource
FormTextField String | |
(Num a, Show a, Read a) => FormTextField a |
class FormTextFieldIO value whereSource
makeFormStringIO :: value -> IO StringSource
readFormStringIO :: String -> IO (WithError value)Source
FormTextField value => FormTextFieldIO value | |
FormTextFieldIO value => FormTextFieldIO (Maybe value) |
data WrappedFormLabel Source
forall label . FormLabel label => WrappedFormLabel label |
class HasConfigRadioButton value whereSource
configRadioButton :: value -> Config (RadioButton Int)Source
editableTextForm :: [Config Editor] -> Form StringSource
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 StringSource
Like editableTextForm
but no scrollbars are displayed.