I have a problem with GET dialog and XBROWSE (as example)
When I leave the field First , I'd like the data in the browse udated .
This works if I switch from First to Last
But when I switch from First to browse the update is on the wrong row because the pointer has already changed.
Regards Maurizio
www.nipeservice.com
- Code: Select all Expand view RUN
- #include "FiveWin.Ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function main()
local aData, oDlg, oBrw, cFirst := '',cLast :='' ,oGet,oGet1
USE CUSTOMER NEW VIA "DBFCDX"
aData := FW_DbfToArray("FIRST, LAST")
CLOSE DATA
cFirst := aData[1,1]
cLast := aData[1,2]
DEFINE DIALOG oDlg SIZE 800,400 PIXEL
@ 10,10 SAY 'Firs' OF oDlg update PIXEL
@ 10,60 get oGet Var cFirst OF oDlg update PIXEL SIZE 100,15
oGet:bLostFocus :=<|o|
Local n := oBrw:nArrayAt
Local uOldVal := oGet:cText
aData[n,1] := uOldVal
oBrw:RefreshCurrent()
Return nil
>
@ 10,200 SAY 'Last' OF oDlg update PIXEL
@ 10,260 get oGet1 Var cLast OF oDlg update PIXEL SIZE 100,15
@ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE aData AUTOCOLS ;
HEADERS "FIRST", "LAST" CELL LINES NOBORDER
WITH OBJECT oBrw
:CreateFromCode()
:bChange := <||
cFirst := aData[oBrw:nArrayAt,1]
cLast := aData[oBrw:nArrayAt,2]
oDlg:Update()
Return nil
>
END
ACTIVATE DIALOG oDlg CENTERED
return nil
//----------------------------------------------------------------------------//