adam@20: type t = {Cal : Calendar.t,
adam@27: Panel : TogglePanel.togglePanel Calendar.t body'}
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@27: val format : TogglePanel.formatCtl body' = fn [[Dyn] ~ body'] =>
adam@20: TogglePanel.defaultFormat
adam@20: -- #OpenCtl -- #CloseCtl
adam@31: ++ {OpenCtl = fn behaviour => ,
adam@31: 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@27: val gui_t = Gui.mkGui (fn [[Dyn] ~ body'] db =>
kkallio@12:
kkallio@14: {[date.Year]}-{[date.Month]}-{[date.Day]}}/>
kkallio@14: {Gui.toXml db.Panel}
adam@20: )