[Overview][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'LCLTaskDialog' (#lcl)

Execute

Launches the task dialog form.

Declaration

Source position: lcltaskdialog.pas line 332

function TTaskDialog.Execute(

  aCommonButtons: TCommonButtons = [];

  aButtonDef: Integer = 0;

  aFlags: TTaskDialogFlags = [];

  aDialogIcon: TTaskDialogIcon = tiInformation;

  aFooterIcon: TTaskDialogFooterIcon = tfiWarning;

  aRadioDef: Integer = 0;

  aWidth: Integer = 0;

  aParent: HWND = 0;

  aNonNative: Boolean = False;

  aEmulateClassicStyle: Boolean = False;

  aOnButtonClicked: TTaskDialogButtonClickedEvent = Nil

):Integer;

Arguments

aCommonButtons

  

Set of common or standard buttons enabled on the task dialog form.

aButtonDef

  

Indicates the button which is the default for the task dialog form.

aFlags

  

Set of flags used to configure the task dialog and specify its behavior.

aDialogIcon

  

Specifies the main icon displayed on the task dialog.

aFooterIcon

  

Specifies the icon displayed in the footer area for the task dialog.

aRadioDef

  

Ordinal position for the default radio button selected on the task dialog.

aWidth

  

Specifies the display width for the task dialog form, or 0 to automatically calculate the width.

aParent

  

Window handle for the parent window of the task dialog. 0 causes the active form on the current monitor to be used.

aNonNative

  

True causes Delphi emulation code to be used during execution of the task dialog.

aEmulateClassicStyle

  

True forces a non-themed (classic) user interface to be used.

aOnButtonClicked

  

Contains the callback executed when a button is clicked.

Function result

Modal result value returned from the dialog.

Description

Some common buttons can be set via aCommonButtons. In emulation mode, aFlags will handle only tdfUseCommandLinks, tdfUseCommandLinksNoIcon, and tdfQuery options.

Returns 0 on error, or the Button ID (e.g. mrOk for the OK button or 100 for the first custom button defined in Buttons string).

If Buttons have been defined, aButtonDef can set the selected Button ID on the dialog.

If radio buttons have been defined in Radios, values in ARadioDef and AFlags are used to control the default radio button which is Checked on the dialog. If tdfNoDefaultRadioButton has not been included in AFlags, aRadioDef is used as the default radio button. When aRadioDef is unassigned (0), the first radio button is Checked. If tdfNoDefaultRadioButton has been included in AFlags, all radio buttons are unchecked by default on the dialog.

aDialogIcon and aFooterIcon are used to specify the icons displayed on the dialog form.

aWidth can be used to supply a custom form width (in pixels). When set to a value <= 0, the length of the text in Inst and Content are used to determine the width for the dialog form. When an emulated task dialog is used, the upper limit for the value is 480 pixels and the lower limit is 120 pixels.

aParent can be set to any HWND instance - by default, Application.DialogHandle.

If aNonNative is True, the Delphi emulation code will always be used.

aEmulateClassicStyle can be set to enforce conformity when using a non-themed user interface (classic) - see http://synopse.info/forum/viewtopic.php?pid=2867#p2867. This argument is set to True if the tfEmulateClassicStyle flag has been included in the Flags property for the TCustomTaskDialog. When enabled, the following visual changes are applied to the dialog:

aOnButtonClicked can be set to a callback routine executed when a button is clicked.

Version info

Modified in LCL version 2.2.6+ for native dialogs on the Windows platform. An explicit dialog width (in pixels) is converted to dialog base units for use in the TaskDialogIndirect Windows API.


Version 3.2 Generated 2024-02-25 Home