Page 1 of 1

New feature for DCGET KEYBLOCK

Posted: Thu Mar 18, 2010 8:18 am
by Markus Walter
Hi Roger,

if i define a KEYBLOCK for DCGET, i can't reach that the XbpSLE:keyboard() is called. What about testing the result of the codeblock to switch this behaviour?

Code now:

Code: Select all

     IF Valtype(::keyBlock) = 'B' .AND. !Empty(nKey)
       Eval(::keyBlock,nKey,nil,self)
     ENDIF

     IF ! lHandled
       RETURN ::XbpSle:Keyboard( nKey )
     ENDIF
something like this:

Code: Select all

     IF Valtype(::keyBlock) = 'B' .AND. !Empty(nKey)
       if Eval(::keyBlock,nKey,nil,self)
          lHandled := .t.
       endif
     ENDIF

     IF ! lHandled
       RETURN ::XbpSle:Keyboard( nKey )
     ENDIF
or using DCGUI_IGNORE?

In this case i could overwrite Xbase-Behaviour (exp. Strg-A).

Re: New feature for DCGET KEYBLOCK

Posted: Thu Mar 18, 2010 8:36 am
by Tom
Hi, Markus.

What about using DC_MergeBlocks (oXbp:KeyBoard := DC_MergeBlocks(bMyKeyBoardBlock,oXbp:Keyboard)?

Re: New feature for DCGET KEYBLOCK

Posted: Thu Mar 18, 2010 9:12 am
by Markus Walter
Hi Tom,

in this case XbpSLE:Keyboard() i still called...

Re: New feature for DCGET KEYBLOCK

Posted: Thu Mar 18, 2010 10:26 am
by rdonnay
Try making the following change in _DCXBPGT.PRG and rebuild dclipx.dll by running build19.bat or build19_sl1.bat.
Your keyblock must always return a logical value.

Code: Select all

     IF Valtype(::keyBlock) = 'B' .AND. !Empty(nKey)
      // Eval(::keyBlock,nKey,nil,self)                <<<<<<< old
       lStatus := Eval(::keyBlock,nKey,nil,self)  <<<<<<< new
       IF Valtype(lStatus) == 'L'
          lHandled := lStatus
       ENDIF
     ENDIF

     IF ! lHandled
       RETURN ::XbpSle:Keyboard( nKey )
     ENDIF

Re: New feature for DCGET KEYBLOCK

Posted: Fri Mar 19, 2010 2:38 am
by Markus Walter
Hello Roger,

this works and would help and should not break existing code for others. Please update the helpfile, too.

Greetings
Markus