Unit 'LCLTaskDialog' Package
[Overview][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TTaskDialog

Declaration

Source position: lcltaskdialog.pas line 254

type TTaskDialog = record

public

  Title: string;

  

  Inst: string;

  

  Content: string;

  

  Buttons: string;

  

  Radios: string;

  

  Info: string;

  

  InfoExpanded: string;

  

  InfoCollapse: string;

  

  Footer: string;

  

  Verify: string;

  

  Selection: string;

  

  Query: string;

  

  RadioRes: Integer;

  

  SelectionRes: Integer;

  

  VerifyChecked: Boolean;

  

  Dialog: TTaskDialogImplementation;

  

  function Execute();

  

  procedure SetElementText();

  

end;

Description

Implements a TaskDialog. Uses the new TaskDialog API under Vista/Seven, and emulate it with pure Pascal code and standard themed components under XP or 2K. 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/VerifyChecked will be used to reflect the state after dialog execution.

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;