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