diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0e988f67bf..2200ff6722 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,14 @@ +2000-12-02 01:15 UTC+0500 April + * source/rtl/xhelp.prg + * added code to push the params passed to xhelp back onto the stack + (fixes default K_F1 set key) + * tests/setkeys.prg + * added Help() and display contents of params received + * NOTE: using hb_SetKeyCheck() with only one param [key] will not + pass proper values to default Help() - it's pcount will be 3, but + cProc will be [key], and nLine and cVar will be NIL + use hb_SetKeyCheck( n, procname(),procline(), readvar() ) + 2000-12-02 01:13 UTC+0100 jfl (mafact) * include/hbclass.ch * more work in progress about :class message diff --git a/harbour/source/rtl/xhelp.c b/harbour/source/rtl/xhelp.c index b5b8760695..9f6e96ef40 100644 --- a/harbour/source/rtl/xhelp.c +++ b/harbour/source/rtl/xhelp.c @@ -42,10 +42,21 @@ HB_FUNC( __XHELP ) if( pDynSym ) { + /* awhite: push the existing params after the dyn symbol */ + + USHORT uiPCount = hb_pcount(); + USHORT uiParam; + + hb_vmPushSymbol( pDynSym->pSymbol ); + hb_vmPushNil(); + for( uiParam = 1; uiParam <= uiPCount; uiParam++ ) + hb_vmPush( hb_param( uiParam, HB_IT_ANY ) ); + hb_vmDo( uiPCount ); +/* hb_vmPushSymbol( pDynSym->pSymbol ); hb_vmPushNil(); hb_vmDo( 0 ); - +*/ /* NOTE: Leave the return value as it is. */ } } diff --git a/harbour/tests/setkeys.prg b/harbour/tests/setkeys.prg index de5e25a3f7..6eb988ee88 100644 --- a/harbour/tests/setkeys.prg +++ b/harbour/tests/setkeys.prg @@ -31,6 +31,7 @@ their web site at http://www.gnu.org/). V 1.0 A White Initial version, submitted to Harbour Project + V 1.1 A White Add a Help() function to test default F1 */ #include "inkey.ch" @@ -83,7 +84,7 @@ hb_SetKeyArray( { 49, 50, 52, 53 }, {|x| qout( chr( x ) ) } ) do while ( n := inkey( 0 ) ) != K_ESC - if hb_SetKeyCheck( n ) + if hb_SetKeyCheck( n, procname(),procline(), readvar() ) qqout( " hit hot" ) else qout( chr( n ) ) @@ -96,3 +97,12 @@ return + Procedure Help( cProc, nLine, cVar ) + local nX := col(), nY := row() + + @ 19, 19 say "Pcount: " ; ?? pcount() + @ 20, 10 say "Proc : " ; ?? cProc + @ 21, 10 say "Line : " ; ?? nLine + @ 22, 10 say "Var : " ; ?? cVar + + SetPos( nX, nY )