previous chapter contents page top page next chapter

HasBorder

January 21, 1994

Defined in Viewable.Def 
Mixes in with Viewable
Inherits from BackgroundWithBorder

Class Description

The HasBorder mixin provides viewables with borders and an interface for manipulating them.

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

Mixing in HasBorder

You will never work directly with objects of class HasBorder. Instead, you will work with existing subclasses of Viewable that inherit from HasBorder, or you will mix in HasBorder with your own viewable subclasses.

Programming Information

Instantiate: never
Subclass: always
Call its methods: rarely

You will rarely call the methods provided by the HasBorder mixin directly. Instead, you will subclass, override methods as appropriate, then put the objects of your subclass in place. The system will make calls to the border management methods as necessary.

Methods defined by class HasBorder

The HasBorder mixin has the following methods you might Call:

Method Description
Border Returns the border of the viewable, if any
SetBorder Set the border of the viewable

Fields defined by class HasBorder

The HasBorder class defines just one field:

Field Type Description
border Border The border object

Method Descriptions

Though it's unlikely that you'll ever need to call or override the methods of the HasBorder mixin, there are so few of them that they are all described below. You'll find no surprises below.

BorderSetBorder

attribute Border: Border
// operation Border(): Object
// operation SetBorder(newBorder: Object)

Call: sometimes
Override: rarely

The system calls Border as a part of the viewable drawing process. If the viewable in question doesn't have a border and the current tool should force borders, Border returns the iBorderGray1 indexical. Otherwise, Border returns the contents of the border field.

The system calls SetBorder when the user drops a border coupon on a object. SetBorder stores the new border in the border field and marks the viewable's bounds as dirty.

CanAcceptCoupon

overrides CanAcceptCoupon

Call: rarely
Override: rarely

HasBorder overrides this popular method to return true if the coupon is a border coupon. Otherwise, it returns the result of its inherited method.

OpeningTinkerWindow

operation OpeningTinkerWindow()

Call: sometimes
Override: rarely

The HasBorder edition of the OpeningTinkerWindow method adds a border coupon to the viewable's tinker window, for your tinkering convenience.

AddToContainer

operation AddToContainer(container: Object)

Call: rarely
Override: rarely

AddToContainer, when called on a viewable with a border, adds the viewable's border to the container by calling AddPlatformObject.

ExtractFromContainer

operation ExtractFromContainer(container: Object; superview: Object): 
Object

Call: rarely
Override: rarely

HasBorder overrides ExtractFromContainer to add a call to SetBorder to its inherited method. The AddToContainer and ExtractFromContainer are both ICF-related methods that you probably won't need to use yourself.