comparison datebox.urs @ 19:3a303df9ae92

Partial generalize togglePanel solution (breaks build)
author Ron de Bruijn <rmbruijn@gmail.com>
date Fri, 23 Sep 2011 13:30:01 +0200
parents 8300d5f0dc19
children 554e342665fe
comparison
equal deleted inserted replaced
18:16447dc6a68c 19:3a303df9ae92
1 type t 1 con t::{Unit}->Type
2
2 (* The type of dateboxes, which are input elements 3 (* The type of dateboxes, which are input elements
3 * allowing the user to select a date from a popup 4 * allowing the user to select a date from a popup
4 * calendar. *) 5 * calendar. *)
5 6
6 type date = {Year : int, Month : int, Day : int} 7 type date = {Year : int, Month : int, Day : int}
8 val date_ord : ord date 9 val date_ord : ord date
9 val time : date -> time 10 val time : date -> time
10 val date : time -> date 11 val date : time -> date
11 (* Type of dates and some useful utility functions. *) 12 (* Type of dates and some useful utility functions. *)
12 13
13 val create : time -> transaction t 14 val create : other_ctx:::{Unit} -> [other_ctx ~ body] => time -> transaction (t other_ctx)
14 (* Get a datebox initially set to the given time. *) 15 (* Get a datebox initially set to the given time. *)
15 16
16 val onChange : t -> (date -> transaction {}) -> transaction {} 17 val onChange : other_ctx:::{Unit} -> [other_ctx ~ body] => t other_ctx -> (date -> transaction {}) -> transaction {}
17 (* Add an action to be run when the date changes. *) 18 (* Add an action to be run when the date changes. *)
18 19
19 val set : t -> date -> transaction {} 20 val set : other_ctx:::{Unit} -> [other_ctx ~ body] => t other_ctx -> date -> transaction {}
20 (* Call this to change the selected date. *) 21 (* Call this to change the selected date. *)
21 22
22 val value : t -> signal date 23 val value : other_ctx:::{Unit} -> [other_ctx ~ body] => t other_ctx -> signal date
23 (* Extract the current date value. *) 24 (* Extract the current date value. *)
24 25
25 val render : t -> xbody 26 val render : other_ctx:::{Unit} -> [other_ctx ~ body] => t other_ctx -> xml ([Body] ++ other_ctx) [] []
26 (* Draws the datebox as a piece of xml. *) 27 (* Draws the datebox as a piece of xml. *)