ColorPickerCloseBehavior

Package: Libraries.Interface.Behaviors.Controls · Inherits from: Libraries.Language.Object, Libraries.Interface.Behaviors.Behavior

The ColorPickerCloseBehavior closes the ColorPicker that holds the item it runs on: with OK, which keeps the color, or with CANCEL, which puts the old color back. The picker's OK and Cancel buttons use it, and so do Enter and Escape anywhere in the picker. Which one it is is set with Setup.

Example Code

use Libraries.Interface.Controls.Button
use Libraries.Interface.Behaviors.Controls.ColorPickerCloseBehavior

Button cancel
cancel:SetName("Cancel")
ColorPickerCloseBehavior behavior
behavior:Setup(behavior:CANCEL)
cancel:SetBehavior(behavior)

Variables

  • integer OK
  • integer CANCEL

Actions

Run(Libraries.Interface.Events.BehaviorEvent event)

This action sets whether the behavior keeps the color (OK) or puts the old one back (CANCEL).

Parameters

Example

use Libraries.Interface.Behaviors.Controls.ColorPickerCloseBehavior
ColorPickerCloseBehavior behavior
behavior:Setup(behavior:OK)

Setup(integer newChoice)

This action sets whether the behavior keeps the color (OK) or puts the old one back (CANCEL).

Parameters

  • newChoice integer: OK or CANCEL.

Example

use Libraries.Interface.Behaviors.Controls.ColorPickerCloseBehavior
ColorPickerCloseBehavior behavior
behavior:Setup(behavior:OK)

Inherited Actions

7 actions from Libraries.Interface.Behaviors.Behavior
3 actions from Libraries.Language.Object