previous chapter contents page top page next chapter

ToolButton

January 21, 1993

Defined in Button.Def

Inherits from Button

Class Description

The ToolButton class provides a convenient button format specially designed for tools.

Remember that if the documentation and the software (especially the definition files) disagree, always trust the software.

Programming Information

Instantiate: sometimesSubclass: rarelyCall its methods: rarely

You will probably never subclass class ToolButton or call its methods directly. You will instead put tool buttons and their matching tools into your packages by editing an object definition file.

Methods you might call

The ToolButton class has the following methods you might Call:

Method Description
Action Animate the tool's image hopping into the tool gadget and set the current tool
CanAcceptCoupon Overridden to accept line style coupons for tools that can affect line styles
Draw Draw the tool button
Image Return the image of the associated tool, if any, or the button's image if not
LineStyle Return the line style of the tool, if it has one
SetLineStyle Set the line style of the tool, if it has one
SetPartColor If the tool is a drawing tool, set the ink color as shown in the button to be the tool color
Touch Open the styles edit window if it's an option-tap and the tool implements styles, otherwise call the inherited touch method

Description of fields

The ToolButton class 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 Color Color of object's content
altColor Color Alternative object color
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
Defined by ToolButton
tool ChooseableTool Tool linked to the button

Related Classes

See the chapter on the ChooseableTool class for an example of a tool with its tool button.

Method Descriptions