como se la cantidad de items que tiene un tree?

como se la cantidad de items que tiene un tree?

Postby goosfancito » Sat Oct 25, 2008 1:33 am

Hola.
Como se la cantidad de items que posee un Tree, no las ramas sino el total de items que tiene en todas las ramas.

Gracias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Postby Antonio Linares » Sat Oct 25, 2008 9:43 am

Gustavo,

Len( oTreeView:aItems )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby goosfancito » Sat Oct 25, 2008 10:23 am

Antonio,
Si hago eso, me devuelve la cantidad de "padres" que tiene el arbol. pero no los hijos, yo necesito conocer la cantidad de hijos. si no existe lo hago de otra forma.

Gracias.
Antonio Linares wrote:Gustavo,

Len( oTreeView:aItems )
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Postby Antonio Linares » Sat Oct 25, 2008 10:29 am

Prueba esta función:
Code: Select all  Expand view
function TreeViewItems( oTreeView )

   local oItem, n, nItems := 0

   for n := 1 to Len( oTreeView:aItems )
       oItem = aItems[ n ]
       nItems++
       if Len( oItem:aItems ) != 0
          nItems += TreeViewItems( oItem )
       endif
   next

return nItems
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby goosfancito » Sat Oct 25, 2008 10:34 am

Amigo,

Justo eso estube haciendo pero pense que habia una forma directa.

GRacias.

Antonio Linares wrote:Prueba esta función:

Code: Select all  Expand view
function TreeViewItems( oTreeView )

   local oItem, n, nItems := 0

   for n := 1 to Len( oTreeView:aItems )
       oItem = aItems[ n ]
       nItems++
       if Len( oItem:aItems ) != 0
          nItems += TreeViewItems( oItem )
       endif
   next

return nItems
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 151 guests