comparison calendar.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
children 8300d5f0dc19
comparison
equal deleted inserted replaced
13:c016beb0ebac 14:0827320b0f04
1 type date = {Year : int, Month : int, Day : int}
2 val date_eq : eq date
3 val date_ord : ord date
4 val time : date -> time
5 val date : time -> date
6 (* A type to represent calendar dates and some operations on them. *)
7
8 type t
9 (* Interactive calendar control widgets. The date can be set and read.
10 * They support adding a change listener which will be called on
11 * the new date. They are displayed as pictures of calendars which
12 * have clickable dates. *)
13
14 val addListener : (date -> transaction unit) -> t -> transaction unit
15 (* Add a change listener to a calendar control. *)
16
17 val set : t -> date -> transaction unit
18 (* Set the date of the calendar. *)
19
20 val value : t -> signal date
21 (* Read the date of the calendar. *)
22
23 val gui_t : Gui.gui t
24 (* Witness that this is a gui widget. *)
25
26 val create : time -> transaction t
27 (* Get a basic interactive calendar control widget. *)
28
29 style calendar
30 style prev
31 style this
32 style next
33 style weekday
34 style curday
35 style otherday
36 style selday
37 (* Styles for the calendar panel. *)