previous chapter contents page top page next chapter

DoubleActionButton

inherits from SimpleActionButton;

Class Description

Double action buttons are more complex versions of simple action buttons. Use double action buttons whenever you want a button that does something different when the option key is pressed.

Programming information

Instantiate: sometimes
Subclass: rarely
Call its methods: rarely

You'll rarely need to subclass class DoubleActionButton. Instead, you'll just put double action button objects into place in your object definition files. Just fill in the optionTarget and optionOperation fields with the button's second target and second operation number.

Methods defined by class DoubleActionButton

Class DoubleActionButton defines the following methods:

Method Description
Action Overridden to use the button's option target and option operation when
the option key is down; otherwise calls inherited
Touch Overridden to play the button's sound and call Action if the option key is
down and the operation option bit is set

Fields defined by class DoubleActionButton

Class DoubleActionButton defines the following fields:

Field Type Description
Inherited from SingleLinkable
next Object Next item in view list
Inherited from Linkable
previous Object Previous item in view list
Inherited from Viewable
superview Viewable Container for this object
subview Viewable Object contained by this object
relativeOrigin Dot Origin relative to superview
contentSize Dot Size of content rectangle
viewFlags Unsigned Property settings
labelStyle TextStyle Text style of object's label
color Unsigned Color of object's content
altColor Unsigned Not used by button
shadow Shadow Shadow drawn with object
sound Sound Sound associated with object
Inherited from Stamp
image Image Image used to draw stamp
Inherited from HasBorder
border Border The button's border
Inherited from SimpleActionButton
target Object The button's target
operation Unsigned Settings for the button, including the operation
targeted
Defined by DoubleActionButton
optionTarget Object The button's target when the option key is pressed
optionOperation Unsigned Settings for the button when the option key is
pressed

The optionOperation field can have a special bit set. The associated mask is defined as:

#define kOperationOptionMask    0x40000000

If this bit is set, Touch will play the button's sound and call Action.

Attributes defined by class DoubleActionButton

Class DoubleActionButton defines the following attributes:

Attribute Type Description
OptionTarget Object The button's target when the option key is down;
interface to the optionTarget field