Page 1 of 1
oJump for Antonio
Posted: Mon Jan 14, 2019 3:36 pm
by byte-one
Antonio, you set oJump after one navigation to this control to NIL, but if going again to the same control now the oJump is no further functioning as it is NIL!?
Code: Select all
METHOD ForWhen() CLASS TControl
……...
// keyboard navigation
if ::oJump != nil
SetFocus( ::oJump:hWnd )
::oJump = nil
…...
Re: oJump for Antonio
Posted: Mon Jan 14, 2019 4:18 pm
by Rick Lipkin
Günther
I deleted my post after re-reading your initial post about oBtn ... here is the code I deleted that pertained to the oJump method ..
Code: Select all
REDEFINE GET oPosition VAR cPosition ID 142 of oGrps PICTURE "@!" BITMAP "find";
ACTION ( _PosGet( cMode,@cPosition,oPosition,oPositionAbbr,@cPositionAbbr,"BUTTON",;
oButt1,oButt2,oRsEmp ),;
oPositionAbbr:SetFocus(),oPositionAbbr:oJump := oPositionAbbr ) UPDATE
oPosition:lAdjustBtn := .t.
oPosition:bKeyDown := {|nK| if( nK==VK_RETURN,( ;
_PosGet( cMode,@cPosition,oPosition,oPositionAbbr,@cPositionAbbr,"FIELD",;
oButt1,oButt2,oRsEmp ),;
oOrganU:SetFocus(),oOrganU:oJump := oOrganU ), ) }
REDEFINE GET oPositionAbbr VAR cPositionAbbr ID 148 of oGRPS UPDATE //COLOR CLR_BLACK, 16053492 READONLY
In the above code .. tget is evaluating the bKeydown code block and traps the <enter> key .. thereby blocking the navigation to the next field .. I believe the above code was inspired my Antonio .. I mention oJump in my deleted post and noted that if was a bit clumsy and your solution seemed much more elegant .. Hope this post is relevant to your tget enhancement.
Rick Lipkin