TTaskDialog/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TTaskDialog/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | **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. | |
| 2 | + | ||
| 3 | + |  | |
| 4 | + | ||
| 5 | + | 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é : | |
| 6 | + | ||
| 7 | + | - id de bouton standard (OK, Cancel, Yes etc) | |
| 8 | + | - id de bouron personnalisé, qui est spécifié dans la propriété ModalResult de chaque bouton. | |
| 9 | + | ||
| 10 | + | Aussi, la propriété RadioButton a l'objet radio-button qui a été cliqué. | |
| 11 | + | ||
| 12 | + | # Exemple | |
| 13 | + | ||
| 14 | + | Cette exemple montre comment créer la boîte de dialogue à l'exécution, et ajoute des boutons personnalisé à l'exécution : | |
| 15 | + | ||
| 16 | + | ``` pascal | |
| 17 | + | with TTaskDialog.Create(self) do | |
| 18 | + | try | |
| 19 | + | Title := 'Confirm removal'; | |
| 20 | + | Caption := 'Confirm'; | |
| 21 | + | Text := 'Remove selected item?'; | |
| 22 | + | CommonButtons := []; | |
| 23 | + | with TTaskDialogButtonItem(Buttons.Add) do | |
| 24 | + | begin | |
| 25 | + | Caption := 'Remove'; | |
| 26 | + | ModalResult := mrYes; | |
| 27 | + | end; | |
| 28 | + | with TTaskDialogButtonItem(Buttons.Add) do | |
| 29 | + | begin | |
| 30 | + | Caption := 'Keep'; | |
| 31 | + | ModalResult := mrNo; | |
| 32 | + | end; | |
| 33 | + | MainIcon := tdiQuestion; | |
| 34 | + | if Execute then | |
| 35 | + | if ModalResult = mrYes then | |
| 36 | + | ShowMessage('Item removed'); | |
| 37 | + | finally | |
| 38 | + | Free; | |
| 39 | + | end | |
| 40 | + | ``` | |
| 41 | + | ||
| 42 | + | --- | |
| 43 | + | *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](/wiki-contact).* |
