In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Como cargae un oTreeView

Foro público de Xailer en español
Responder
Guillermo Guevara Car
Mensajes: 176
Registrado: Sab Ene 19, 2008 5:52 pm

Como cargae un oTreeView

Mensaje por Guillermo Guevara Car »

Saludos al foro
Alguien me podría informar como cargar al array (aItems de oTreeView), las
opciones definidas como array de (aItems de oMenú).
--
Ing. Guillermo Guevara Carrillo
Grupo Computación 2000
Nuevo Mundo Nº 2821-1
Jardines de la Cruz
Guadalajara, Jal. C.P. 44950
(33) 1075-8363 / 1078-8364
www.PvWin.com
soporte@PvWin.com
Bingen Ugaldebere
Mensajes: 1310
Registrado: Mié Sep 26, 2007 7:12 pm

Como cargae un oTreeView

Mensaje por Bingen Ugaldebere »

Así­ lo hago yo espero que te sirva y si no pregunta.
/*
* Proyecto: TreeED
* Fichero: tTreeview.prg
* Descripción: Montar un Tree desde un array
* {Nivel, texto a mostrar, lNegrita, handle, documento a editar, nIcono}
* Autor: Bingen Ugaldebere
* Fecha: 03/07/2006
*/
#include "Xailer.ch"
CLASS TTreeView FROM XTreeView
METHOD CreateFromArray( aArray )
ENDCLASS
METHOD CreateFromArray( aArray ) CLASS TTreeView
Local oItem, Root, NivelAnterior := 0
Local n,m
oItem := ::InsertItem( aArray[1,2] )
Root := oItem
aArray[1,4] := oItem:Handle
oItem:lBold := aArray[1,3]
oItem:nImage := aArray[1,6]
FOR n := 2 To Len( aArray )
FOR m := 1 TO Max( NivelAnterior + 1 - aArray[n,1], 0 )
oItem := oItem:oParent
NEXT
::SelectItem( oItem )
oItem := ::GetSelectedItem():InsertItem( aArray[n,2] )
aArray[n,4] := oItem:handle
oItem:lBold := aArray[n,3]
oItem:nImage := aArray[n,6]
NivelAnterior := aArray[n,1]
NEXT
RETURN Nil
****** CONTAR UN CARACTER DENTRO DE UNA CADENA ******
FUNCTION COUNTSTR(cCHAR,cSTR)
Local nC:=0,nL:=0
For nL:=1 TO LEN(cSTR)
IF(SUBSTR(cSTR,nL,1)=cCHAR,++nC,)
NEXT
Return nC
Guillermo Guevara Car
Mensajes: 176
Registrado: Sab Ene 19, 2008 5:52 pm

Como cargae un oTreeView

Mensaje por Guillermo Guevara Car »

Bingen:
Muchas gracias me ayudo mucho tu apoyo.
--
Ing. Guillermo Guevara Carrillo
Grupo Computación 2000
Nuevo Mundo Nº 2821-1
Jardines de la Cruz
Guadalajara, Jal. C.P. 44950
(33) 1075-8363 / 1078-8364
www.PvWin.com
soporte@PvWin.com
"Bingen Ugaldebere" <bingen@muninser.com> escribió en el mensaje
news:47d55c89$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Así lo hago yo espero que te sirva y si no pregunta.
>
> /*
> * Proyecto: TreeED
> * Fichero: tTreeview.prg
> * Descripción: Montar un Tree desde un array
> * {Nivel, texto a mostrar, lNegrita, handle, documento a editar, nIcono}
> * Autor: Bingen Ugaldebere
> * Fecha: 03/07/2006
> */
>
> #include "Xailer.ch"
> CLASS TTreeView FROM XTreeView
>
> METHOD CreateFromArray( aArray )
>
> ENDCLASS
>
> METHOD CreateFromArray( aArray ) CLASS TTreeView
> Local oItem, Root, NivelAnterior := 0
> Local n,m
>
> oItem := ::InsertItem( aArray[1,2] )
> Root := oItem
> aArray[1,4] := oItem:Handle
> oItem:lBold := aArray[1,3]
> oItem:nImage := aArray[1,6]
>
> FOR n := 2 To Len( aArray )
> FOR m := 1 TO Max( NivelAnterior + 1 - aArray[n,1], 0 )
> oItem := oItem:oParent
> NEXT
> ::SelectItem( oItem )
> oItem := ::GetSelectedItem():InsertItem( aArray[n,2] )
> aArray[n,4] := oItem:handle
> oItem:lBold := aArray[n,3]
> oItem:nImage := aArray[n,6]
> NivelAnterior := aArray[n,1]
> NEXT
>
> RETURN Nil
>
> ****** CONTAR UN CARACTER DENTRO DE UNA CADENA ******
> FUNCTION COUNTSTR(cCHAR,cSTR)
> Local nC:=0,nL:=0
>
> For nL:=1 TO LEN(cSTR)
> IF(SUBSTR(cSTR,nL,1)=cCHAR,++nC,)
> NEXT
>
> Return nC
Responder