FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour VK_RETURN handling in Tree class
Posts: 59
Joined: Tue Oct 11, 2005 01:39 AM
VK_RETURN handling in Tree class
Posted: Fri Nov 10, 2006 01:07 AM
Antonio:

Any idea why the Enter key isn't trapped inside oTree:bKeyDown?

oTree:bKeyDown := {|nKey,nFlags| ;
   if( nKey == VK_RETURN, msginfo("never happens"), ;
   if( nKey == VK_SPACE, msginfo("space bar"), nil ) ) }


I can handle VK_INSERT, VK_DELETE and others, but VK_RETURN never
gets passed down to ::bKeyDown by the TTreeView class.

I just noticed that TTreeView:HandleEvent() has code pertaining VK_RETURN. I commented it out, but it makes no difference.... the Enter key doesn't get processed :-)


Thanks!
"May the Source be with GNU"
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
VK_RETURN handling in Tree class
Posted: Fri Nov 10, 2006 07:18 AM

Luis,

Do you have a default pushbutton on the same dialog ? If so, VK_RETURN will be routed to it.

I have modified samples\TestTree.prg with

oTree:bKeyDown := {|nKey,nFlags| ;
if( nKey == VK_RETURN, msginfo("never happens"), ;
if( nKey == VK_SPACE, msginfo("space bar"), nil ) ) }

and it works fine for VK_RETURN

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 59
Joined: Tue Oct 11, 2005 01:39 AM
VK_RETURN handling in Tree class
Posted: Fri Nov 10, 2006 09:44 PM
Antonio:

Antonio Linares wrote:
Do you have a default pushbutton on the same dialog ? If so, VK_RETURN will be routed to it.


It seems I have a little mystery in my hands. You're right, it works just fine in testtree.prg. In my case the tree is on a modal dialog with a toolbar, but no standard buttons, so there are no default pushbuttons.

For some reason, when the tree is on a dialog, the Enter key is not processed!

Any idea what could be "eating" the Enter key?

Regards,

Luis
"May the Source be with GNU"
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
VK_RETURN handling in Tree class
Posted: Fri Nov 10, 2006 10:41 PM

Luis,

You may need to set oTree:nDlgCode := DLGC_WANTALLKEYS

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 59
Joined: Tue Oct 11, 2005 01:39 AM
VK_RETURN handling in Tree class
Posted: Sat Nov 11, 2006 01:28 AM
Antonio:

Antonio Linares wrote:You may need to set oTree:nDlgCode := DLGC_WANTALLKEYS


Thanks a million - that did the trick!

Regards,

Luis
"May the Source be with GNU"

Continue the discussion