Hello,
In Clipper, no matter what the ON CHANGE returns, TAB or ENTER positions the cursor in the next GET.
In xHarbour, the ON CHANGE needs to return .T. before ENTER brings the cursor to the next GET.
Please try this sample:
/*
oGet1 has an onChange wich does NOT return .T.
-> By changing value in oGet1 en pressing ENTER, cursor stays in oGet1 <<- WRONG
-> By changing value in oGet1 en pressing TAB, cursor goes to oGet2
oGet2 has an onChange wich DOES return .T.
-> By changing value in oGet2 en pressing ENTER, cursor goes to oGet3
-> By changing value in oGet2 en pressing TAB, cursor goes to oGet2
*/
#include "FiveWin.ch"
Function wfMain()
LOCAL oDlg
LOCAL oGet1, oGet2, oGet3
LOCAL cGet1, cGet2, cGet3:=""
cGet1:="Change this text en press Enter"
cGet2:="Change this text en press Enter"
DEFINE DIALOG oDlg TITLE "Test" FROM 0, 0 TO 300,400 PIXEL
@ 10, 10 GET oGet1 VAR cGet1 OF oDlg PIXEL SIZE 150, 10;
ON CHANGE (cGet3+="On Change cGet1: Cursor stays in oGet1!!"+CRLF, oGet3:Refresh()) ;
VALID (cGet3+="Valid cGet1"+CRLF, oGet3:Refresh(), .T.) ;
@ 30, 10 GET oGet2 VAR cGet2 OF oDlg PIXEL SIZE 150, 10;
ON CHANGE (cGet3+="On Change cGet2: Cursor goes to next field"+CRLF, oGet3:Refresh(), .T.) ;
VALID (cGet3+="Valid cGet2"+CRLF, oGet3:Refresh(), .T.) ;
@ 50, 10 GET oGet3 VAR cGet3 OF oDlg MEMO PIXEL SIZE 150, 50
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
--
Sincerely,
Patrick Mast
www.xHarbour.com