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

TDialog Class Reference

A non-growable child of TWindow, usually used as a modal view. More...

#include <dialogs.h>

Inheritance diagram for TDialog::

TWindow TGroup TWindowInit TView TObject TStreamable TChDirDialog TColorDialog TFileDialog List of all members.

Public Methods

 TDialog (const TRect &bounds, const char *aTitle)
virtual TPalettegetPalette () const
virtual void handleEvent (TEvent &event)
virtual Boolean valid (ushort command)

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* const name

Protected Methods

 TDialog (StreamableInit)

Detailed Description

TDialog is a simple child of TWindow.

Data member growMode is set to zero; that is, dialog boxes are not growable. The flags data member is set for wfMove and wfClose; that is, dialog boxes are moveable and closable (a close icon is provided).

The TDialog event handler calls TWindow::handleEvent() but additionally handles the special cases of Esc and Enter key responses. The Esc key generates a cmCancel command, while Enter generates the cmDefault command.

See also:
TDialog::handleEvent

The TDialog::valid() member function returns True on cmCancel; otherwise, it calls its TGroup::valid().

Definition at line 136 of file dialogs.h.


Constructor & Destructor Documentation

TDialog::TDialog ( const TRect & bounds,
const char * aTitle )
 

Creates a dialog box with the given size and title by calling TWindow::TWindow(bounds, aTitle, wnNoNumber) and TWindowInit::TWindowInit(&TDialog::initFrame).

See also:
TWindow::TWindow , TWindowInit::TWindowInit

growMode is set to 0, and flags is set to wfMove | wfClose.

By default, dialog boxes can move and close (via the close icon) but cannot grow (resize).

Note that TDialog does not define its own destructor, but uses TWindow::close() and the destructors inherited from TWindow, TGroup, and TView.

See also:
TWindow::~TWindow

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

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

Reimplemented from TWindow.

Reimplemented in TColorDialog, TFileDialog, and TChDirDialog.

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

Returns the default palette string.

Reimplemented from TWindow.

void TDialog::handleEvent ( TEvent & event ) [virtual]
 

Calls TWindow::handleEvent(event), then handles Enter and Esc key events specially.

See also:
TWindow::handleEvent

In particular, Esc generates a cmCancel command, and Enter broadcasts a cmDefault command.

This member function also handles cmOK, cmCancel, cmYes, and cmNo command events by ending the modal state of the dialog box.

For each of the above events handled successfully, this member function calls clearEvent().

Reimplemented from TWindow.

Reimplemented in TColorDialog, TFileDialog, and TChDirDialog.

Boolean TDialog::valid ( ushort command ) [virtual]
 

Returns True if the command argument is cmCancel. This is the command generated by handleEvent() when the Esc key is detected.

If the command argument is not cmCancel, valid calls TGroup::valid(command) and returns the result of this call.

See also:
TGroup::valid()

TGroup's valid() calls the valid() member functions of each of its subviews.
See also:
TView::valid()

The net result is that valid() returns True only if the group controls all return True; otherwise, it returns False. A modal state cannot terminate until all subviews return True when polled with valid().

Reimplemented from TGroup.

Reimplemented in TFileDialog, and TChDirDialog.


Member Data Documentation

const char *const TDialog::name [static]
 

Undocumented.

Reimplemented from TWindow.

Reimplemented in TColorDialog, TFileDialog, and TChDirDialog.

Definition at line 207 of file dialogs.h.


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