previous chapter contents page top page next chapter


NameBar

February 29, 1996

inherits from Bar

Class Description

Class NameBar is a highly specialized subclass of Bar. There is exactly one instance of this class in Magic Cap, the bar displayed at the top of the screen.

Programming information

Instantiate: never
Subclass: rarely
Call its methods: never

You probably won't ever create an object or a subclass of class NameBar. The information in this chapter is provided for debugging and curiosity only.

Methods defined by class NameBar

Class NameBar defines the following methods:

Method Description
ShowHelpIcon Check whether circled-? is displayed.
SetShowHelpIcon Set whether circled-? is displayed.
ShowStepBack Check whether step-back name is shown.
SetShowStepBack Set whether step-back name is shown.
ShowDate Check whether date is shown.
SetShowDate Set whether date is shown.
ShowTime Check whether time is shown.
SetShowTime Set whether time is shown.
ShowBattery Check whether battery level is shown.
SetShowBattery Set whether battery level is shown.
ShowWireless Check whether wireless status is shown.
SetShowWireless Set whether wireless status is shown.
SetStepBackHilite Set highlighting on step-back name.
BalloonDot Overridden to compute location for balloon spout.
CanAccept Overridden to prevent forbidden objects from being added.
Draw Overridden to draw name bar.
Idle Overridden to update date, time, battery info at idle time.
Swallow Overridden to allow text coupons to rename scenes.
Touch Overridden to handle user touches.
ContentsInTransit Overridden to prevent contents from being removed.
ContentPath Overridden to empty content path for password scene.
ACAdapterInserted Overridden to update display when adaptor is attached.
ACAdapterRemoved Overridden to update display when adaptor is detached.
BatteryLevelChanged Overridden to update display when battery level changes.

Fields defined by class NameBar

Class NameBar 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
Defined by NameBar
titleBarFlags Unsigned
pageArrow Image
captionTextStyle TextStyle
lastDrawDate Signed
lastDrawTime Unsigned
lastLevel Unsigned Last battery level seen
lastCharging Signed Last state of charging seen
sceneNameArea Dot
packageArea Dot
dateArea Dot
timeArea Dot
batteryArea Dot
leftArrowArea Dot
captionArea Dot
rightArrowArea Dot
statusArea Dot
stepBackArea Dot
wirelessArea Dot
lastACAdaptor Boolean

Method Descriptions

ShowHelpIcon

attribute ShowHelpIcon: Boolean
// operation ShowHelpIcon():Boolean
// operation SetShowHelpIcon(newValue)

Call: rarely
Override: rarely

The attribute ShowHelpIcon determines whether the name bar is currently displaying the circled question mark that appears at its left edge when help information is available.

ShowPlaceName

attribute ShowPlaceName: Boolean
// operation ShowPlaceName():Boolean
// operation SetShowPlaceName(newValue)

Call: rarely
Override: rarely

The attribute ShowPlaceName determines whether the name bar is displaying the name of the current place at its left edge.

ShowStepBack

attribute ShowStepBack: Boolean
// operation ShowStepBack():Boolean
// operation SetShowStepBack(newValue)

Call: rarely
Override: rarely

The attribute ShowStepBack determines whether the name bar is displaying the name of the step-back place at its right edge.

ShowDate

attribute ShowDate: Boolean
// operation ShowDate():Boolean

// operation SetShowDate(newValue)

Call: rarely
Override: rarely

The attribute ShowDate determines whether the name bar is displaying the current date at its center. The user can control this setting with a switch in the general control panel.

ShowTime

attribute ShowTime: Boolean
// operation ShowTime():Boolean
// operation SetShowTime(newValue)

Call: rarely
Override: rarely

The attribute ShowTime determines whether the name bar is displaying the current time. The user can control this setting with a switch in the general control panel.

ShowBattery

attribute ShowBattery: Boolean
// operation ShowBattery():Boolean
// operation SetShowBattery(newValue)

Call: rarely
Override: rarely

The attribute ShowBattery determines whether the name bar is displaying the current battery level. The user can control this setting with a switch in the general control panel.

ShowWireless

attribute ShowWireless: Boolean
// operation ShowWireless():Boolean
// operation SetShowWireless(newValue)

Call: rarely
Override: rarely

The attribute ShowWireless determines whether the name bar is displaying the wireless activity monitor. This setting is only meaningful on Magic Cap implementations that include wireless communication hardware, such as the Motorola Envoy.

SetStepBackHilite

operation SetStepBackHilite(hiliteFlag: Boolean)

Call: rarely
Override: rarely

Magic Cap Calls SetStepBackHilite to control the highlighting of the step-back name on the right edge of the name bar.

BalloonDot

overrides BalloonDot

Call: rarely
Override: sometimes

Class NameBar overrides BalloonDot to return the correct location for a balloon spout attached to a window, such as a tinker window, that is associated with the name bar.

CanAccept

overrides CanAccept

Call: rarely
Override: sometimes

Class NameBar overrides CanAccept to reject any objects that are not permitted to leave the scene (that is, objects that return false when AllowedToLeaveScene is called).

Draw

overrides Draw

Call: rarely
Override: sometimes

Class NameBar overrides Draw to draw itself on the screen.

Idle

overrides Idle

Call: rarely
Override: sometimes

Class NameBar overrides Idle to update various parts of its display, such as the date, time, and battery level.

Swallow

overrides Swallow

Call: rarely
Override: sometimes

Class NameBar overrides Swallow to allow users to rename the current scene with a text coupon. In order to accomplish this, Magic Cap must be in construction mode and the user must hold down the option key while dropping the text coupon on the scene name in the name bar and simultaneously whistling the end portion of Beethoven's "Ode to Joy".

Touch

overrides Touch

Call: rarely
Override: sometimes

Class NameBar overrides Touch to handle user touches on all parts of the name bar.

ContentsInTransit

overrides ContentsInTransit

Call: rarely
Override: sometimes

Class NameBar overrides ContentsInTransit to always return true to indicate that its contents should not be moved.

ContentPath

overrides ContentPath

Call: rarely
Override: sometimes

Class NameBar overrides ContentPath to set the content path to empty if the current scene is the password scene.

ACAdapterInserted

overrides ACAdapterInserted

Call: rarely
Override: sometimes

Class NameBar overrides ACAdapterInserted to redraw the appropriate part of the name bar when the user connects an AC adapter.

ACAdapterRemoved

overrides ACAdapterRemoved

Call: rarely
Override: sometimes

Class NameBar overrides ACAdapterRemoved to redraw the appropriate part of the name bar when the user disconnects an AC adapter.

BatteryLevelChanged

overrides BatteryLevelChanged

Call: rarely
Override: sometimes