Mixes in with Viewable
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.
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.
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 |
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 |
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.
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.