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

TChDirDialog Class Reference

Dialog box used to change the current working directory. More...

#include <stddlg.h>

Inheritance diagram for TChDirDialog::

TDialog TWindow TGroup TWindowInit TView TObject TStreamable List of all members.

Public Methods

 TChDirDialog (ushort aOptions, ushort histId)
virtual ushort dataSize ()
virtual void getData (void *rec)
virtual void handleEvent (TEvent &)
virtual void setData (void *rec)
virtual Boolean valid (ushort command)
virtual void shutDown ()

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* const name

Protected Methods

 TChDirDialog (StreamableInit)
virtual void write (opstream &os)
virtual void* read (ipstream &is)

Friends

class  TDirListBox

Detailed Description

TChDirDialog implements a dialog box labeled "Change Directory", used to change the current working directory.
See also:
TDialog

An input line is provided to accept a directory name from the user. A history window and directory list box with vertical scroll bar are available to show recent directory selections and a tree of all available directories.
See also:
TDirListBox , THistoryWindow , TInputLine

Mouse and keyboard selections can be made in the usual way by highlighting and clicking. The displayed options are:

  1. Directory name
  2. Directory tree
  3. OK (the default)
  4. Chdir
  5. Revert
  6. Help
Method TChDirDialog::handleEvent() generates the appropriate commands for these selections.

Note: TDirListBox is a friend of TChDirDialog, so that the member functions of TDirListBox can access the private members of TChDirDialog.

Definition at line 1326 of file stddlg.h.


Constructor & Destructor Documentation

TChDirDialog::TChDirDialog ( ushort aOptions,
ushort histId )
 

Constructor.

Creates a change directory dialog object with the given history identifier `histId'. The `aOptions' argument is a bitmap of the following flags:

 Constant     Value Meaning

 cdNormal     0x00  Option to use the dialog immediately.

 cdNoLoadDir  0x01  Option to initialize the dialog without loading the
                    current directory into the dialog. Used if you
                    intend using setData() to reset the directory
                    or prior to storage on a stream.

 cdHelpButton 0x02  Option to put a help button in the dialog.
 

The constructor creates and inserts:

  1. a TInputLine object (labeled "Directory ~n~ame")
  2. a THistory object
  3. a vertical scroll bar, see TScrollBar
  4. a TDirListBox object (labeled "Directory ~t~ree")
  5. three buttons "O~K~", "~C~hdir" and "~R~evert", see TButton
If `aOptions' has the cdHelpButton flag set, a fourth help button is created. Unless the cdNoLoadDir option is set, the dialog box is loaded with the current directory.

Unsigned short `histId' is an arbitrary positive integer used to identify which history set to use. The library can use multiple history sets and all views with the same history identifier will share the same history set.

TChDirDialog::TChDirDialog ( StreamableInit ) [inline, protected]
 

Constructor.

Used to recover the view from a stream.

Definition at line 1451 of file stddlg.h.


Member Function Documentation

TStreamable * TChDirDialog::build ( ) [static]
 

Creates a new TChDirDialog.

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

Reimplemented from TDialog.

ushort TChDirDialog::dataSize ( ) [virtual]
 

Returns the size of the data record of this dialog.

By default, dataSize() returns 0. Override to return the size (in bytes) of the data used by getData() and setData() to store and retrieve dialog box input data.

See also:
TGroup::dataSize

Reimplemented from TGroup.

void TChDirDialog::getData ( void * rec ) [virtual]
 

Reads the data record of this dialog.

By default, getData() does nothing. Override to copy dataSize() bytes from the view to `rec'. Used in combination with dataSize() and setData() to store and retrieve dialog box input data.

See also:
TGroup::getData

Reimplemented from TGroup.

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

Standard TChDirDialog event handler.

Calls TDialog::handleEvent() then processes cmRevert (restore previously current directory) and cmChangeDir (switch to selected directory) events. The dialog is redrawn if necessary.

Reimplemented from TDialog.

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

Used to recover the view from a stream. Reads from the input stream `is'.

Reimplemented from TWindow.

void TChDirDialog::setData ( void * rec ) [virtual]
 

Writes the data record of this dialog.

By default, setData() does nothing. Override to copy dataSize() bytes from `rec' to the view. Used in combination with dataSize() and getData() to store and retrieve dialog box input data.

See also:
TGroup::setData

Reimplemented from TGroup.

void TChDirDialog::shutDown ( ) [virtual]
 

Releases TChDirDialog resources.

Used internally by TObject::destroy() to ensure correct destruction of derived and related objects. shutDown() is overridden in many classes to ensure the proper setting of related data members when destroy() is called.

See also:
TObject::shutDown

This method releases all the resources allocated by the TChDirDialog dialog. It sets private pointers TChDirDialog::dirList, TChDirDialog::dirInput, TChDirDialog::okButton, and TChDirDialog::chDirButton to 0 and then calls TDialog::shutDown().

Reimplemented from TWindow.

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

Checks if the command `command' is valid.

The return value is True if `command' is not cmOK. Otherwise (the OK button was pressed) the return value depends on path existence. The function returns True if the path exists. An invalid directory invokes the "Invalid directory" message box and returns False.

See also:
TDialog::valid

Reimplemented from TDialog.

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

Used to store the view in a stream. Writes to the output stream `os'.

Reimplemented from TWindow.


Member Data Documentation

const char *const TChDirDialog::name [static]
 

Undocumented.

Reimplemented from TDialog.

Definition at line 1467 of file stddlg.h.


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