previous chapter alt="previous chapter"> contents
page top page next chapter chapter">


ContainerWindow

February 29, 1996

inherits from GadgetWindow;  

Class Description

Magic Cap defines class ContainerWindow for windows with contents that can be changed directly by the user adding and removing viewables. For example, the tote bag's window is a container window.

When the user drops a viewable into a container window, the newly added viewable is placed in the window along a grid supplied by the window.

Programming information

Instantiate: rarely
Subclass: sometimes
Call its methods: rarely

You might create an object of this class or a subclass if you wanted to have a window that allows the user to contain and grid other viewables.

Methods defined by class ContainerWindow

Class ContainerWindow defines the following methods:

Method Description
UnlinkScrollArrows Remove scroll arrows from the view hierarchy.
RelinkScrollArrows Reinsert scroll arrows into the view hierarchy.
Empty Tests whether there are any subviews in window.
ArrowState Overridden to return cached value indicating scrolling state.
CanAccept Overridden to allow desk accessory window to accept objects.
MaximumScrollOffset Overridden to calculate lowest grid line position.
MinimumScrollOffset Overridden to calculate highest grid line position.
ChangedContents Overridden to update scroll arrow state.
MovedContents Overridden to grid item and update scroll arrow state.
PageUp Overridden to scroll by whole grid lines.
PageDown Overridden to scroll by whole grid lines.
SetScrollOffset Overridden to reposition scroll arrows.
ContentsInTransit Overridden to return true for tote bag window.
RevealViewable Overridden to scroll to show viewable.

Fields defined by class ContainerWindow

Class ContainerWindow 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 Flags Property settings
labelStyle TextStyle Text style of object's label
color Color Color of object's content
shadow Shadow Shadow drawn with object
sound Sound Sound associated with object
Inherited from HasBorder
border Border Framed border drawn around object
Inherited from Window
windowFlags Flags Stores various boolean attributes of the window
Inherited from TitledWindow
titleColor Unsigned RGB color for title box
titleHeight Micron Height of title box
dependents ObjectList List of dependent windows
Inherited from BalloonSpout
balloonDot Dot Cached dot position, used by Magic Cap
Inherited from GadgetWindow
target Object Target for this window
Inherited from ScrollableByMicron
scrollOffset Current scrolling offset
Defined by ContainerWindow
gridSize Dot horizontal and vertical grid spacing
gridOffset Dot offset of first grid position
topArrow Viewable scroll up arrow
bottomArrow Viewable scroll down arrow

Method Descriptions

UnlinkScrollArrows

operation UnlinkScrollArrows()

Call: rarely
Override: rarely

Magic Cap calls UnlinkScrollArrows to remove the scroll arrows from the view hierarchy when new viewables are added or removed from the window.

RelinkScrollArrows

operation RelinkScrollArrows()

Call: rarely
Override: rarely

Magic Cap calls RelinkScrollArrows to insert the scroll arrows into the view hierarchy after new viewables have been added or removed from the window.

Empty

attribute Empty: Boolean, readOnly
// operation Empty():Boolean

Call: rarely
Override: rarely

The attribute Empty indicates whether the container window has any subviews, not including scroll arrows.

ArrowState

overrides ArrowState

Call: rarely
Override: sometimes

Class MagicWindow overrides ArrowState to use the value of arrow state cached in the windowFlags field.

CanAccept

overrides CanAccept

Call: rarely
Override: sometimes

In general, container windows do not accept non-deletable objects as subviews. Class MagicWindow overrides CanAccept to specifically allow the desk accessory window, which is a container window, to accept non-deletable objects as subviews.

MaximumScrollOffset

overrides MaximumScrollOffset

Call: rarely
Override: sometimes

Class MagicWindow overrides MaximumScrollOffset to compute the position of the lowest grid line that contains subviews.

MinimumScrollOffset

overrides MinimumScrollOffset

Call: rarely
Override: sometimes

Class MagicWindow overrides MinimumScrollOffset to compute the position of the highest grid line that contains subviews.

ChangedContents

overrides ChangedContents

Call: rarely
Override: sometimes

Class MagicWindow overrides ChangedContents to recompute the arrow state when the user adds or removes viewables from the window.

MovedContents

overrides MovedContents

Call: rarely
Override: sometimes

Class MagicWindow overrides MovedContents to recompute the arrow state and place items on the grid when the user moves viewables in the window.

PageUp

overrides PageUp

Call: rarely
Override: sometimes

Class MagicWindow overrides PageUp to scroll the window contents by a whole number of grid lines when the user touches the up arrow.

PageDown

overrides PageDown

Call: rarely
Override: sometimes

Class MagicWindow overrides PageDown to scroll the window contents by a whole number of grid lines when the user touches the down arrow.

SetScrollOffset

overrides SetScrollOffset

Call: rarely
Override: sometimes

Class MagicWindow overrides SetScrollOffset to scroll the window contents by a whole number of grid lines when the user touches the up arrow.

ContentsInTransit

overrides ContentsInTransit

Call: rarely
Override: sometimes

Class MagicWindow overrides ContentsInTransit to return true if the responder is the tote bag window.

RevealViewable

overrides RevealViewable

Call: rarely
Override: sometimes

Class MagicWindow overrides RevealViewable to scroll the window to reveal the given viewable.