Sign in Join
Wiki copytemporary

Revision 1 of 1, by Trev on 3-2-2020. The page as it is now.

TTaskDialog/fr

TTaskDialog est un composant non visuel, qui montre des boîtes de dialogue complètes à l'exécution, avec des fonctionnalités riches comme a l'API TaskDialog de Windows. . Il est disponible depuis Lazarus 1.8.

La boîte de dialogue est affichée avec la méthode Execute(), et quand elle retourne True, la propriété ModalResult contient l'Id du bouton pressé :

Aussi, la propriété RadioButton a l'objet radio-button qui a été cliqué.

Exemple

Cette exemple montre comment créer la boîte de dialogue à l'exécution, et ajoute des boutons personnalisé à l'exécution :

pascal
  with TTaskDialog.Create(self) do
    try
      Title := 'Confirm removal';
      Caption := 'Confirm';
      Text := 'Remove selected item?';
      CommonButtons := [];
      with TTaskDialogButtonItem(Buttons.Add) do
      begin
        Caption := 'Remove';
        ModalResult := mrYes;
      end;
      with TTaskDialogButtonItem(Buttons.Add) do
      begin
        Caption := 'Keep';
        ModalResult := mrNo;
      end;
      MainIcon := tdiQuestion;
      if Execute then
        if ModalResult = mrYes then
          ShowMessage('Item removed');
    finally
      Free;
    end

From the Free Pascal wiki, page "TTaskDialog/fr", as it stood on 2020-03-02 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.