previous chapter contents page top page next chapter


LessonWindow

February 29, 1996

inherits from GadgetWindow;

Class Description

When you create Magic Cap lessons, each lesson step is shown in a lesson window. Magic Cap defines class LessonWindow for this purpose.

Programming information

Instantiate: rarely
Subclass: rarely
Call its methods: never

Magic Cap manages lesson windows automatically when you create lessons. You'll probably never have to create your own lesson windows.

Methods defined by class LessonWindow

Class LessonWindow defines the following methods:

Method Description
AboutToHide Overridden to remove text from fields before hiding.
ExtendBottomToFitContent Overridden to keep lesson buttons near bottom.
KeepFrontmost Overridden to return true if there is no stop button
ZoomFromWhere Overridden to always return false.
MoveOutOfTargetsWay Adjusts window position to avoid covering target.
SetStep Sets up the window for a lesson step.
BalloonDot Overridden to return current step as balloon dot.

Fields defined by class LessonWindow

Class LessonWindow 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
Defined by LessonWindow
lessonTitle Text Text for lesson title
titleViewText TextField Lesson title and step number
stepViewText TextField Lesson step text
nextButton Button Button to advance to next step
stopButton Button Button to end lesson at current step
doneButton Button Button to end lesson after completion
currentStep LessonStep Current step in lesson

Method Descriptions

AboutToHide

overrides AboutToHide

Call: rarely
Override: sometimes

Class LessonWindow overrides AboutToHide to empty the text fields in the window before it goes away.

ExtendBottomToFitContent

overrides ExtendBottomToFitContent

Call: rarely
Override: sometimes

Class LessonWindow overrides ExtendBottomToFitContent to make sure the buttons are positioned near the bottom of the window.

KeepFrontmost

overrides KeepFrontmost

Call: rarely
Override: sometimes

Class LessonWindow overrides KeepFrontmost to make sure that any lesson window without a stop button is made frontmost. This allows the window that appears when Magic Cap first starts up, which is a lesson window, to be frontmost.

ZoomFromWhere

overrides ZoomFromWhere

Call: rarely
Override: sometimes

Class LessonWindow overrides ZoomFromWhere to always return false, indicating that lesson windows do not zoom from a source point.

MoveOutOfTargetsWay

operation MoveOutOfTargetsWay(step: Object): Boolean

Call: rarely
Override: rarely

Magic Cap calls MoveOutOfTargetsWay when a lesson window is about to appear to make sure that the window doesn't cover the lesson target.

SetStep

operation SetStep(newStep: Object; newStepNum: Unsigned; stepCount: 
Unsigned)

Call: rarely
Override: sometimes

Magic Cap calls MoveOutOfTargetsWay to prepare the window for a new lesson step when a new step becomes current.

BalloonDot

overrides BalloonDot

Call: rarely
Override: sometimes

Class LessonWindow overrides BalloonDot to return the current step as the balloon dot.