oJump for Antonio

Post Reply
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

oJump for Antonio

Post 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
…...
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: oJump for Antonio

Post 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
Post Reply