previous chapter contents page top page next chapter

TextCoupon

Inherits from Coupon
encodes empty field list;

Class Description

Class TextCoupon is a subclass of Coupon that allows the user to drop text into an object. Objects of this class work by calling SetTextData on the coupon's target.

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

Programming information

Instantiate: rarely
Subclass: rarely
Call its methods: never

You might instantiate objects of this class if you wanted to have pre-made runs of text in your package for users to drag around, and you might create subclasses if you wanted to create coupons containing specialized subclasses of text.

Methods defined by class TextCoupon

Class TextCoupon defines the following methods:

Method Description
ApplyCoupon Overridden to change target's text by calling SetTextData.
CalcContentBox Overridden to consider size of text when computing content box.
CanStretch Overridden to return false.
Draw Overridden to customize appearance of coupons.

Fields defined by class TextCoupon

Class TextCoupon defines no fields.

Method Descriptions

ApplyCoupon

overrides ApplyCoupon

Call: rarely
Override: sometimes

Magic Cap calls ApplyCoupon when the user drops a coupon into a viewable object. ApplyCoupon should perform the action represented by the coupon. TextCoupon_ApplyCoupon sets the target's text by calling SetTextData

CalcContentBox

overrides CalcContentBox

Call: rarely
Override: sometimes

Class TextCoupon overrides CalcContentBox to consider the coupon's text when computing the size of its content box.

CanStretch

overrides CanStretch

Call: rarely
Override: sometimes

Class TextCoupon overrides CanStretch to return false, preventing the user from stretching text coupons.

Draw

overrides Draw

Call: rarely
Override: sometimes

Magic Cap calls Draw to draw the coupon on the screen. TextCoupon_Draw draws the coupon with the first part of its text displayed.

See Viewable_Draw for more information.