Mercurial > gui
annotate 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 |
rev | line source |
---|---|
adam@2 | 1 type t |
kkallio@14 | 2 (* The type of dateboxes, which are input elements |
kkallio@14 | 3 * allowing the user to select a date from a popup |
kkallio@14 | 4 * calendar. *) |
adam@2 | 5 |
adam@4 | 6 type date = {Year : int, Month : int, Day : int} |
kkallio@14 | 7 val date_eq : eq date |
adam@5 | 8 val date_ord : ord date |
adam@5 | 9 val time : date -> time |
kkallio@12 | 10 val date : time -> date |
kkallio@14 | 11 (* Type of dates and some useful utility functions. *) |
adam@4 | 12 |
adam@4 | 13 val create : time -> transaction t |
kkallio@14 | 14 (* Get a datebox initially set to the given time. *) |
kkallio@14 | 15 |
kkallio@14 | 16 val addListener : (date -> transaction unit) -> t -> transaction unit |
kkallio@14 | 17 (* Add an action to be run when the date changes. *) |
kkallio@14 | 18 |
kkallio@14 | 19 val set : t -> date -> transaction unit |
kkallio@14 | 20 (* Call this to change the selected date. *) |
kkallio@14 | 21 |
kkallio@14 | 22 val value : t -> signal date |
kkallio@14 | 23 (* Extract the current date value. *) |
kkallio@14 | 24 |
adam@2 | 25 val render : t -> xbody |
kkallio@14 | 26 (* Draws the datebox as a piece of xml. *) |