UPLOAD - DOSUIT07.ZIP - FILEEDIT.HPP

 
Output of file : FILEEDIT.HPP contained in archive : DOSUIT07.ZIP

// TextEdits for file names and directories
#ifndef FILEEDIT_HPP
#define FILEEDIT_HPP
#ifndef TEXTEDIT_HPP
#include "textedit.hpp"
#endif
#ifndef FLIST_HPP
#include "flist.hpp"
#endif

/*
A TextEdit which allows the user to enter a DOS file name. This
class implements the browse method, allowing the user to pop down a
browse window with a list containing all the files in the current
directory, all the subdirectories of the current directory, the
parent directory and all other disk drives. The user may select a
file from the current directory, or navigate around the directory
tree by selecting subdirectories, the parent directory, or other
disks.

If allowCreate is non-zero, any valid DOS filename which includes a
valid path (or no path at all) will be accepted as valid. If it is
zero, only existing DOS files are allowed. Changing the value of
FileAttribute determines the type of file that may be accepted - e.g.
a value of FAwriteable will not allow the selection of an existing
read-only file.
*/
class FileEdit : public UpperEdit {
public:
FileEdit(char *string,const char *prompt = "",
int allowCreate = 0,FileAttribute a = FAfile,int length = 30);

const char *directory() const;
const char *filename() const;

virtual int validate();
virtual Complete complete();

protected:
virtual VObject *browse();

private:
int createOK;
FileAttribute attrib;
};

/*
A TextEdit which allows the user to enter a DOS directory name. This
class implements the browse method, allowing the user to pop down a
browse window with a list containing the current directory, all the
subdirectories of the current directory, the parent directory and
all other disk drives. The user may select the current directory, or
navigate around the directory tree by selecting subdirectories, the
parent directory, or other disks.
*/
class DirectoryEdit : public FileEdit {
public:
DirectoryEdit(char *string,const char *prompt = "",int length = 30);
};

#endif