oJump for Antonio

oJump for Antonio

Postby byte-one » Mon Jan 14, 2019 3:36 pm

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  Expand view
METHOD ForWhen() CLASS TControl
……...
   // keyboard navigation
   if ::oJump != nil
      SetFocus( ::oJump:hWnd )
      ::oJump = nil
…...
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: oJump for Antonio

Postby Rick Lipkin » Mon Jan 14, 2019 4:18 pm

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  Expand view

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
User avatar
Rick Lipkin
 
Posts: 2629
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 17 guests

cron