@@ -1,29 +1,43 @@
2module Graphics.Input where
2module Graphics.Input where
4−buttons : a -> { button : a -> String -> Element
4+buttons : a -> { button : a -> String -> Element, events : Signal a }
8button : String -> (Element, Signal ())
6button : String -> (Element, Signal ())
9button txt =
7button txt =
10 let pool = buttons ()
8 let pool = buttons ()
11 in (pool.button () txt, pool.events)
9 in (pool.button () txt, pool.events)
13−customButtons : a -> { button : a -> Element -> Element -> Element -> Element
11+customButtons : a -> { button : a -> Element -> Element -> Element -> Element,
14− , events : Signal a
12+ events : Signal a }
17customButton : Element -> Element -> Element -> (Element, Signal ())
14customButton : Element -> Element -> Element -> (Element, Signal ())
18customButton up hover down =
15customButton up hover down =
19 let pool = customButtons ()
16 let pool = customButtons ()
20 in (pool.button () up hover down, pool.events)
17 in (pool.button () up hover down, pool.events)
22−checkBoxes : a -> { box : (Bool -> a) -> Bool -> Element
19+checkBoxes : a -> { box : (Bool -> a) -> Bool -> Element, events : Signal a }
26checkBox : Bool -> (Signal Element, Signal Bool)
21checkBox : Bool -> (Signal Element, Signal Bool)
27checkBox b =
22checkBox b =
28 let cbs = checkBoxes b
23 let cbs = checkBoxes b
29− in (lift (cbs.box id) cbs.events, cbs.events)
24+ in (lift (cbs.box id) cbs.events, cbs.events)
32+textFields : a -> { field : (TextState -> a) -> String -> TextState -> Element,
35+textField : String -> TextState -> (Signal Element, Signal TextState)
36+textField placeHolder textState =
37+ let tfs = textFields textState
38+ in (lift (tfs.field id placeHolder) tfs.events, tfs.events)
40+password : String -> TextState -> (Signal Element, Signal TextState)
41+email : String -> TextState -> (Signal Element, Signal TextState)