In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

More keyboard trapping questions ...

Xailer professional forum in English
Responder
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

More keyboard trapping questions ...

Mensaje 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 3327 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 3327 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!
Adjuntos
ScreenPrompt2.zip
(11.52 KiB) Descargado 195 veces
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

Re: More keyboard trapping questions ...

Mensaje 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
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9252
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: More keyboard trapping questions ...

Mensaje 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,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Responder