adam@20: type t = {Cal : Calendar.t,
adam@20: Panel : TogglePanel.togglePanel Calendar.t []}
adam@2:
kkallio@14: type date = Calendar.date
kkallio@14: val date_eq = Calendar.date_eq
kkallio@14: val date_ord = Calendar.date_ord
kkallio@14: val time = Calendar.time
kkallio@14: val date = Calendar.date
adam@2:
adam@20: val format : TogglePanel.formatCtl [] = fn [body ~ []] =>
adam@20: TogglePanel.defaultFormat
adam@20: -- #OpenCtl -- #CloseCtl
adam@20: ++ {OpenCtl = fn behaviour => ,
adam@20: CloseCtl = fn behaviour => }
adam@3:
adam@4: fun create tm =
kkallio@14: cal <- Calendar.create tm;
adam@20: panel <- TogglePanel.create @format cal False;
adam@2:
kkallio@14: return {Cal = cal,
kkallio@14: Panel = panel}
adam@2:
adam@15: fun onChange db f =
adam@15: Calendar.onChange db.Cal f
adam@4:
kkallio@14: fun set db day =
kkallio@14: Calendar.set db.Cal day
kkallio@12:
kkallio@14: fun value db = Calendar.value db.Cal
kkallio@12:
adam@20: val gui_t = Gui.mkGui (fn [body ~ []] db =>
kkallio@12:
kkallio@14: {[date.Year]}-{[date.Month]}-{[date.Day]}}/>
kkallio@14: {Gui.toXml db.Panel}
adam@20: )