A standard dialog for obtaining an existing file name for loading by the application.
![]() | POpenFileDialog ( PInteractor * parent, PRESOURCE_ID resID = PSTD_ID_DIALOG_OPEN_FILE ) Create a new standard open file dialog. |
![]() | ~POpenFileDialog () Destroy the standard open file dialog. |
![]() | AddFileType ( const PString & type ) Add a file type to the array of file types that may be specified for the file dialog. |
![]() | GetFileTypes () const Get the array of file types that may be specified for the file dialog. |
![]() | SetFileTypes ( const PStringArray & array ) Set the array of file types that may be specified for the file dialog |
![]() | SetInitialFileType ( PINDEX idx ) Set the file type displayed when dialog is opened |
![]() | GetFinalFileType () const Get file type that was finally displayed |
![]() | OnFilterFile ( const PFilePath & file ) This is called as the dialog fills the list of files available to be selected. |
![]() | New functions for class |
![]() | Callback functions |
Overrides from class PDialog
Overrides from class PInteractor
Overrides from class PObject
System callback functions.
A standard dialog for obtaining an existing file name for loading by the application. The exact appearance of the dialog is platform specific, however they all consists of the same basic functions.The semantics of the set of file types is slightly different on different platforms. For the Macintosh all files in the set are displayed. For MS-Window a choice box is available which allows the user to select one of the types in the set and only files for that single type are available.
Note that unlike most dialogs, most operations such as PInteractor::Show(), PInteractorLayout::GetControl() etc may not be executed before the PModalDialog::RunModal() function has been executed. Furthermore, they are not available after PModalDialog::RunModal() has returned. Similarly some functions such as PFileDialog::SetDirectory() are not available within the centext of PModalDialog::RunModal(). This is due to the implementation on some platforms which goes to great lengths to use the actual standard file dialog for the platform.
The file type array is used to filter out file names unless they have
a file type within the set. If the array is empty then all files are
available. They may be subsequently filtered by the
OnFilterFile() callback function.
The file type array is used to filter out file names unless they have
a file type within the set. If the set is empty then all files are
available. They may be subsequently filtered by the
OnFilterFile() callback function.
Note that the files are pre-filtered with those files that are specified
in the file types set created with the AddFileType() function.
virtual ~POpenFileDialog()
New functions for class
PINDEX AddFileType( const PString & type )
PStringArray GetFileTypes() const
void SetFileTypes( const PStringArray & array )
void SetInitialFileType( PINDEX idx )
PINDEX GetFinalFileType() const
Callback functions
virtual BOOL OnFilterFile( const PFilePath & file )
Alphabetic index HTML hierarchy of classes or Java