The component provides standard dialogues for calling dialogue boxes. In this chapter, properties and methods of the class Dialog (gb.qt4) are presented. Examples and a project complete the description.
The Dialog (gb.qt4) class has these properties:
|ShowHidden||Boolean||Returns the value or sets with True that hidden files should also be shown in the dialogue box.|
|Color||Integer||Determines the colour selected in the colour selection dialogue or sets the colour in the colour selection dialogue as default colour.|
|Filter||String||Determines the filter used in the dialogue (file extension) or sets the filter. Filter is a string array where each entry consists of a filter and a filter description. A filter is a list of file extensions with placeholders separated by a semicolon. A filter description can be any string. A filter is automatically appended to the filter description when displayed.|
|Font||Font||Determines the font selected in the font selection dialogue or sets the font in the font selection dialogue as the default font.|
|Path||String||Returns the selected file path in the file selection dialog as string or sets the file path in the file dialog as default path.|
|Paths||String||Returns the selected file paths in the file open dialog as a string array.|
|Title||String||Returns the (window) title selected in the dialogue or sets the title for the dialogue.|
Table 188.8.131.52.1 : Properties of the Dialog class (gb.qt4)
Class Dialog (gb.qt4) has the following methods. Note optional arguments.
|OpenFile( [ Multi As Boolean ] ) As Boolean||Invokes the file open dialog to retrieve the file name of the file to be opened. If the optional argument 'Multi' has the value False (default), the user can select exactly one file. The return value is the path to the selected file - stored in the path property Dialog.Path. If the optional argument 'Multi' has the value True, the user can select multiple files. The return value is a string array containing the paths to all selected files - stored in the Dialog.Paths property. The method itself returns True if the user has pressed the Cancel button or False if the user has pressed the OK button.|
|SaveFile( ) As Boolean|
|SelectDirectory( ) As Boolean||Calls the file standard dialogue to read out an existing directory name. The method itself returns True if the user pressed the Cancel button or False if the user pressed the OK button.|
|SelectFont( ) As Boolean||Calls the standard font selection dialogue. The method itself returns True if the user pressed the Cancel button or False if the user pressed the OK button.|
|SelectColor() As Boolean||Calls the standard colour selection dialogue. The method itself returns True if the user pressed the Cancel button or False if the user pressed the OK button.|
Table 184.108.40.206.1 : Methods of the class Dialog (gb.qt4)
In order to be able to reproduce all the examples, you will find a project archive in the download area. Since this project is based on the project presented in chapter → 12.4.1 Class Dialogue (gb.form.dialog) and only the component gb.form.dialog has been omitted, only the dialogue boxes and the program interface are presented.