by jbrita » Mon Jul 09, 2012 4:42 pm
amigo prueba asi:
oBrw:=TXBrowse():New()
oBrw:CreateFromResource( 400 )
oBrw:SetArray( aDatos )
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK // RGB(190,215,190)
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:lFastEdit := .T.
oBrw:bClrStd := {|| IIf(aDatos[oBrw:nArrayAt,10]#0,{CLR_BLACK,RGB(231,226,141)},IF( oBrw:nArrayAt%2==0,{CLR_BLACK,RGB(193,221,255)},{CLR_BLACK,RGB(221,245,255)} ) ) }
oBrw:nFreeze := 8
oBrw:nHeaderHeight := 30
oBrw:bClrHeader := {|| { nRGB(140, 0, 0), nRGB(229,0,0) } } // VERDECITO
oBrw:lHScroll := .f.
oBrw:lVScroll := .F.
oBrw:aCols[1]:cHeader := 'Codigo'
oBrw:aCols[1]:cEditPicture := '!!!!!!!!!!!!!'
oBrw:aCols[1]:bClrEdit := oBrw:bClrStd
oBrw:aCols[1]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN,"",),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nEditType := EDIT_GET_BUTTON
oBrw:aCols[1]:bEditValid := { | oGet, oCol | BuscarProd( oGet,oCol,oBrw,aDatos,oDlg1 ) }
oBrw:aCols[1]:bEditBlock := {|| LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nDataStrAlign:= AL_LEFT
oBrw:aCols[1]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[1]:bF2 := {|| LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:nWidth := 100
oBrw:aCols[1]:bLClickHeader:= {|r,c,f,o|LeerCodigo(oDlg1,oBrw,aDatos),oBrw:GoRight(),oBrw:GoRight() }
oBrw:aCols[1]:oHeaderFont := oFnt
oBrw:aCols[1]:bEditWhen := { || IF(Len(aGuias)=0,.T.,.F.) }
oBrw:aCols[2]:cHeader := 'Description'
oBrw:aCols[2]:bClrEdit := oBrw:bClrStd
oBrw:aCols[2]:nWidth := 295
oBrw:aCols[2]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[2]:oHeaderFont := oFnt
oBrw:aCols[3]:cHeader := 'Cantidad'
oBrw:aCols[3]:cEditPicture := '@k 9999.99'
oBrw:aCols[3]:bClrEdit := oBrw:bClrStd
oBrw:aCols[3]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aDatos[ oBrw:nArrayAt,3] := xVal,),oBrw:GoRight() }
oBrw:aCols[3]:nEditType := EDIT_GET
oBrw:aCols[3]:bEditValid := { | oGet, oCol | Valida( oGet, oCol ) }
oBrw:aCols[3]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[3]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[3]:nWidth := 70
oBrw:aCols[3]:bEditWhen := { || IF(Len(aGuias)=0,.T.,.F.) }
oBrw:aCols[3]:oHeaderFont := oFnt
oBrw:aCols[4]:cHeader := 'Precio'
oBrw:aCols[4]:cEditPicture := '@k 99,999,999.99' //:GoDown()
oBrw:aCols[4]:bClrEdit := oBrw:bClrStd
oBrw:aCols[4]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aDatos[ oBrw:nArrayAt,4] := xVal,),oBrw:GoRight() }
oBrw:aCols[4]:nEditType := EDIT_GET
oBrw:aCols[4]:bEditValid := { | oGet, oCol | If (oGet:Value()#0,CalculaTotal(oDlg1,oBrw,aDatos,TotVal), Valida( oGet, oCol )) }
oBrw:aCols[4]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[4]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[4]:nWidth := 70
oBrw:aCols[4]:oHeaderFont := oFnt
oBrw:aCols[4]:bEditWhen := { || IF(Len(aGuias)=0,.T.,.F.) }
oBrw:aCols[5]:cHeader := 'Dsto1'
oBrw:aCols[5]:cEditPicture := '@k 99.99'
oBrw:aCols[5]:bClrEdit := oBrw:bClrStd
oBrw:aCols[5]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aDatos[ oBrw:nArrayAt,5] := xVal,),oBrw:GoRight() }
oBrw:aCols[5]:nEditType := EDIT_GET
oBrw:aCols[5]:bEditValid := { | oGet, oCol | CalculaTotal(oDlg1,oBrw,aDatos,TotVal) }
oBrw:aCols[5]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[5]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[5]:nWidth := 38
oBrw:aCols[5]:oHeaderFont := oFnt
oBrw:aCols[6]:cHeader := 'Dsto2'
oBrw:aCols[6]:cEditPicture := '@k 99.99'
oBrw:aCols[6]:bClrEdit := oBrw:bClrStd
oBrw:aCols[6]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aDatos[ oBrw:nArrayAt,6] := xVal,),oBrw:GoRight() }
oBrw:aCols[6]:nEditType := EDIT_GET
oBrw:aCols[6]:bEditValid := { | oGet, oCol | CalculaTotal(oDlg1,oBrw,aDatos,TotVal) }
oBrw:aCols[6]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[6]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[6]:nWidth := 38
oBrw:aCols[6]:oHeaderFont := oFnt
oBrw:aCols[7]:cHeader := 'Dsto3'
oBrw:aCols[7]:cEditPicture := '@k 99.99'
oBrw:aCols[7]:bClrEdit := oBrw:bClrStd
oBrw:aCols[7]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, aDatos[ oBrw:nArrayAt,7] := xVal,),oBrw:GoDown(),oBrw:GoLeftMost() }
oBrw:aCols[7]:nEditType := EDIT_GET
oBrw:aCols[7]:bEditValid := { | oGet, oCol | CalTotal(oDlg1,oBrw,aDatos,TotVal,oGet) }
oBrw:aCols[7]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[7]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[7]:nWidth := 38
oBrw:aCols[7]:oHeaderFont := oFnt
oBrw:aCols[8]:cHeader := 'Total'
oBrw:aCols[8]:cEditPicture := '@k 999,999,999' //:GoDown()
oBrw:aCols[8]:nDataStrAlign:= AL_RIGHT
oBrw:aCols[8]:nHeadStrAlign:= AL_CENTER
oBrw:aCols[8]:nWidth := 70
oBrw:aCols[8]:oHeaderFont := oFnt
oDlg1:oClient := oBrw
Saludos