Code: Select all
// varias profundos
for i:=1 to vcolumnas+1
if i = 1
AADD(V_Header," ")
AADD(V_Colsize,50)
ELSE
AADD(V_Header,"Columna "+alltrim(transform(i-1,"999")))
AADD(V_Colsize,100)
endif
next i
vprompt:= '" 1 Profundidad"'
for i:=2 to vprofundo
vprompt:=vprompt+","+'"'+alltrim(transform(i,"999"))+' Profundidad"'
next i
vfolders:='"FOLDERS"'
FOR i:= 2 to vprofundo
vfolders:=vfolders+","+'"FOLDERS"'
next i
aData := Array( vprofundo )
aData[ 1 ] := Array( vfilas, vcolumnas+1 )
AEval( aData[ 1 ], { |a,k| a[ 1 ] := chr(( k )+64) } )
for i:= 2 to vcolumnas+1
AEval( aData[ 1 ], { |a,k| a[ i ] := space(10) } )
next i
AEval( aData, { |u,k| aData[ k ] := AClone( aData[ 1 ] ) }, 2 )
oBrw := Array( vprofundo )
area:=select()
cdestant := OpenDbf(fdestant,1, , , , kdestant,"DBFCDX")
(cdestant)->(DbSetOrder(1))
(cdestant)->(Dbgotop())
acdestan:=select()
dbseek(vestanteria)
do while !eof() .and. (cdestant)->estanteria = vestanteria
aData[(cdestant)->profundo][(cdestant)->fila,(cdestant)->columna+1]:= (cdestant)->articulo
dbskip()
enddo
(cdestant)->(Dbclosearea())
select(area)
DEFINE Dialog oDDATOS RESOURCE "FOLDER_VARIOS" TITLE "Estanteria : "+alltrim(vestanteria)+" -- "+alltrim(vdetallestanteria) OF oApp:aMod[20]:oWnd
REDEFINE get gvfcliente Var vfcliente ID 102 of oDDATOS when lsay
REDEFINE get gvfnombre Var vfnombre ID 103 of oDDATOS when lsay
REDEFINE get gvfarticulo Var vfarticulo ID 104 of oDDATOS when lsay
REDEFINE get gvfdetalle Var vfdetalle ID 105 of oDDATOS when lsay
REDEFINE get gvfcantidad Var vfcantidad ID 106 of oDDATOS when lsay
REDEFINE get gvfpaquetes Var vfpaquetes ID 107 of oDDATOS when lsay
REDEFINE get gvfcolumna Var vfcolumna ID 108 of oDDATOS when lsay
REDEFINE get gvffila Var vffila ID 109 of oDDATOS when lsay
REDEFINE get gvfprofundo Var vfprofundo ID 110 of oDDATOS when lsay
REDEFINE FOLDEREX oFld ID 101 OF oDDATOS UPDATE;
PROMPT &vprompt DIALOGS &vfolders ;
on change (refrescardatos(vestanteria,oBrw[oFld:nOption],oFld:nOption,vfilas))
FOR i:=1 to vprofundo
REDEFINE XBROWSE oBrw[i] ID 101 ;
HEADERS V_Header ;
SIZES V_ColSize ;
DATASOURCE aData[i] AUTOCOLS CELL LINES NOBORDER FASTEDIT of oFld:aDialogs[i]
WITH OBJECT oBrw[ i ]
:bRClicked:= {|| borrararticulo(aData,oBrw,oFld:nOption,vestanteria,vfilas,oFld) }
:bLDblClick := {|| buscararticulo(aData,oBrw,oFld:nOption,vestanteria) }
:bKeychar := {|nkey| iif(nkey=13 .and. oBrw[oFld:nOption]:nColSel > 1,buscararticulo(aData,oBrw,oFld:nOption,vestanteria),)}
:lColChangeNotify := .t.
:bChange := { |oBrw| refrescardatos(vestanteria,oBrw,oFld:nOption,vfilas)}
:nFreeze:=1
:lFullGrid := .t.
END
AEval(oBrw[ i ]:aCols, {|o| o:nDataStrAlign := AL_CENTER })
next i