Sign in Join
FPDoc Onlineexperiment

TFileNameEdit.CreateDialog function

Member of TFileNameEditprotectedIn unit EditBtn

Creates the dialog for the control.

Declaration

pascal
function CreateDialog(AKind: TDialogKind): TCommonDialog; virtual

Arguments

AKind

Identifies the dialog kind or type created in the method.

Function result

Dialog class instance created in the method.

Description

CreateDialog is a TCommonDialog function which creates and returns the dialog for the grouped edit control.

AKind contains the TDialogKind value that identifies the dialog type required for the control, and normally has the value from the DialogKind property. AKind determines the class type instantiated and used as the return value. For example:

dkOpen
TOpenDialog is the type in return value.
dkPictureOpen
TOpenPictureDialog is the type in return value.
dkSave, dkPictureSave
TSaveDialog is the type in return value.

Properties relevant to the dialog kind are copied into the dialog, and may include:

  • FileName
  • Path information extracted from FileName
  • InitialDir
  • DefaultExt
  • Filter
  • FilterIndex
  • DialogOptions
  • DialogTitle

For an open dialog, path information in FileName is retained if the path is valid. This causes use of InitialDir to be disabled in the dialog. If the path in Filename is invalid, only the base file name and extension are copied to the dialog. An explicit value in InitialDir is resolved (cleaned and expanded) when valid, and stored to the dialog. Otherwise, the initial directory is determined by the widgetset when the dialog is executed.

CreateDialog is used in the implementation of the RunDialog method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.