comparison datebox.urs @ 14:0827320b0f04

Write calendarCtl in terms of a source with a listener.
author Karn Kallio <kkallio@eka>
date Fri, 05 Aug 2011 18:55:24 -0430
parents bbdedfde154e
children 8300d5f0dc19
comparison
equal deleted inserted replaced
13:c016beb0ebac 14:0827320b0f04
1 class givesDates
2
3 type t 1 type t
4 type calendarCtl 2 (* The type of dateboxes, which are input elements
5 3 * allowing the user to select a date from a popup
6 val givesDates_t : givesDates t 4 * calendar. *)
7 val givesDates_calendarCtl : givesDates calendarCtl
8 5
9 type date = {Year : int, Month : int, Day : int} 6 type date = {Year : int, Month : int, Day : int}
7 val date_eq : eq date
10 val date_ord : ord date 8 val date_ord : ord date
11 val time : date -> time 9 val time : date -> time
12 val date : time -> date 10 val date : time -> date
11 (* Type of dates and some useful utility functions. *)
13 12
14 val create : time -> transaction t 13 val create : time -> transaction t
14 (* Get a datebox initially set to the given time. *)
15
16 val addListener : (date -> transaction unit) -> t -> transaction unit
17 (* Add an action to be run when the date changes. *)
18
19 val set : t -> date -> transaction unit
20 (* Call this to change the selected date. *)
21
22 val value : t -> signal date
23 (* Extract the current date value. *)
24
15 val render : t -> xbody 25 val render : t -> xbody
16 26 (* Draws the datebox as a piece of xml. *)
17 val createCalendarCtl : time -> transaction calendarCtl
18 val renderCalendarCtl : (date -> transaction unit) -> calendarCtl -> xbody
19 val setCalendarCtl : (date -> transaction unit) -> calendarCtl -> date -> transaction unit
20
21 val value : t ::: Type -> givesDates t -> t -> signal date
22
23 style calendar
24 style prev
25 style this
26 style next
27 style weekday
28 style curday
29 style otherday
30 style selday