FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Tree con xBrowse
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Tree con xBrowse
Posted: Wed Feb 03, 2021 07:55 PM

Amigos, generé un tree con xbrowse. Necesito seleccionar todos o alguno de los nodos. Para la selección utilizo ::aSelected que trae xBrowse, este me devuelve un array con las posiciones de los elementos seleccionados pero no encuentro la manera de recorrer el árbol de acuerdo a los valores devueltos de ::aSelected. Alguien podría echarme luz sobre esto. Desde ya muchas gracias.

Saludos

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Tree con xBrowse
Posted: Thu Feb 04, 2021 07:58 AM

Horacio,

Prueba esto:

oXBrowse:oTree:Scan( { | oItem | If( AScan( ::aSelected, oItem ) != 0, MsgInfo( oItem:cPrompt ),) } )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Tree con xBrowse
Posted: Thu Feb 04, 2021 12:01 PM
Gracias Antonio por tu respuesta pero me genera este error

Code (fw): Select all Collapse
 Path and name: C:\t-fe_familia\QBit-gestion.EXE (32 bits)
   Size: 6,646,784 bytes
   Compiler version: Harbour 3.2.0dev (r1601050904)
   FiveWin  version: FWH 17.01
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 10 secs 
   Error occurred at: 04/02/2021, 08:57:58
   Descripci¢n del error: Error BASE/1004  Message not found: TLINKLIST:SCAN
   Args:
     [   1] = O   TLINKLIST


Saludos
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Tree con xBrowse
Posted: Thu Feb 04, 2021 03:39 PM

aSelected contains record numbers.
aSelected and Tree do not go together. The record positions in a Tree are volatile (not fixed) and keep changing when tree nodes are opened and closed. aSelected works for datasource where the RecNo is fixed for each record.

This requires a different approach and that is not going to be so simple.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Tree con xBrowse
Posted: Thu Feb 04, 2021 04:48 PM

Gracias Rao por su respuesta. Ya hice otra implementación sin necesidad de buscar el el tree. Sería interesante poder implementar un selected para árboles. Nuevamente gracias.

Saludos

Continue the discussion