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

TStaticText Class Reference

Used to show fixed text in a window. More...

#include <dialogs.h>

Inheritance diagram for TStaticText::

TView TObject TStreamable TLabel TParamText List of all members.

Public Methods

 TStaticText (const TRect &bounds, const char *aText)
 ~TStaticText ()
virtual void draw ()
virtual TPalettegetPalette () const
virtual void getText (char *s)

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* const name

Protected Methods

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

Protected Attributes

const char* text

Detailed Description

Used to show fixed text in a window.

TStaticText objects represent the simplest possible views: they contain fixed text and they ignore all events passed to them. They are generally used as messages or passive labels.

Descendants of TStaticText, such as TLabel or TParamText objects, usually perform more active roles. Use TParamText if you want to show dynamic text also, where dynamic means user-selectable at run-time.

Definition at line 1808 of file dialogs.h.


Constructor & Destructor Documentation

TStaticText::TStaticText ( const TRect & bounds,
const char * aText )
 

Constructor.

Creates a TStaticText object of the given size by calling TView::TView(bounds), then sets text data member to newStr(aText). `bounds' is the bounding rectangle of the view. `aText' is a pointer to the string to show.

See also:
TView::TView , newStr

TStaticText::~TStaticText ( )
 

Disposes of the text string, then calls TView::~TView() to destroy the object.

See also:
TView::~TView

TStaticText::TStaticText ( 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 * TStaticText::build ( ) [static]
 

Creates a new TStaticText.

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

Reimplemented from TView.

Reimplemented in TParamText, and TLabel.

void TStaticText::draw ( ) [virtual]
 

Draws the text string inside the view, word wrapped if necessary. A '\n' in the text indicates the beginning of a new line. A line of text is centered in the view if the string begins with 0x03 (Ctrl-C).

Reimplemented from TView.

Reimplemented in TLabel.

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

Returns a reference to the default palette.

Reimplemented from TView.

Reimplemented in TLabel.

void TStaticText::getText ( char * s ) [virtual]
 

Writes the string at address `s'.

Reimplemented in TParamText.

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

Reads from the input stream `is'.

Reimplemented from TView.

Reimplemented in TParamText, and TLabel.

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

Writes to the output stream `os'.

Reimplemented from TView.

Reimplemented in TParamText, and TLabel.


Member Data Documentation

const char *const TStaticText::name [static]
 

Undocumented.

Reimplemented from TView.

Reimplemented in TParamText, and TLabel.

Definition at line 1870 of file dialogs.h.

const char * TStaticText::text [protected]
 

A pointer to the (constant) text string to be displayed in the view.

Definition at line 1846 of file dialogs.h.


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