Página 1 de 1

More keyboard trapping questions ...

Publicado: Mar Sep 20, 2016 12:52 pm
por ChrisGillard
Hi,

My ScreenPrompt class inherited from TLabelEx and my PromptBar class inherited from TBevel are working well and have mouse & keyboard 'action key' character support.

I now have adapted by PromptBar class to display its ScreenPrompt objects in a vertical menu format. Again this works well for mouse & keyboard 'action key' character support.

But I need to use the UP and DOWN cursor keys to also move the prompt hilite, but I cannot trap those keys with either the OnKeydown or WMKeyDown events.

The TBevel class I am using inherits from TWinControl which has its own WMKeyDown that traps the cursor keys for moving around its controls.

Question 1 is : Why does my redefined WMKeyDown method not override the TBevel or TStdControl own WMKeydown method particularly as I do NOT call ::Super:WMKeyDown() ... see below

METHOD WMKeyDown( nKey, nFlags, hWnd ) CLASS TBsPromptBar
LogDisplay( "TBsPromptBar:WMkeyDown()", nKey, Chr( nKey) )
// ::Super:WMKeydown( nKey, nFlags, hWnd )
RETURN nil

PromptBar inherited from TWinControl or TBevel below
2016-09-20_11-06-00.jpg
2016-09-20_11-06-00.jpg (26.31 KiB) Visto 3965 veces
If I inherit by ScreenPromptBar class from TStdControl I do seem able to add a WMKeyDown() method which does receive the cursor keys .... but I seem to lose some other useful colour properties? below
2016-09-20_11-11-42.jpg
2016-09-20_11-11-42.jpg (33.32 KiB) Visto 3965 veces
Question 2 is : I dont really understand when you should use the OnKeyDown event or WMKeyDown Method.

Any help would be appreciated.

I have attached my test project source .... it is a bit of a hack, just trying to get something to work!

Re: More keyboard trapping questions ...

Publicado: Mar Sep 20, 2016 4:00 pm
por ChrisGillard
Hi,

To save time I think my question is quite simply ...

Why does my redefined WMKeyDown method not override the TBevel or TStdControl own WMKeydown method particularly as I do NOT call ::Super:WMKeyDown() in my own method.

Thats my basic problem ... I want to overide the TBevel or TStdControl built in WMKeydown method and replace it with my own WMKeydown.

Can I do that and if so how do I do it?

Thanks

Chris

Re: More keyboard trapping questions ...

Publicado: Mar Sep 20, 2016 5:30 pm
por ignacio
Hello Chris,

Next Xailer version includes a new control that I'm sure it will fit your needs. Please contact me in private.

Regards,