- Code: Select all Expand view
Function rep_tree1() // Funciona
Local oDlg, oTree, oImageList ,oBrush, taltu,tanch,tpmen,tmenu,t2007,oTipmod,oDatos
Local aContl[20]
if memvar->x_ms2007;t2007 :=.T.;else;t2007 := .F.;endif
tmepos := memvar->x_psmenu
if memvar->x_psmenu="0";taltu:=26;tanch:=27;tpmen:="TOP";endif
if memvar->x_psmenu="1";taltu:=26;tanch:=20;tpmen:="RIGHT";endif
if memvar->x_psmenu="2";taltu:=26;tanch:=20;tpmen:="LEFT";endif
if memvar->x_psmenu="3";taltu:=26;tanch:=27;tpmen:="BOTTOM";endif
if memvar->x_msperson;tmenu:=1;else;tmenu:=0;endif
aContl:={0,0," "," ",tmenu,0,1,385,35,t2007,tmepos,taltu,tanch,tpmen,0,memvar->x_tmotor,0,4,0,memvar->x_tfado,oTipmod}
// Sample suggested by Antonio Linares, and modified by Julio Llin s
DEFINE DIALOG oDlg RESOURCE "TREE"
// par_diag(oDtree,3,1,1) //(oDlgxx,nbrush,ncolor,ndisp) //ndisp no se esta usando
oImageList = TImageList():New()
oImageList:AddMasked( TBitmap():Define( "REG_SALIR",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "OK",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "REG_PRINTER",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "PRINTER",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "RPV",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "EXCEL",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "REG_BROW",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "REG_CANC",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "BOLVERD",, oDlg ), nRGB( 192, 192, 192 ) )
oImageList:AddMasked( TBitmap():Define( "BOLAMAR",, oDlg ), nRGB( 192, 192, 192 ) )
oTree := TTreeView():ReDefine( 100,oDlg,0,GetSysColor( 5 ), .T. ,"ll" )
oTree:bLDblClick := { | nRow, nCol, nKeyFlags | MyClick( nRow, nCol, oTree, oDlg,oDatos,aContl ) }
oTree:cToolTip := OemToAnsi( "Doble Click Para Ejecutar Proceso " )
// ACTIVATE DIALOG oDlg CENTERED ON INIT AddItems( oTree, oImageList )
ACTIVATE DIALOG oDlg ON INIT AddItems( oTree, oImageList,oDlg,oDatos,aContl )
Return NIL
// aArrayi 1=Si Es clase = C , 2= Nombre Programa, 3= Nombre Modulo para permisos , 4= Opcion para permiso
// 5= Nombre archivo Xls 6= Nombre Ventana Browser 7=Tipo Browser Eje 3 xbrowser 8= Menu Barra Browser
// 9= Trama Filas Browser, 10 = Fondo brower para imagenes, 11= Por definir, 12 = Ventana de condiciones para la consulta
********************************************************************************
Function AddItems( oTree, oImageList,oDlg ,oDatos,aContl )
********************************************************************************
local oItem01, oItem0, oItem1, oItem2, oItem3, oItem4, oItem5, oItem6, oItem7, oItem8, oItem9
local oItem1_1
local oItem11, oItem111, oItem12, oItem121, oItem13 , oItem131
local oItem21, oItem31 , oItem41, oItem51, oItem61, oItem71 , oItem81, oItem91, oItem101
oTree:SetImageList( oImageList )
oItem0 = oTree:Add( "Opciones",7)
oItem01 = oTree:Add( "Salir o Cerrar ",0);oItem01:Cargo:={"SALIR"}
oItem1 = oTree:Add( "Catalogos", 8 ) // "Cargo" set a Checkbox control
**
oItem1_1 = oItem1:Add( "Contable", 9)
oItem11 = oItem1_1:Add( "Representante de Ventas", 1)
oItem111 = oItem11:Add( "Reporte Windows", 2);oItem111:Cargo:={"C","PXP0009_1","PROG_VENDED",;
"R1","xls0009.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
oItem111 = oItem11:Add( "Reporte Dos", 3);oItem111:Cargo:={"C","PXP0009_1","PROG_VENDED",;
"R2","xls0009.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
oItem111 = oItem11:Add( "Reporte Excel", 5);oItem111:Cargo:={"C","PXP0009_1","PROG_VENDED",;
"R4","xls0009.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
oItem111 = oItem11:Add( "Consulta", 6);oItem111:Cargo:={"C","PXP0009_1","PROG_VENDED",;
"C0","xls0009.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
oItem11 = oItem1_1:Add( "Zonas de Ventas", 1)
oItem111 = oItem11:Add( "Reporte Windows", 2);oItem111:Cargo:={"C","PXP0008_1","PROG_ZONAV",;
"R1","xls0008.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
oItem111 = oItem11:Add( "Reporte Dos", 3);oItem111:Cargo:={"C","PXP0008_1","PROG_ZONAV",;
"R2","xls0008.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
oItem111 = oItem11:Add( "Reporte Excel", 5);oItem111:Cargo:={"C","PXP0008_1","PROG_ZONAV",;
"R4","xls0008.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
oItem111 = oItem11:Add( "Consulta", 6);oItem111:Cargo:={"C","PXP0008_1","PROG_ZONAV",;
"C0","xls0008.xls","BROW_LISTA",X_TIPBROW,"1",0," "," ",0}
ver imagen
http://img829.imageshack.us/img829/6826/treea.jpg