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

TFileDialog Class Reference

Implements a file dialog box, history pick list, and input line from which file names (including wildcards) can be input, edited, selected, and opened for editing. More...

#include <stddlg.h>

Inheritance diagram for TFileDialog::

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

Public Methods

 TFileDialog (const char *aWildCard, const char *aTitle, const char *inputName, ushort aOptions, uchar histId)
 ~TFileDialog ()
virtual void getData (void *rec)
void getFileName (char *s)
virtual void handleEvent (TEvent &event)
virtual void setData (void *rec)
virtual Boolean valid (ushort command)
virtual void shutDown ()

Static Public Methods

TStreamablebuild ()

Public Attributes

TFileInputLinefileName
TFileListfileList
char wildCard [PATH_MAX]
const char* directory

Static Public Attributes

const char* const name

Protected Methods

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

Detailed Description

TFileDialog implements a file dialog box, history pick list, and input line from which file names (including wildcards) can be input, edited, selected, and opened for editing.

The following commands are returned by TFileDialog when executed with a call to TGroup::execView():

 Constant       Value Meaning

 cmFileOpen     1001  Returned when Open pressed
 cmFileReplace  1002  Returned when Replace pressed
 cmFileClear    1003  Returned when Clear pressed
 cmFileInit     1004  Used by valid()
 

Definition at line 762 of file stddlg.h.


Constructor & Destructor Documentation

TFileDialog::TFileDialog ( const char * aWildCard,
const char * aTitle,
const char * inputName,
ushort aOptions,
uchar histId )
 

Creates a fixed-size, framed dialog box with the given title `aTitle'.

A TFileInputLine object (referenced by the fileName data member) is created and inserted, labeled with `inputName' and with its TFileInputLine::data field set to `aWildCard'.

The `aWildCard' argument is expanded (if necessary) to provide a TFileList object, referenced by the fileList data member.

A THistory object is created and inserted with the given history ID `histID'.

A vertical scroll bar is created and inserted. Depending on the `aOptions' flags, the appropriate buttons are set up. These options perform the specified operations:

 Constant        Value  Meaning

 fdOKButton      0x0001 Put an OK button in the dialog

 fdOpenButton    0x0002 Put an Open button in the dialog

 fdReplaceButton 0x0004 Put a Replace button in the dialog
 
 fdClearButton   0x0008 Put a Clear button in the dialog

 fdHelpButton    0x0010 Put a Help button in the dialog

 fdNoLoadDir     0x0100 Do not load the current directory contents into
                        the dialog when intialized. This means you
                        intend to change the wildcard by using
                        setData() or intend to store the dialog on
                        a stream.
 

A TFileInfoPane object is created and inserted. If the fdNoLoadDir flag is not set, the files in the current directory are loaded into the file list.

TFileDialog::~TFileDialog ( )
 

Deletes directory, then destroys the file dialog.

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

Undocumented.

Definition at line 888 of file stddlg.h.


Member Function Documentation

TStreamable * TFileDialog::build ( ) [static]
 

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

Reimplemented from TDialog.

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

Undocumented.

Reimplemented from TGroup.

void TFileDialog::getFileName ( char * s )
 

Takes the fileName->data field and expands it to a full path format. The result is set in `s'.

See also:
TFileDialog::fileName , TFileInputLine::data

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

Calls TDialog::handleEvent(), then handles cmFileOpen, cmFileReplace and cmFileClear events.

These all call TView::endModal() and pass their commands to the view that opened the file dialog.

Reimplemented from TDialog.

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

Reads from the input stream `is'.

Reimplemented from TWindow.

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

Undocumented.

Reimplemented from TGroup.

void TFileDialog::shutDown ( ) [virtual]
 

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.

Reimplemented from TWindow.

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

Returns True if `command' is cmValid, indicating a successful construction. Otherwise calls TDialog::valid().

If this returns True, the current fileName is checked for validity.

Valid names will return True. Invalid names invoke an "Invalid file name" message box and return False.

Reimplemented from TDialog.

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

Writes to the output stream `os'.

Reimplemented from TWindow.


Member Data Documentation

const char * TFileDialog::directory
 

The current directory.

Definition at line 869 of file stddlg.h.

TFileList * TFileDialog::fileList
 

Pointer to the associated file list.

Definition at line 861 of file stddlg.h.

TFileInputLine * TFileDialog::fileName
 

Pointer to the associated input line.

Definition at line 857 of file stddlg.h.

const char *const TFileDialog::name [static]
 

Undocumented.

Reimplemented from TDialog.

Definition at line 902 of file stddlg.h.

char TFileDialog::wildCard
 

The current path and file name.

Definition at line 865 of file stddlg.h.


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