Aide:ControlTreeView.txt
De Wiki AutoIt Français
Document original V3.3.6.1 :
###Function###
ControlTreeView
###Description###
Sends a command to a TreeView32 control.
###Syntax###
ControlTreeView ( "title", "text", controlID, "command" [, option1 [, option2]] )
###Parameters###
@@ParamTable@@
title
The title of the window to access.
text
The text of the window to access.
controlID
The control to interact with. See <a href="../intro/controls.htm">Controls</a>.
command
The command to send to the control (see below).
option1
[optional] Additional parameter required by some commands.
option2
[optional] Additional parameter required by some commands.
@@End@@
###ReturnValue###
Depends on command as table below shows. In case of an error (such as an invalid command or window/control could not be found) then @error is set to 1.
<br>
@@ControlCommandTable@@
<b>Command, Option1, Option2</b>
<b>Operation</b>
"Check", "item"
Checks an item (if the item supports it).
"Collapse", "item"
Collapses an item to hide its children.
"Exists", "item"
Returns 1 if an item exists, otherwise 0.
"Expand", "item"
Expands an item to show its children.
"GetItemCount", "item"
Returns the number of children for a selected item.
"GetSelected" [, UseIndex]
Returns the item reference of the current selection using the text reference of the item (or index reference if UseIndex is set to 1).
"GetText", "item"
Returns the text of an item.
"IsChecked"
Returns the state of an item. 1:checked, 0:unchecked, -1:not a checkbox.
"Select", "item"
Selects an item.
"Uncheck", "item"
Unchecks an item (if the item supports it).
@@End@@
<br>
The "item" parameter is a string-based parameter that is used to reference a particular treeview item using a combination of text and indices. Indices are 0-based. For example:
<br>Heading1
----> H1SubItem1
----> H1SubItem2
----> H1SubItem3
----> ----> H1S1SubItem1
Heading2
Heading3
<br>Each "level" is separated by |. An index is preceded with #. Examples:
<br>
@@StandardTable1@@
<b>Item</b> <b>Item Reference</b>
Heading2 "Heading2" or "#1"
H1SubItem2 "Heading1|H1SubItem2" or "#0|#1"
H1S1SubItem1 "Heading1|H1SubItem3|H1S1SubItem1" or "#0|#2|#0"
@@End@@
<br>
References can also be mixed like "Heading1|#1".
###Remarks###
As AutoIt is a 32-bit application some commands are not available when referencing a 64-bit application as Explorer when running on 64-bit Windows.
###Related###
ControlCommand
###Example###
@@IncludeExample@@
Document traduit V3.3.6.1 :
###Function###
ControlTreeView
###Description###
Envoi une commande à un contrôle de type TreeView32.
###Syntax###
ControlTreeView ( "title", "text", controlID, "command" [, option1 [, option2]] )
###Parameters###
@@ParamTable@@
title
Le titre de la fenêtre à atteindre.
text
Le texte de la fenêtre à atteindre.
controlID
Le contrôle avec lequel interagir. Voir <a href="../intro/controls.htm">Controls</a>.
command
La commande à envoyer au contrôle (voir ci-dessous).
option1
[optionnel] Paramètre additionnel requis par certaines commandes.
option2
[optionnel] Paramètre additionnel requis par certaines commandes.
@@End@@
###ReturnValue###
Dépend de la commande tel que montré dans le tableau ci-dessous. En cas d'erreur (telle qu'une commande ou fenêtre/contrôle invalide), @error est mis à 1.
<br>
@@ControlCommandTable@@
<b>Commande, Option1, Option2</b>
<b>Opération</b>
"Check", "item"
Coche un élément (si celui-ci le permet).
"Collapse", "item"
Replie un élément pour cacher ses sous-éléments.
"Exists", "item"
Retourne 1 si un élément existe, sinon 0.
"Expand", "item"
Déploie un élément pour montrer ses sous-éléments.
"GetItemCount", "item"
Retourne le nombre de sous-éléments pour un élément sélectionné.
"GetSelected" [, UseIndex]
Retourne la référence de l'élément de la sélection en cours, par la référence de son texte (ou par son index si UseIndex est mis à 1).
"GetText", "item"
Retourne le texte d'un élément.
"IsChecked"
Retourne l'état d'un élément. 1=coché, 0=décoché, -1=n'est pas de type CheckBox.
"Select", "item"
Sélectionne un élément.
"Uncheck", "item"
Décoche un élément (si celui-ci le permet).
@@End@@
<br>
Le paramètre "item" est un paramètre basée sur une chaîne qui est utilisé pour référencer un élément spécifique de l'arbre par une combinaison de texte et d'indices. Les indices sont indexés à partir de 0. Par exemple:
<br>Heading1
----> H1SubItem1
----> H1SubItem2
----> H1SubItem3
----> ----> H1S1SubItem1
Heading2
Heading3
<br>Chaque "niveau" est séparé par le caractère "|". Et chaque index est précédé du caractère "#". Exemples:
<br>
@@StandardTable1@@
<b>Élément</b> <b>Référence d'élément</b>
Heading2 "Heading2" ou "#1"
H1SubItem2 "Heading1|H1SubItem2" ou "#0|#1"
H1S1SubItem1 "Heading1|H1SubItem3|H1S1SubItem1" ou "#0|#2|#0"
@@End@@
<br>
Les références peuvent aussi être mixées tel que "Heading1|#1".
###Remarks###
Puisque AutoIt est une application 32-bits, certaines commandes ne sont pas disponibles sur une application 64-bits comme l'Explorateur Windows, sur un système d'exploitation 64-bits.
###Related###
<a href="ControlCommand.htm">ControlCommand</a>
###Example###
@@IncludeExample@@
Traducteur : ZDS
Contributeurs (pour les modifications avant le Wiki) : Tlem