New feature for DCGET KEYBLOCK

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

New feature for DCGET KEYBLOCK

#1 Post 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).
-----------------
Greetings
Markus Walter

User avatar
Tom
Posts: 1185
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: New feature for DCGET KEYBLOCK

#2 Post by Tom »

Hi, Markus.

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

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Re: New feature for DCGET KEYBLOCK

#3 Post by Markus Walter »

Hi Tom,

in this case XbpSLE:Keyboard() i still called...
-----------------
Greetings
Markus Walter

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: New feature for DCGET KEYBLOCK

#4 Post 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
The eXpress train is coming - and it has more cars.

User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Re: New feature for DCGET KEYBLOCK

#5 Post 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
-----------------
Greetings
Markus Walter

Post Reply