DateFieldBehavior
Package: Libraries.Interface.Behaviors.Controls · Inherits from: Libraries.Language.Object, Libraries.Interface.Behaviors.Behavior
The DateFieldBehavior opens or closes a DateField's calendar: Alt and Down open it, Alt and Up close it, Escape closes it (or, with it closed, closes a tooltip as Escape usually does), and the field's "Choose date" button opens or closes it. Which one is set with Setup, using the constants here. Opened from the keyboard, the calendar gets the focus; opened with the mouse, the focus stays where it is.
Example Code
use Libraries.Interface.Behaviors.Controls.DateFieldBehavior
DateFieldBehavior behavior
behavior:Setup(behavior:OPEN)
Variables
integer TOGGLEinteger ESCAPEinteger OPENinteger CLOSE
Actions
GetMove()
This action returns what the behavior does, one of the constants.
Returns
integer: What the behavior does.
Example
use Libraries.Interface.Behaviors.Controls.DateFieldBehavior
DateFieldBehavior behavior
integer value = behavior:GetMove()
IsFinished()
This action returns true: the work is done at once.
Returns
boolean: true.
Run(Libraries.Interface.Events.BehaviorEvent event)
This action opens or closes the calendar of the date field the event's item is in. The input tables and the field's button call it, so most users won't need to.
Parameters
eventLibraries.Interface.Events.BehaviorEvent: The event, whose item is the field, its button or its calendar.
Setup(integer newMove)
This action sets what the behavior does.
Parameters
newMoveinteger: One of the constants, such as OPEN.
Example
use Libraries.Interface.Behaviors.Controls.DateFieldBehavior
DateFieldBehavior behavior
behavior:Setup(behavior:TOGGLE)