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

TTaskDialog

Implements a task dialog.

Declaration

Source position: lcltaskdialog.pas line 254

type TTaskDialog = record

public

  Title: string;

  

The main title for the task dialog window.

  Inst: string;

  

The main instruction displayed on the dialog.

  Content: string;

  

The text displayed as the primary content for the dialog.

  Buttons: string;

  

Delimited list of captions for the custom buttons displayed on the dialog.

  Radios: string;

  

Delimited list of captions for radio buttons on the dialog.

  Info: string;

  

The text for the expandable information content.

  InfoExpanded: string;

  

The button caption to be displayed when the information is expanded.

  InfoCollapse: string;

  

The button caption to be displayed when the information is collapsed.

  Footer: string;

  

The text content displayed in the footer area for the dialog.

  Verify: string;

  

The verification text for the optional check box at the bottom of the dialog.

  Selection: string;

  

A delimited list of items which can be selected in the dialog.

  Query: string;

  

Input query which can be edited on the dialog.

  RadioRes: Integer;

  

The selected radio button on the dialog.

  SelectionRes: Integer;

  

The currently selected item in the selection list or combo-box.

  VerifyChecked: LongBool;

  

Checked state for the verification check box.

  Dialog: TTaskDialogImplementation;

  

Provides access to the task dialog implementation.

  function Execute();

  

Launches the task dialog form.

  procedure SetElementText();

  

Sets the value for the specified visual element on the dialog.

end;

Description

Uses the new TaskDialog API under Vista/Seven, and emulates it with Pascal/LCL code and standard themed components under XP or Windows 2000. Creating a TTaskDialog object/record on the stack will initialize all of its string parameters to ''. Set the appropriate string parameters, then call Execute() with all additional parameters.

RadioRes, SelectionRes, and VerifyChecked will be used to reflect the state after execution of the dialog.

Typical usage:

var Task: TTaskDialog;
begin
  Task.Inst := 'Saving application settings';
  Task.Content := 'This is the content';
  Task.Radios := 'Store settings in registry' +#10+ ' Store settings in XML file';
  Task.Verify := 'Do no ask for this setting next time';
  Task.VerifyChecked := true;
  Task.Footer := 'XML file is perhaps a better choice';
  Task.Execute([],0,[],tiQuestion,tfiInformation,200);
  ShowMessage(IntToStr(Task.RadioRes)); // 200=Registry, 201=XML
  if Task.VerifyChecked then
  ShowMessage(Task.Verify);
end;

Version 3.2 Generated 2024-02-25 Home