#include <app.h>
Inheritance diagram for TApplication::
Public Methods | |
virtual void | suspend () |
virtual void | resume () |
void | getEvent (TEvent &event) |
Protected Methods | |
TApplication () | |
virtual | ~TApplication () |
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. 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. |
|
Destructor. Destroys the application object and, via the base destructors, destroys all its associated objects and frees all memory allocations. |
|
Gets the next event from the event queue. Simply calls TProgram::getEvent(). Reimplemented from TProgram. |
|
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'.
Reimplemented from TProgram. |
|
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.
Reimplemented from TProgram. |