with the next sample we can see 2 xbrowse's bug
1.- total footer, edit the C or D column and you can see the error in total, this not happen with the column E
2.- When we edit, the focus go to the last row
Code: Select all
#include "FiveWin.ch"
#include "xbrowse.ch"
function Main()
local oDlg, oBrw, aData := {{1,"DATO1",1,2,2},{2,"DATO2",2,2,4},{3,"DATO3",3,2,6},{4,"DATO4",4,2,8}}
DEFINE DIALOG oDlg SIZE 300, 200
@ 0, 0 XBROWSE oBrw OF oDlg ARRAY aData ;
PICTUREs "9","@!","999.99","999.99","999,999.99";
AUTOCOLS ;
CELL ;
FASTEDIT ;
FOOTERS
oBrw:l2007 := .T.
oBrw:bClrSel := {|| { CLR_WHITE, CLR_HBLUE }}
oBrw:bClrRowFocus := {|| { CLR_BLACK, RGB(185,220,255) } }
oBrw:bClrSelFocus := {|| { CLR_BLUE, RGB(255,255,153) } }
oBrw:lExcelCellWise := .T.
oBrw:lExitGetOnTypeOut := .T.
oBrw:aCols[3]:nFooterType := AGGR_TOTAL
oBrw:aCols[3]:nFootStrAlign:= 1
oBrw:aCols[3]:nEditType := EDIT_GET
oBrw:aCols[3]:bOnPostEdit := {|o, v, n| aData[ oBrw:nArrayAt,3] := v,;
aData[ oBrw:nArrayAt,5] := aData[ oBrw:nArrayAt,4 ] * v , ;
oBrw:MakeTotals(), oBrw:refresh() }
oBrw:aCols[4]:nFooterType := AGGR_TOTAL
oBrw:aCols[4]:nFootStrAlign:= 1
oBrw:aCols[4]:nEditType := EDIT_GET
oBrw:aCols[4]:bOnPostEdit := {|o, v, n| aData[ oBrw:nArrayAt,4] := v,;
aData[ oBrw:nArrayAt,5] := aData[ oBrw:nArrayAt,3 ] * v , ;
oBrw:MakeTotals(), oBrw:refresh() }
oBrw:aCols[5]:nFooterType := AGGR_TOTAL
oBrw:aCols[5]:nFootStrAlign:= 1
oBrw:CreateFromCode()
oBrw:MakeTotals()
ACTIVATE DIALOG oDlg CENTER ON INIT ( oDlg:oClient := oBrw, oDlg:Resize() )
return nil
Regards
Marcelo Vía