|
|
|
|
|
- TreeAdd function: Add an element at any position
- Code samples
- TreeInsert function: Insert an element at a specific position
- Code example
How to fill a TreeView control?
A TreeView control is used to represent data hierarchically (on several levels). For example, a TreeView control can represent products groupd by Family then Sub-family. To populate a TreeView control programmatically, you must use: TreeAdd function: Add an element at any position TreeAdd is used to add an element into a TreeView control. An element is made of: - Root: represents the first level of the element
- Branch(es): represents the intermediate level(s)
- Sheet: represents the data to be sorted
An element is represented in the following format: Racine + TAB + Branche 1 + TAB + Branche 2 + TAB + ... + TAB + Feuille The syntax of TreeAdd is as follows: ArbreAjoute(<Nom Arbre>, <élément>, <image enroulée>, <image déroulée>, <identifiant>) For more details, see the help page on the TreeAdd function. Code samples - Fill through programming:
TreeAdd(ARBRE_Ville, "France")
TreeAdd(ARBRE_Ville, "Italie")
TreeAdd(ARBRE_Ville, "France" + TAB + "Paris")
TreeAdd(ARBRE_Ville, "France" + TAB + "Marseille")
TreeAdd(ARBRE_Ville, "France" + TAB + "Lyon")
TreeAdd(ARBRE_Ville, "France" + TAB + "Montpellier")
TreeAdd(ARBRE_Ville, "Italie" + TAB + "Rome")
TreeAdd(ARBRE_Ville, "Italie" + TAB + "Pise")
TreeAdd(ARBRE_Ville, "Italie" + TAB + "Milan")
TreeAdd(ARBRE_Ville, "Espagne" + TAB + "Barcelone")
TreeAdd(ARBRE_Ville, "Espagne" + TAB + "Madrid")
TreeAdd(ARBRE_Ville, "Espagne" + TAB + "Valence")
- Fill from a data file:
FOR EACH Famille
TreeAdd(ARBRE_Produits, Famille.libellé)
FOR EACH SousFam where IDFamille = Famille.IdFamille
TreeAdd(ARBRE_Produits, Famille.libellé + TAB + SousFam.libellé)
FOR EACH PRODUIT where IdSousFam = SousFam.IdSousFam
TreeAdd(ARBRE_Produits,
Famille.libellé + TAB + SousFam.libellé + TAB + PRODUIT.LibProd)
END
END
END
TreeInsert function: Insert an element at a specific position TreeInsert is used to insert a leaf in relation to another leaf (brother leaf). ArbreInsère(<Nom Arbre>, <Feuille frère>, <Nouvelle feuille>, <Image enroulée>, <Image déroulée>, <Identifiant>) For more details, see the help page on the TreeInsert function. Code example TreeAdd(ARBRE_Ville, "France")
TreeAdd(ARBRE_Ville, "Italie")
TreeAdd(ARBRE_Ville, "France" + TAB + "Paris")
TreeAdd(ARBRE_Ville, "France" + TAB + "Marseille")
TreeAdd(ARBRE_Ville, "France" + TAB + "Lyon")
TreeInsert(ARBRE_Ville, "France" + TAB + "Lyon", "Montpellier")
TreeInsert(ARBRE_Ville, "France" + TAB + "Lyon", "Bordeaux")
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|