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

TTaskDialog

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Creates a configurable, modal task dialog at run-time.

Declaration

Source position: dialogs.pp line 670

type TTaskDialog = class(TCustomTaskDialog)

published

  property Buttons: TTaskDialogButtons;

  

Collection with the buttons for the Task dialog.

  property Caption: TTranslateString;

  

Caption text displayed on the title bar for the Task dialog.

  property CommonButtons: TTaskDialogCommonButtons;

  

Set of common buttons displayed on the Task dialog.

  property DefaultButton: TTaskDialogCommonButton;

  

Index of the default button, from the set in the CommonButtons property.

  property ExpandButtonCaption: TTranslateString;

  

Caption displayed for the expand/collapse button on the dialog.

  property ExpandedText: TTranslateString;

  

Text that is displayed in the expandable / collapsible area on the Task dialog.

  property Flags: TTaskDialogFlags;

  

Set of options enabled for the Task dialog.

  property FooterIcon: TTaskDialogIcon;

  

Icon for the footer area displayed at the bottom of the dialog.

  property FooterText: TTranslateString;

  

Text that is displayed in the footer area on the Task dialog.

  property MainIcon: TTaskDialogIcon;

  

Icon displayed beside the Title for the dialog.

  property RadioButtons: TTaskDialogButtons;

  

Collection with the optional radio buttons defined for the Task dialog.

  property Text: TTranslateString;

  

Text displayed as main content for the Task dialog.

  property Title: TTranslateString;

  

Header text displayed at the top of dialog, with a larger font size and using a bold font style.

  property VerificationText: TTranslateString;

  

Optional caption text for the check box displayed at the bottom of the Task dialog.

  property Width: Integer;

  

Sets the width in pixels for the task dialog form.

  property OnButtonClicked: TTaskDlgClickEvent;

  

Event handler signalled for the button clicked when the Task dialog was executed.

end;

Inheritance

TTaskDialog

  

Creates a configurable, modal task dialog at run-time.

|

TCustomTaskDialog

  

Defines a configurable, modal task dialog at run-time.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

A non-visual component which creates modal dialogs at run-time, with rich UI elements. Like the Windows TaskDialog API. For example:

Using TTaskDialog at Run-time.

procedure TForm1.Button1Click(Sender: TObject);
  var ATaskDialog: TTaskDialog; // requires Dialogs in uses clause
begin
  ATaskDialog := TTaskDialog.Create(Self);
  with ATaskDialog do
  begin
     Caption := 'Let''s do this...';
     MainIcon := tdiShield;
     Title := 'Task Title';

    Text := 'This tells the user the purpose for the dialog. ' +
      'Please read and accept the ' +
      '<a href="https://www.acme.org/tos.html">Terms of Service</a>. '+#10+#10+
      'Some users prefer a little conversation before they will agree. ' +
      'Along with a progress bar. Please tell us your level of interest.';

    RadioButtons.Clear;
    RadioButtons.Add.Caption := 'Low';
    RadioButtons.Add.Caption := 'Medium';
    RadioButtons.Add.Caption := 'High';

    CommonButtons := [tcbOk,tcbCancel,tcbRetry];

    ExpandedText := 'The Terms of Service grants a waiver of responsibility to ' +
      'Acme Corporation LLC (the Corporation) for any insane acts a Coyote ' +
      'might perform using products or services provided by the Corporation. '+#10+#10+
      'There is no legal venue where the Corporation is responsible. ' +
      'Especially Albuquerque, NM USA. ' +#10+#10+
      'Buyer beware. All rights reserved. Shipping fees and taxes may apply.';

    VerificationText := 'I agree to everything.';

    FooterIcon := tdiWarning;
    FooterText := 'This is your <a href="#terminus">final</a> warning.';

    Flags := [tfEnableHyperlinks, tfAllowDialogCancellation, tfExpandFooterArea, tfExpandedByDefault, tfVerificationFlagChecked, tfShowMarqueeProgressBar];

    if Execute then ; // do something with the ModalResult
    Free;
  end;
end;

Version 3.2 Generated 2024-02-25 Home