Page 1 of 1

TxBrowse fails on method :bKeyDown()

Posted: Wed Mar 19, 2008 2:51 pm
by JC
Hi my friends..

I have this situation when I execute a Enter key press:

Code: Select all

oBrw:bKeyDown( {|nKey| if( nKey == VK_RETURN, oButtons[2]:click(), ) } )
The code of oButtons[2]:click() opens a dialog from my resource... It's works fine, except for one problem.... the code opens the window twice.

However, I'm running only once!

Where I'm wrong??

Posted: Wed Mar 19, 2008 7:11 pm
by JC
I'm note one thing in the method KeyDown()...

Code: Select all

METHOD KeyDown( nKey, nFlags ) CLASS TXBrowse

   if ::bKeyDown != nil
      Eval( ::bKeyDown, nKey, nFlags )
   endif

   do case

   ...

   otherwise
         return Super:KeyDown( nKey, nFlags )

   endcase
It's execute a block code bKeydown twice!

Posted: Thu Mar 20, 2008 12:18 am
by nageswaragunupudi
Mr JC

I tried with oBrw:bKeyDown := { |n| If( n == 13, MsgInfo( "space" ), ) }
It executes only once.

Method KeyDown: Method Keydown of TXBrowse does not evaluate bKeyDown at all.

Method KeyChar evaluates bKeyChar in the beginning.

But when i tried oBrw:bKeyChar := { |n| If( n == 13, MsgInfo( "space" ), ) }, even then it executed only once.