Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TStatusLine Class Reference

A specialized view, usually displayed at the bottom of the screen. More...

#include <menus.h>

Inheritance diagram for TStatusLine::

TView TObject TStreamable List of all members.

Public Methods

 TStatusLine (const TRect &bounds, TStatusDef &aDefs)
 ~TStatusLine ()
virtual void draw ()
virtual TPalettegetPalette () const
virtual void handleEvent (TEvent &event)
virtual const char* hint (ushort aHelpCtx)
void update ()

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* hintSeparator
const char* const name

Protected Methods

 TStatusLine (StreamableInit)
virtual void write (opstream &os)
virtual void* read (ipstream &is)

Protected Attributes

TStatusItemitems
TStatusDefdefs

Detailed Description

The TStatusLine object is a specialized view, usually displayed at the bottom of the screen. Typical status line displays are lists of available hot keys, displays of available memory, time of day, current edit modes, and hints for users.

Status line items are TStatusItem objects which contain data members for a text string to be displayed on the status line, a key code to bind a hot key, and a command to be generated if the displayed text is clicked on with the mouse or the hot key is pressed.

Definition at line 842 of file menus.h.


Constructor & Destructor Documentation

TStatusLine::TStatusLine ( const TRect & bounds,
TStatusDef & aDefs )
 

Creates a TStatusLine object with the given bounds by calling TView::TView(bounds).

See also:
TView::TView

The ofPreProcess bit in options is set, eventMask is set to include evBroadcast, and growMode is set to gfGrowLoY | gfGrowHiX | gfGrowHiY.

The defs data member is set to `aDefs'. If `aDefs' is 0, items is set to 0; otherwise, items is set to aDefs->items.

TStatusLine::~TStatusLine ( )
 

Disposes of all the items and defs in the TStatusLine object, then calls TView destructor.

See also:
TView::~TView

TStatusLine::TStatusLine ( StreamableInit ) [protected]
 

Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit.


Member Function Documentation

TStreamable * TStatusLine::build ( ) [static]
 

Called to create an object in certain stream-reading situations.

Reimplemented from TView.

void TStatusLine::draw ( ) [virtual]
 

Draws the status line by writing the text string for each status item that has one, then any hints defined for the current help context, following a divider bar. Uses the appropriate palettes depending on each item's status.

Reimplemented from TView.

TPalette & TStatusLine::getPalette ( ) const [virtual]
 

Returns the default palette string.

Reimplemented from TView.

void TStatusLine::handleEvent ( TEvent & event ) [virtual]
 

Handles events sent to the status line by calling TView::handleEvent(), then checking for three kinds of special events.

  1. Mouse clicks that fall within the rectangle occupied by any status item generate a command event, with event.what set to the command in that status item.
  2. Key events are checked against the keyCode data member in each item; a match causes a command event with that item's command.
  3. Broadcast events with the command cmCommandSetChanged cause the status line to redraw itself to reflect any hot keys that might have been enabled or disabled.

Reimplemented from TView.

const char * TStatusLine::hint ( ushort aHelpCtx ) [virtual]
 

By default, hint() returns a 0 string. Override it to provide a context-sensitive hint string for the `aHelpCtx' argument. A nonzero string will be drawn on the status line after a divider bar.

See also:
getHelpCtx , helpCtx

void * TStatusLine::read ( ipstream & is ) [protected, virtual]
 

Reads from the input stream `is'.

Reimplemented from TView.

void TStatusLine::update ( )
 

Updates the status line by selecting the correct items from the lists in defs data member, depending on the current help context.

Then calls drawView() to redraw the status line if the items have changed.

void TStatusLine::write ( opstream & os ) [protected, virtual]
 

Writes to the output stream `os'.

Reimplemented from TView.


Member Data Documentation

TStatusDef * TStatusLine::defs [protected]
 

A pointer to the current linked list of TStatusDef objects. The list to use is determined by the current help context.

Definition at line 919 of file menus.h.

const char * TStatusLine::hintSeparator [static]
 

Undocumented.

Definition at line 909 of file menus.h.

TStatusItem * TStatusLine::items [protected]
 

A pointer to the current linked list of TStatusItem records.

Definition at line 914 of file menus.h.

const char *const TStatusLine::name [static]
 

Undocumented.

Reimplemented from TView.

Definition at line 951 of file menus.h.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:35 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001