FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oget:bKeyChar
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
oget:bKeyChar
Posted: Tue Feb 07, 2012 02:39 PM
Dear friends,
In the first get oget1: If I press "/"
the cursor must jump to the next object without KV_TAB pressed ( or VK_RETURN )
and oget:varget ==>>>> "/ "


Please need help!

marco


Code (fw): Select all Collapse
#include "fivewin.ch"

FUNCTION MAIN()

 LOCAL oDlg
 LOCAL oGet1 , cGet1 := SPACE( 4 )
 LOCAL oGet2 , cGet2 := SPACE( 4 )

 DEFINE DIALOG oDlg

 @ 1 , 1 GET oGet1 VAR cGet1 OF oDlg

 @ 3 , 1 GET oGet2 VAR cGet2 OF oDlg

 oGet1:bKeyChar := { | nKey | fun_get( oGet1 , nKey ) }

 ACTIVATE DIALOG oDlg  CENTER

RETURN NIL


FUNCTION FUN_GET( oGet , nKey )
LOCAL cGet := oGet:varget()

IF CHR( nKey ) = "/"

   // I have to assign PADR( "/" , 4 ) to oGet and exit from it
   // new focus has to be in oget2

ENDIF

RETURN NIL
Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: oget:bKeyChar
Posted: Tue Feb 07, 2012 03:36 PM
Code (fw): Select all Collapse
#include "fivewin.ch"

FUNCTION MAIN()

 LOCAL oDlg
 LOCAL oGet1 , cGet1 := SPACE( 4 )
 LOCAL oGet2 , cGet2 := SPACE( 4 )

 DEFINE DIALOG oDlg

 @ 1 , 1 GET oGet1 VAR cGet1 OF oDlg

 @ 3 , 1 GET oGet2 VAR cGet2 OF oDlg

 oGet1:bKeyChar := { | nKey | fun_get( oGet1, oGet2, nKey ) }

 ACTIVATE DIALOG oDlg  CENTER

RETURN NIL


FUNCTION FUN_GET( oGet1, oGet2, nKey )
LOCAL cGet := oGet1:varget()

IF CHR( nKey ) = "/"

   // I have to assign PADR( "/" , 4 ) to oGet and exit from it
   // new focus has to be in oget2

   oGet1:VarPut( PADR( "/" , 4 ) )
   oGet1:Refresh()

   oGet2:SetFocus()

ENDIF

RETURN NIL


EMG
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: oget:bKeyChar
Posted: Tue Feb 07, 2012 04:16 PM

wow
it's easy....for you... :cry:

Marco Boschi
info@marcoboschi.it

Continue the discussion