[tvision Index] [tvision Hierarchy] [Headers]
The mother of TApplication More...
#include <app.h>
The mother of TApplication.
Every program must be inherited from TProgram or from its child TApplication. TApplication differs from TProgram only for its constructor and destructor. However most applications will be derived from TApplication.
See Also: TApplication
[public]
Constructor.
[public virtual]
Destructor.
[public virtual]
Returns True if the focus can be moved from one desktop view to another one.
It just returns deskTop->valid(cmReleasedFocus).
[public virtual]
Executes a dialog.
`pD' points to the dialog. The dialog is executed only if it is valid. `data' is a pointer to the memory area where the dialog data will be read before executing the dialog and where the dialog data will be written after executing the dialog. If `data' is 0 no data area is used. This method calls TGroup::execView() to execute the dialog. The dialog is destroyed before returning from the function, so a call to delete is not necessary. executeDialog() returns cmCancel if the view is not valid, otherwise it returns the return value of TGroup::execView().
[public virtual]
Gets an event.
This method collects events from the system like key events, mouse events and timer events and returns them in the event structure.
[public virtual]
Returns a reference to the standard TProgram palette.
[public virtual]
Standard TProgram event handler.
This method first checks for keyboard events. When it catches keys from Alt-1 to Alt-9 it generates an evBroadcast event with the `command' field equal to cmSelectWindowNum and the `infoPtr' field in the range 1 to 9. Then it calls TGroup::handleEvent(). Last it checks for a cmQuit command. On success it calls TGroup::endModal(cmQuit) to end the modal state. This causes TProgram::run() method to return. In most applications this will result in program termination.
[public virtual]
Called when in idle state.
This method is called whenever the library is in idle state, i.e. there is not any event to serve. The main task it does is to update the status line (if one exists). In the original DOS version this method was called continously. In my port this method is called about 10 times for second. This result in less CPU load. The user may redefine this method for example to update a clock in the upper right corner of the screen, like the demo program does.
[public virtual]
Initializes the screen.
This method is called by the TProgram constructor. Its goal is to select the application palette (color, monochrome or black & white) and to set the shadow size. The shadows are usually painted in the right and bottom sides of menus and windows.
[public virtual]
Called on out of memory condition.
It is called from TProgram::validView() whenever lowMemory() returns True. This happens when there is few free memory. Of course this should rarely happen. This method may be redefined to tell the user (by calling messageBox() for example) that there is not free memory to end the current task.
[public virtual]
Sets a pending event.
Puts an event in the pending state. Only one event is allowed to be pending. The next call to getEvent() will return this pending event even if there are other events in the system queue to be handled.
[public virtual]
Runs TProgram.
Executes TProgram by calling its method execute(), which TProgram inherits from TGroup.
[public virtual]
Inserts a window in the TProgram.
[public]
Sets a new screen mode.
The `mode' parameter can by one of the constants smCO80, smBW80 or smMono. Optionally the value may be or-ed with smFont8x8. In my port this method only redraws the screen.
[public]
Checks if a view is valid.
Returns `p' if the view pointed by `p' is valid. Otherwise returns a null pointer.
First, if `p' is 0 the call returns 0. Next, if lowMemory() returns True the view pointed by `p' is released by calling TObject::destroy() followed by outOfMemory() and the function returns 0.
Last if a call to p->valid(cmValid) returns False the view pointed by `p' is released and the function returns 0.
Otherwise the method returns the pointer `p' and the view is valid.
[public virtual]
Releases TProgram resources.
This method releases all the resources allocated by TProgram. It sets pointers `statusLine', `menuBar' and `deskTop' to 0 and then calls TGroup::shutDown() and TVMemMgr::clearSafetyPool().
[public virtual]
Stops the execution of the application.
This method is empty. Will be redefined in TApplication which is a child of TProgram.
[public virtual]
Restores the execution of the application.
This method is empty. Will be redefined in TApplication which is a child of TProgram.
[public static]
Creates a new status line.
This method creates a standard TStatusLine view and returns its address. Most applications redefine it to have a custom status line.
[public static]
Creates a new menu bar.
This method creates a standard TMenuBar view and returns its address. Every application should redefine it to have custom menus.
[public static]
Creates a new desktop.
This method creates a standard TDeskTop view and returns its address. Few applications need to redefine it to have a custom desktop.
[public]
A pointer to the current TProgram object.
Only one TProgram object can exist at any time. In this way every object can call TProgram methods even if it does't know its name.
[public]
A pointer to the current status line view.
May be 0 if none exists.
[public]
A pointer to the current menu bar view.
May be 0 if none exists.
[public]
A pointer to the current desktop view.
May be 0 if none exists.
[public]
The current application palette.
This value may be apBlackWhite, apColor or apMonoChrome. Its value is chosen automatically at startup by initScreen().
[protected]
The current pending event.
This structure contains the current pending event, if any exists. A maximum of one pending event may be set by calling putEvent().
Documentation generated by sergio@athena.milk.it on Wed Feb 10 22:11:47 CET 1999 | Kdoc |