Module GUI2HTML

Library for creating web applications from gui descriptions Same interface and documentation as the GUI library from PAKCS

Author: Christof Kluss

Version: July 2013

Summary of exported operations:

Button :: (UIEnv -> IO a) -> [ConfItem] -> Widget   
TextEditScroll :: [ConfItem] -> Widget   
EntryScroll :: [ConfItem] -> Widget   
CanvasScroll :: [ConfItem] -> Widget   
ConfigButton :: (UIEnv -> IO [ReconfigureItem]) -> [ConfItem] -> Widget   
Cmd :: (UIEnv -> IO a) -> ConfItem   
Command :: (UIEnv -> IO [ReconfigureItem]) -> ConfItem   
ListBoxScroll :: [ConfItem] -> Widget   
setConfig :: Ref CgiRef -> ConfItem -> UIEnv -> IO ()   
seeText :: Ref CgiRef -> (Int,Int) -> UIEnv -> IO ()   
getSaveFile :: IO [a]   
focusInput :: a -> UIEnv -> IO ()   
col :: [Widget] -> Widget   
row :: [Widget] -> Widget   
matrix :: [[Widget]] -> Widget   
getValue :: Ref CgiRef -> UIEnv -> IO String   
setValue :: Ref CgiRef -> String -> UIEnv -> IO ()   
updateValue :: (String -> String) -> Ref CgiRef -> UIEnv -> IO ()   
appendValue :: Ref CgiRef -> String -> UIEnv -> IO ()   
exitGUI :: UIEnv -> IO ()   
runGUI :: String -> Widget -> IO HtmlForm   
runInitGUI :: String -> Widget -> a -> IO HtmlForm   
addCanvas :: Ref CgiRef -> [CanvasItem] -> UIEnv -> IO ()   

Exported datatypes:


Widget

Constructors:


ConfItem

Constructors:

  • Active :: Bool -> ConfItem
  • Anchor :: String -> ConfItem
  • Background :: String -> ConfItem
  • Foreground :: String -> ConfItem
  • Handler :: Event -> Command -> ConfItem
  • Height :: Int -> ConfItem
  • CheckInit :: String -> ConfItem
  • CanvasItems :: [CanvasItem] -> ConfItem
  • List :: [String] -> ConfItem
  • Menu :: [MenuItem] -> ConfItem
  • WRef :: UIRef -> ConfItem
  • Text :: String -> ConfItem
  • Width :: Int -> ConfItem
  • Fill :: ConfItem
  • FillX :: ConfItem
  • FillY :: ConfItem
  • TclOption :: String -> ConfItem

GuiPort

Type synonym: GuiPort = UIEnv


WidgetRef

Type synonym: WidgetRef = Ref CgiRef


Command

Type synonym: Command = GuiPort -> IO [ReconfigureItem]


ReconfigureItem

Constructors:


Event

Constructors:

  • DefaultEvent :: Event
  • MouseButton1 :: Event
  • MouseButton2 :: Event
  • MouseButton3 :: Event
  • KeyPress :: Event
  • Return :: Event

MenuItem

Constructors:


ConfCollection

Constructors:

  • CenterAlign :: ConfCollection
  • LeftAlign :: ConfCollection
  • RightAlign :: ConfCollection
  • TopAlign :: ConfCollection
  • BottomAlign :: ConfCollection

CanvasItem

Constructors:

  • CLine :: [(Int,Int)] -> String -> CanvasItem
  • CPolygon :: [(Int,Int)] -> String -> CanvasItem
  • CRectangle :: (Int,Int) -> (Int,Int) -> String -> CanvasItem
  • COval :: (Int,Int) -> (Int,Int) -> String -> CanvasItem
  • CText :: (Int,Int) -> String -> String -> CanvasItem

Style

Constructors:

  • Bold :: Style
  • Italic :: Style
  • Underline :: Style
  • Fg :: Color -> Style
  • Bg :: Color -> Style

Color

The data type of possible colors.

Constructors:

  • Black :: Color
  • Blue :: Color
  • Brown :: Color
  • Cyan :: Color
  • Gold :: Color
  • Gray :: Color
  • Green :: Color
  • Magenta :: Color
  • Navy :: Color
  • Orange :: Color
  • Pink :: Color
  • Purple :: Color
  • Red :: Color
  • Tomato :: Color
  • Turquoise :: Color
  • Violet :: Color
  • White :: Color
  • Yellow :: Color

Exported operations:

Button :: (UIEnv -> IO a) -> [ConfItem] -> Widget   

TextEditScroll :: [ConfItem] -> Widget   

Further infos:
  • solution complete, i.e., able to compute all solutions

EntryScroll :: [ConfItem] -> Widget   

Further infos:
  • solution complete, i.e., able to compute all solutions

CanvasScroll :: [ConfItem] -> Widget   

Further infos:
  • solution complete, i.e., able to compute all solutions

ConfigButton :: (UIEnv -> IO [ReconfigureItem]) -> [ConfItem] -> Widget   

Cmd :: (UIEnv -> IO a) -> ConfItem   

Command :: (UIEnv -> IO [ReconfigureItem]) -> ConfItem   

Further infos:
  • solution complete, i.e., able to compute all solutions

ListBoxScroll :: [ConfItem] -> Widget   

Further infos:
  • solution complete, i.e., able to compute all solutions

setConfig :: Ref CgiRef -> ConfItem -> UIEnv -> IO ()   

seeText :: Ref CgiRef -> (Int,Int) -> UIEnv -> IO ()   

getSaveFile :: IO [a]   

focusInput :: a -> UIEnv -> IO ()   

col :: [Widget] -> Widget   

Further infos:
  • solution complete, i.e., able to compute all solutions

row :: [Widget] -> Widget   

Further infos:
  • solution complete, i.e., able to compute all solutions

matrix :: [[Widget]] -> Widget   

Further infos:
  • solution complete, i.e., able to compute all solutions

getValue :: Ref CgiRef -> UIEnv -> IO String   

setValue :: Ref CgiRef -> String -> UIEnv -> IO ()   

updateValue :: (String -> String) -> Ref CgiRef -> UIEnv -> IO ()   

appendValue :: Ref CgiRef -> String -> UIEnv -> IO ()   

exitGUI :: UIEnv -> IO ()   

runGUI :: String -> Widget -> IO HtmlForm   

runInitGUI :: String -> Widget -> a -> IO HtmlForm   

addCanvas :: Ref CgiRef -> [CanvasItem] -> UIEnv -> IO ()