Un ejemplo completo tipo factura, saludos...
REDEFINE xBrowse oBrw ID 100 of oFldx:aDialogs[1] ;
HEADERS "TM", "REFERENCIA", "FECHA", "COD.BANCO", "DESCRIPCION", "CONCEPTO", "TE", "MONTO", "ORI" ;
COLUMNS 1, 2, 3, 4, 5, 6, 7, 8, 9 ;
COLSIZES 50, 100, 100, 100, 200, 120, 50, 100, 50 ;
JUSTIFY AL_CENTER, AL_LEFT, AL_CENTER, AL_LEFT, AL_LEFT, AL_LEFT, AL_CENTER, AL_RIGHT, AL_CENTER ;
PICTURES , "@!", , "@!", "@!", , , "@E 9,999,999.99" ;
ARRAY aItems FASTEDIT LINES
// CONFIGURACION DEL xBROWSE
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nColDividerStyle := LINESTYLE_BLACK
:nStretchCol := STRETCHCOL_LAST
:bRClicked := { || msginfo( "pulsastes boton derecho..." ) } // LLAMA MENU-POPUP CON BOTON DERECHO
:lColDividerComplete := .t.
:nHeaderHeight := 30 // ANCHO CABEZERA
:l2007 := .t.
:lFooter := .t.
:lRecordSelector := .t. // SI/NO 1RA.COL.IZQ.QUE TIENE LA FLECHITA NEGRA
:lAllowColHiding := .f. // SI/NO BOTON DERECHO SOBRE CABEZERA, MUESTRE ARRAY COL.
:lAllowColSwapping := .f. // SI/NO INTERCAMBIAR COL.
:bClrStd := {|| IF( oBrw:nArrayAt % 2 == 0, {CLR_BLACK, CLR_WHITE}, {0, RGB(203, 226, 254)} ) }
:bKeyDown := {| nKey | teclado( nKey, oBrw, aVar, aGet, oQryBancos ) } // CONTROLA VIRTUAL KEY
***:bPastEof := { || addrow( oBrw ) } // HACE EDICION DE CELDA AUTOMATICAMENTE CON FLECHA ABAJO...
END WITH
// COLOR GRADIANTE EN XBROWSE...
/*
oBrw:bClrGrad := { | lInvert | IF( ! lInvert, ;
{ { 0.710,8388608,16777215 }, ;
{ 0.710,16777215,8388608 } }, ;
{ { 0.710,8388608,16777215 }, ;
{ 0.710,16777215,8388608 } } ) }
*/
// COL.1 - TIPO MOVIMIENTO(TM)
WITH OBJECT oBrw:aCols[1] // TIPO MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 1] ) }
:cToolTip := "Tipo Movimiento Ingreso/Egreso"
:nEditType := EDIT_LISTBOX
:aEditListTxt := aTipoMovi
* :aEditListBound :=
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH
WITH OBJECT oBrw:aCols[2] // REFERENCIA
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 2] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH
WITH OBJECT oBrw:aCols[3] // FCH.MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 3] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH
WITH OBJECT oBrw:aCols[4] // CODIGO CTA.BANCO
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 4] ) }
:nEditType := EDIT_GET_BUTTON
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH .
WITH OBJECT oBrw:aCols[5] // DESCRIPCION MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 5] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH .
WITH OBJECT oBrw:aCols[6] // CONCEPTOS(3 marias + otros)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 6] ) }
:nEditType := EDIT_LISTBOX
:aEditListTxt := aConceptos
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) } // avar := oBrw:aArrayData[oBrw:nAt, Columna]
END WITH
WITH OBJECT oBrw:aCols[7] // Tipo Operacion(Ingreso/Egreso).(debe/haber)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 7] ) }
:cFooter := "Total->"
:cToolTip := "Tipo de Operacion"
:nEditType := EDIT_LISTBOX
:aEditListTxt := aTipoEI
*** :bEditWhen := {|| aItems[oBrw:nArrayAt, 1] == "I" } // ACTIVO SOLO SI ES Ingreso...
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH
// COL.8 - MONTO
WITH OBJECT oBrw:aCols[8]
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 8] ) }
:cEditPicture := "@E9,999,999.99"
:nFootStrAlign := AL_RIGHT
:lTotal := .t. // PARA TOTALIZAR COL.
:nTotal := 0 // PARA TOTALIZAR COL.
:nEditType := EDIT_GET
:bEditValid := { | oGet, oCol | mayorqcero( oGet:value() ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ,;
totalinea( oBrw, aVar, aGet ) ,;
graba_movbco( lNew, aVar, oDlg, oBrw, oQryBancos ) ,;
addrow( oBrw, oQryBancos, lNew ) ), ) }
:bEditWhen := {|| !EMPTY( aItems[oBrw:nArrayAt, 1] ) }
END WITH
WITH OBJECT oBrw:aCols[9] // ORIGEN DEL MOV.(cja,bco,vta,odp,com)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 9] ) }
:cToolTip := "Origen del Movimiento"
END WITH
oBrw:MakeTotals()
oBrw:Refresh()
Dios no está muerto...
Gracias a mi Dios ante todo!