CalendarKeyBehavior
Package: Libraries.Interface.Behaviors.Controls · Inherits from: Libraries.Language.Object, Libraries.Interface.Behaviors.Behavior
The CalendarKeyBehavior carries out one of a Calendar's keys: moving the current day by a day, a week, a month or a year, to the start or end of its week, choosing it, or closing a date field's calendar. Which one is set with Setup, using the constants here. The moves work only while the calendar itself has the focus, not one of its month buttons.
Example Code
use Libraries.Interface.Behaviors.Controls.CalendarKeyBehavior
CalendarKeyBehavior behavior
behavior:Setup(behavior:NEXT_DAY)
Variables
integer WEEK_STARTinteger NEXT_YEARinteger CLOSEinteger PREVIOUS_WEEKinteger PREVIOUS_DAYinteger PREVIOUS_MONTHinteger NEXT_WEEKinteger WEEK_ENDinteger PREVIOUS_YEARinteger NEXT_DAYinteger CHOOSEinteger NEXT_MONTH
Actions
GetMove()
This action returns what the key does, one of the constants.
Returns
integer: What the key does.
Example
use Libraries.Interface.Behaviors.Controls.CalendarKeyBehavior
CalendarKeyBehavior behavior
integer value = behavior:GetMove()
IsFinished()
This action returns true: the key's work is done at once.
Returns
boolean: true.
Run(Libraries.Interface.Events.BehaviorEvent event)
This action carries out the key on the calendar. The input tables call it, so most users won't need to.
Parameters
eventLibraries.Interface.Events.BehaviorEvent: The key event, whose item is the calendar.
Setup(integer newMove)
This action sets what the key does.
Parameters
newMoveinteger: One of the constants, such as NEXT_DAY.
Example
use Libraries.Interface.Behaviors.Controls.CalendarKeyBehavior
CalendarKeyBehavior behavior
behavior:Setup(behavior:CHOOSE)