OpenDialog¶
Qualified name: delphifmx.OpenDialog
- class OpenDialog¶
Bases:
FmxObjectTOpenDialog is a class used to display a file-selection dialog. Use TOpenDialog to display a dialog box for selecting and opening files. When the user clicks the Open button, the dialog closes and the selected files are stored in the Files property.
Note: The dialog does not appear at run time until it is activated by a call to the Execute method.
Methods
TOpenDialog.Execute() Displays the dialog
Attributes
ActionClientSpecifies whether the component object has an associated action.
ChildrenStores an array of children attached to this parent component.
ChildrenCountRead-only property that specifies the number of children in the children list.
ClassNameReturns the TObject.ClassName
ComObjectSpecifies the interface reference implemented by the component.
ComponentCountReturns the owned component count
ComponentIndexIndicates the position of the component in its owner's Components property array.
ComponentStateDescribes the current state of the component, indicating when a component needs to avoid certain actions.
ComponentStyleGoverns the behavior of the component.
ComponentsReturns an iterator over the owned components
DataStores a Tvalue, which is a data structure that can store different kinds of data types.
Specifies a default file extension.
DesignInfoContains information used by the Form designer.
FileNameRepresents the list containing the absolute paths of the selected files.
Represents the file masks (filters) of the dialog.
Determines which filter is selected by default when the dialog opens.
int:
Maintains a list of the previously selected files.
IndexSpecifies the index of the child object in the children array attached to this object.
Determines which directory is selected by default when the dialog opens.
NameSpecifies the name of the component as referenced in code.
ObserversIndicates the TObservers object added to the TComponent.
Callable[[Object, bool], None]:
Determines the appearance and behavior of the file-selection dialog.
Augments the Options property with additional flags that determine the appearance and behavior of the file selection dialog.
OwnerReturns the Component Owner
ParentReturns/Sets the Control Visibility
RootSpecifies the root parent of this object.
StoredSpecifies whether this object is stored in the .XFM file.
StyleNameSpecifies the style name for this FMX component.
TagStores a NativeInt integral value as a part of a component.
TagFloatCustom property that stores any floating-point value.
TagObjectCustom property that stores any object value.
TagStringCustom property that stores any string value.
Specifies the text displayed in the dialog's title bar.
VCLComObjectRepresents information used internally by components that support COM.
- DefaultExt¶
Specifies a default file extension. DefaultExt specifies a file extension that is appended automatically to the selected file name, unless the selected file name already includes a registered extension. Extensions longer than three characters are not supported. Do not include the period (.) that separates the file name from the extension.
- Type:
str
- Execute()¶
Displays the dialog
- Files¶
Represents the list containing the absolute paths of the selected files. Files represents a string list that contains the absolute path of each selected file.
Note: In order for the user to select multiple files, set the ofAllowMultiSelect flag in Options.
- Type:
- Filter¶
Represents the file masks (filters) of the dialog. The file-selection dialog includes a drop-down list of file types on the left of the ‘File Name:’ edit box. When the user picks a file type from the list, only files of the selected type are displayed in the dialog. You can select only one filter at a time. In order for Filter to work properly, the assigned string must be formatted as follows: ‘<first displayed name>|<first file extension>|<second displayed name>|<second file extension>|…|<n-th displayed name>|<n-th file extension>’ For example, the next code sample will add filters for text and executable files:
OpenDialog1.Filter:=’Applications (.exe)|.EXE|Text files (.txt)|.TXT’;
- Type:
str
- FilterIndex¶
Determines which filter is selected by default when the dialog opens. FilterIndex determines which of the file types in Filter is selected by default when the dialog opens. Set FilterIndex to 1 to choose the first file type in the list as default, 2 to choose the second file type as the default, and so on. If the value of FilterIndex is out of range, the last file type listed in Filter is selected by default.
- Type:
int
- HelpContext¶
int:
- HistoryList¶
Maintains a list of the previously selected files. Obsolete property. HistoryList is maintained for compatibility with older versions of TOpenDialog. It is not used.
- Type:
- InitialDir¶
Determines which directory is selected by default when the dialog opens. InitialDir determines the default directory displayed in the file-selection dialog when it opens. If no value is assigned to InitialDir, or the specified directory does not exist, the initial directory is controlled by a special registry key assigned to your application.
Note: For Windows, the registry key can be found at HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32LastVisitedMRU.
- Type:
str
- OnCanClose¶
Callable[[Object, bool], None]:
- Options¶
Determines the appearance and behavior of the file-selection dialog. Use the Options property to customize the appearance and functionality of the dialog.
- Type:
OpenOptions
- OptionsEx¶
Augments the Options property with additional flags that determine the appearance and behavior of the file selection dialog. Use the OptionsEx property to further customize the file open dialog beyond the options covered by the Options property.
- Type:
OpenOptionsEx
- Title¶
Specifies the text displayed in the dialog’s title bar. Use Title to set the text that appears in the file-selection dialog’s title bar. If no value is assigned to Title, the dialog’s title is “Open”.
- Type:
str