Calendar.enabled read/write property
Get or set the calendar ability to respond to mouse, and any other events. When set to false, disable the Calendar (the user will not be able to interact with it), and calendar's events won't be fired anymore.
Example
local ui = require "ui"
-- create a window
local win = ui.Window("Calendar.enabled sample", 320, 220)
local button = ui.Button(win, "Disable calendar", 110, 10)
local calendar = ui.Calendar(win, 45, 40)
-- set a onClick() event : toggle calendar.enabled property
function button:onClick()
calendar.enabled = not calendar.enabled
self.text = calendar.enabled and "Disable calendar" or "Enable calendar"
end
-- set a onSelect() event : Shows a message with the choosen date
function calendar:onSelect(d)
ui.info("You have choosen : "..d.date)
end
win:show()
while win.visible do
ui.update()
end