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

TApplication Class Reference

The mother of all applications. More...

#include <app.h>

Inheritance diagram for TApplication::

TScreen TProgram TDisplay TGroup TProgInit TView TObject TStreamable List of all members.

Public Methods

virtual void suspend ()
virtual void resume ()
void getEvent (TEvent &event)

Protected Methods

 TApplication ()
virtual ~TApplication ()

Detailed Description

The mother of all applications.

TApplication is a shell around TProgram and differs from it mainly in constructor and destructor. TApplication provides the application with a standard menu bar, a standard desktop and a standard status line.

In any real application, you usually need to inherit TApplication and redefine some of its methods. For example to add custom menus you must redefine TProgram::initMenuBar(). To add a custom status line, you need to redefine TProgram::initStatusLine(). In the same way, to add a custom desktop you need to redefine TProgram::initDeskTop().

TVision's subsystems (the memory, video, event, system error, and history list managers) are all static objects, so they are constructed before entering into main, and are all destroyed on exit from main.

Should you require a different sequence of subsystem initialization and shut down, however, you can derive your application from TProgram, and manually initialize and shut down the TVision subsystems along with your own.

Definition at line 907 of file app.h.


Constructor & Destructor Documentation

TApplication::TApplication ( ) [protected]
 

Constructor.

Initializes the basics of the library.

This creates a default TApplication object by passing the three init function pointers to the TProgInit constructor.

TApplication objects get a full-screen view, TProgram::initScreen() is called to set up various screen-mode-dependent variables, and a screen buffer is allocated.

initDeskTop(), initStatusLine(), and initMenuBar() are then called to create the three basic TVision views for your application. Then the desk top, status line, and menu bar objects are inserted in the application group.

The state data member is set to (sfVisible | sfSelected | sfFocused | sfModal | sfExposed).

The options data member is set to zero.

Finally, the application pointer is set (to this object) and initHistory() is called to initialize an associated THistory object.

TApplication::~TApplication ( ) [protected, virtual]
 

Destructor.

Destroys the application object and, via the base destructors, destroys all its associated objects and frees all memory allocations.


Member Function Documentation

void TApplication::getEvent ( TEvent & event ) [inline, virtual]
 

Gets the next event from the event queue.

Simply calls TProgram::getEvent().

Reimplemented from TProgram.

Definition at line 968 of file app.h.

void TApplication::resume ( ) [virtual]
 

Restores the execution of the application.

Resumes the normal program execution. In my port, by default, it is called after the user recovers the execution of the program with `fg'.

See also:
TScreen::resume

Reimplemented from TProgram.

void TApplication::suspend ( ) [virtual]
 

Stops the execution of the application.

Suspends the program, used usually before temporary exit. In my port, by default, this function is called just after the user presses Ctrl-Z to suspend the program.

See also:
TScreen::suspend

Reimplemented from TProgram.


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