[lazarus] Context sensitive help

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Apr 20 12:13:23 EDT 2003


On Sun, 20 Apr 2003 10:58:01 +0200
Tony Maro <tony at maro.net> wrote:

> Mattias Gaertner wrote:
> 
> >Once for the form, and once for the TEdit. Normal.
> >
> >  
> >
> It generates the form event first. Your description of what the event 
> is supposed to do is generate the event only if nothing else has 
> processed it.  In order to process at the control and fallback to the 
> form if not processed, I think it would make sense to ask the focused 
> control first, then the form, unless the form.keypreview is set?

It's not the LCL that sends the keydown event to the form before the
wincontrol. It's the gtk. If the user presses a key, the gtk sends a
keypress event to each parent widget down to the widget of the wincontrol.
If you activate KeyPreview, the LCL does the same as the VCL: The form
processes the Key event before the wincontrol. And that's why, it will
result in two keydown events for the form and one for the wincontrol.
For Delphi compatibility the gtk interface should skip key messages to
parent wincontrols. Probably there are some other incompatibilities in the
key handling. Any volunteers?


> Also, can we publish keypreview?

Done. Although it does not make much sense yet, for the above reasons.


Mattias






More information about the Lazarus mailing list