MQOpenFileDialog class

(new in Rev4.00)

MQOpenFileDialog is a class for a selection of a file to be loaded. It inherits a MQFileDialogBase class.

Class
MQOpenFileDialog Constructor
~MQOpenFileDialog Destructor
Member functions
GetFileMustExist Get whether only existing files can be selected or not
SetFileMustExist Set whether only existing files can be selected or not
GetMultiSelect Multiple selection
SetMultiSelect Multiple selection
Execute Open a file dialog
GetFileNamesCount Get a number of files
GetFileNames Get a filename for multiple selection

MQOpenFileDialog::MQOpenFileDialog(MQWindowBase& parent);

parent
A parent window

It is a constructor.


virtual MQOpenFileDialog::~MQOpenFileDialog();

This method is a destructor. It is defined as a virtual function.


bool MQOpenFileDialogy::GetFileMustExist();

Return value
Whether to select existing files only

It returns whether to select existing files and directories only.


void MQOpenFileDialog::SetFileMustExist(bool val) const;

val
Whether to select existing files only

It specifies whether to select existing files and directories only.

When false is specified, it can select a new file that does not exist yet by inputting a filename directly.


bool MQOpenFileDialog::GetMultiSelect();

Return value
Whether to select multiple files or not

It returns whether multiple files can be selected or not.


void MQOpenFileDialog::SetMultiSelect(bool val);

val
Whether to select multiple files or not

It specifies whether multiple files can be selected or not.

When true is specified, not GetFileName() but GetFileName() is used to get a filename.


bool MQOpenFileDialog::Execute();

Return value
Whether a file was selected or not

It opens a file dialog to input a filename for a user.

It returns 'true' when the user inputted a filename, and it returns 'false' when the user canceled. When true is returned, the filename(s) can be got by MQFileDialogBase::GetFileName() or GetFileNames().


bool MQOpenFileDialog::GetFileNamesCount();

Return value
A number of selected files

It returns a number of files selected byExecute() when the multiple selection is valid.


std::wstring MQOpenFileDialog::GetFileNames(int index);

index
An inded of a file
Return value
A filename

It returns a filename selected by Execute() in a full path when the multiple selection is valid.