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

TOutline Class Reference

Implements a simple outline viewer. More...

#include <outline.h>

Inheritance diagram for TOutline::

TOutlineViewer TScroller TView TObject TStreamable List of all members.

Public Methods

 TOutline (const TRect &bounds, TScrollBar *aHScrollBar, TScrollBar *aVScrollBar, TNode *aRoot)
 ~TOutline ()
virtual void adjust (TNode *node, Boolean expand)
virtual TNodegetRoot ()
virtual int getNumChildren (TNode *node)
virtual TNodegetChild (TNode *node, int i)
virtual char* getText (TNode *node)
virtual Boolean isExpanded (TNode *node)
virtual Boolean hasChildren (TNode *node)

Static Public Methods

TStreamablebuild ()

Public Attributes

TNoderoot

Static Public Attributes

const char* const name

Protected Methods

virtual void write (opstream &os)
virtual void* read (ipstream &is)
virtual void writeNode (TNode *, opstream &)
virtual TNodereadNode (ipstream &)
 TOutline (StreamableInit)

Detailed Description

TOutline implements a simple but useful type of outline viewer.

It assumes that the outline is a linked list of records of type TNode, so each node consists of a text string (TNode::text), a pointer to any child nodes (TNode::childList), and a pointer to the next node at the same level (TNode::next).

Definition at line 392 of file outline.h.


Constructor & Destructor Documentation

TOutline::TOutline ( const TRect & bounds,
TScrollBar * aHScrollBar,
TScrollBar * aVScrollBar,
TNode * aRoot )
 

Constructs an outline view by passing `bounds', `aHScrollBar' and `aVScrollBar' to the constructor inherited from TOutlineViewer.

Sets root to `aRoot', then calls update() to set the scrolling limits of the view based on the data in the outline.

TOutline::~TOutline ( )
 

Disposes of the outline view by first disposing of the root node, which recursively disposes of all child nodes, then calling the destructor inherited from TView.

TOutline::TOutline ( StreamableInit s ) [inline, 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.

Definition at line 485 of file outline.h.


Member Function Documentation

void TOutline::adjust ( TNode * node,
Boolean expand ) [virtual]
 

Sets the expanded field of `node' to the value passed in `expand'. If `expand' is True, this causes the child nodes linked to `node' to be displayed. If `expand' is False, node's child nodes are hidden.

Reimplemented from TOutlineViewer.

TStreamable * TOutline::build ( ) [static]
 

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

Reimplemented from TOutlineViewer.

TNode * TOutline::getChild ( TNode * node,
int i ) [virtual]
 

Returns a pointer to the i-th child in node's TNode::childList.

Reimplemented from TOutlineViewer.

int TOutline::getNumChildren ( TNode * node ) [virtual]
 

Returns the number of nodes in node's TNode::childList, or zero if TNode::childList is 0.

Reimplemented from TOutlineViewer.

TNode * TOutline::getRoot ( ) [virtual]
 

Returns root, which points to the top of the list of nodes for the outline.

Reimplemented from TOutlineViewer.

char * TOutline::getText ( TNode * node ) [virtual]
 

Returns the string pointed to by node's TNode::text field.

Reimplemented from TOutlineViewer.

Boolean TOutline::hasChildren ( TNode * node ) [virtual]
 

Returns True if node's TNode::childList is non-0; otherwise returns False.

Reimplemented from TOutlineViewer.

Boolean TOutline::isExpanded ( TNode * node ) [virtual]
 

Returns the value of node's TNode::expanded field.

Reimplemented from TOutlineViewer.

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

Reads from the input stream `is'.

Reimplemented from TOutlineViewer.

TNode * TOutline::readNode ( ipstream & ) [protected, virtual]
 

Undocumented.

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

Writes to the output stream `os'.

Reimplemented from TOutlineViewer.

void TOutline::writeNode ( TNode *,
opstream & ) [protected, virtual]
 

Undocumented.


Member Data Documentation

const char *const TOutline::name [static]
 

Undocumented.

Reimplemented from TOutlineViewer.

Definition at line 479 of file outline.h.

TNode * TOutline::root
 

Points to the root node of the outline tree.

Definition at line 446 of file outline.h.


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