BannerWindowclass | banner.t[40] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
Note that merely creating a BannerWindow object doesn't actually display a banner window. Once a BannerWindow is created, the game must call the object's showBanner() method to create the on-screen window for the banner.
BannerWindow instances are intended to be persistent (not transient). The banner manager keeps track of each banner window that's actually being displayed separately via an internal transient object; the game doesn't need to worry about these tracking objects, since the banner manager automatically handles them.
class
BannerWindow : OutputStreamWindow
BannerWindow
OutputStreamWindow
object
contentsMenuBanner
longTopicBanner
statuslineBanner
topMenuBanner
align_
handle_
id_
inited_
parentID_
size_
sizeUnits_
styleFlags_
windowType_
Inherited from OutputStreamWindow
:
outputStream_
clearWindow
construct
createOutputStreamObj
createSystemBanner
cursorTo
flushBanner
getBannerID
initBannerWindow
removeBanner
setScreenColor
setSize
setTextColor
showBanner
showForRestore
sizeToContents
updateForRestore
writeToBanner
Inherited from OutputStreamWindow
:
captureOutput
createOutputStream
setOutputStream
align_ | banner.t[450] |
handle_ | banner.t[441] |
id_ | banner.t[438] |
inited_ | banner.t[429] |
parentID_ | banner.t[448] |
size_ | banner.t[451] |
sizeUnits_ | banner.t[452] |
styleFlags_ | banner.t[453] |
windowType_ | banner.t[449] |
clearWindow ( ) | banner.t[309] |
construct (id) | banner.t[54] |
'id' is a globally unique identifying string for the banner. When we dynamically create a banner object, we have to provide a unique identifying string, so that we can correlate transient on-screen banners with the banners in a saved state when restoring the saved state.
Note that no ID string is needed for BannerWindow objects defined statically at compile-time, because the object itself ('self') is a suitably unique and stable identifier.
createOutputStreamObj ( ) OVERRIDDEN | banner.t[375] |
createSystemBanner (parent, where, other, windowType, align, size, sizeUnits, styleFlags) | banner.t[361] |
Returns true if we are successful in creating the system window, nil if we fail.
cursorTo (row, col) | banner.t[326] |
flushBanner ( ) | banner.t[267] |
getBannerID ( ) | banner.t[334] |
initBannerWindow ( ) | banner.t[422] |
Note that we might already have an on-screen handle when this is called. This indicates that we're restarting an ongoing session, and that this banner already existed in the session before the RESTART operation. If desired, we can attach ourselves to the existing on-screen banner, avoiding the redrawing that would occur if we created a new window.
If this window depends upon another window for its layout order placement (i.e., we'll call showBanner() with another BannerWindow given as the 'other' parameter), then this routine should call the other window's initBannerWindow() method before creating its own window, to ensure that the other window has a system window and thus will be meaningful to establish the layout order.
Overriding implementations should check the 'inited_' property. If this property is true, then it can be assumed that we've already been initialized and don't require further initialization. This routine can be called multiple times because dependent windows might call us directly, before we're called for our regular initialization.
removeBanner ( ) | banner.t[237] |
Note that any child banners of ours will become undisplayable after we're gone. A child banner depends upon its parent to obtain display space, so once the parent is gone, its children no longer have any way to obtain any display space. Our children remain valid objects even after we're closed, but they won't be visible on the display.
setScreenColor (color) | banner.t[319] |
setSize (size, sizeUnits, isAdvisory) | banner.t[280] |
'isAdvisory' is true or nil; if true, it indicates that the size setting is purely advisory, and that a sizeToContents() call will eventually follow to set the actual size. When 'isAdvisory is true, the interpreter is free to ignore the request if sizeToContents()
setTextColor (fg, bg) | banner.t[316] |
showBanner (parent, where, other, windowType, align, size, sizeUnits, styleFlags) | banner.t[104] |
'parent' is the parent banner; this is an existing BannerWindow object. If 'parent' is nil, then the parent is the main game text window. The new window's display space is obtained by carving space out of the parent's area, according to the alignment and size values specified.
'where' and 'other' give the position of the banner among the children of the given parent. 'where' is one of the constants BannerFirst, BannerLast, BannerBefore, or BannerAfter. If 'where' is BannerBefore or BannerAfter, 'other' gives the BannerWindow object to be used as the reference point in the parent's child list; 'other' is ignored in other cases. Note that 'other' must always be another child of the same parent; if it's not, then we act as though 'where' were given as BannerLast.
'windowType' is a BannerTypeXxx constant giving the new window's type.
'align' is a BannerAlignXxx constant giving the alignment of the new window. 'size' is an integer giving the size of the banner, in units specified by 'sizeUnits', which is a BannerSizeXxx constant. If 'size' is nil, it indicates that the caller doesn't care about the size, usually because the caller will be resizing the banner soon anyway; the banner will initially have zero size in this case if we create a new window, or will retain the existing size if there's already a system window.
'styleFlags' is a combination of BannerStyleXxx constants (combined with the bitwise OR operator, '|'), giving the requested display style of the new banner window.
Note that if we already have a system banner window, and the existing banner window has the same characteristics as the new creation parameters, we'll simply re-use the existing window rather than closing and re-creating it; this reduces unnecessary redrawing in cases where the window isn't changing. If the caller explicitly wants to create a new window even if we already have a window, the caller should simply call removeBanner() before calling this routine.
showForRestore (parent, where, other) | banner.t[343] |
sizeToContents ( ) | banner.t[299] |
updateForRestore ( ) | banner.t[390] |
writeToBanner (txt) | banner.t[260] |