previous chapter contents page top page next chapter
BalloonSpout

BalloonSpout

Mixes in with Viewable

Class Description

Mixin BalloonSpout adds a balloon spout to any viewable subclass. The inside of the balloon spout is the same color as the background of the viewable, and the spout's border is the same color as the viewable's border. Gadget windows inherit from mixin BalloonSpout.

Programming information

Instantiate: never
Subclass: always
Call its methods: sometimes

Mix BalloonSpout in with classes that have borders, or also mix in class HasBorder. Balloon spouts need borders to look right.

Methods defined by class BalloonSpout

Class BalloonSpout defines the following methods:

Method Description
BalloonBox Construct a box containing the entire balloon spout
VisibleBalloonDot Check if the balloon spout spot is visible on the screen
Draw Overrridden to call inherited and add the triangular balloon spout
AdjustSize Overridden to adjust dot location if necessary
CalcBoundsBox Overridden to add the spout to the viewable's bounds box
BoundsPath Overridden to add the spout to the viewable's bounds path
SetRelativeOrigin Overridden to add a BoundsChanged call, because the spout shape and size changes when its viewable moves

Fields defined by class BalloonSpout

Class BalloonSpout defines the following field:

Field Type Description
Defined by class BalloonSpout
balloonDot Dot Cached version of the dot, updated when bounds are
calculated or object is redrawn

Method Descriptions

BalloonBox

operation BalloonBox(VAR balloon: Box);

Call: rarely
Override: rarely

The system calls BalloonBox from GadgetWindow_SetTarget while redrawing the balloon spout. You might call BalloonBox from a method that moves the spout's target and redraws it.

VisibleBalloonDot

intrinsic VisibleBalloonDot(target: Viewable; VAR dot: Dot):
Boolean;

Call: rarely
Override: rarely

Call VisibleBalloonDot to check if the given dot is visible on the screen. You are likely to call this method if you override BalloonDot, a method defined by class Viewable.