[lazarus] Context sensitive help

David Creelman dave at geko.net.au
Fri Apr 11 01:34:04 EDT 2003


Hi Tony,

In Delphi I think help was handled at the TApplication level. I think
there was an event OnHelp or something similar to that. When F1 got
pressed this got called and if a method was attached, the it would be
called. This method also worked for context sensitive (in Windows
ctrl-F1, same in Lazarus ?). 

If it's done the central way, the application handles capturing the
keystroke, not each form. That way you don't need to worry about making
a component to do this for you (though you should still be able to do it
your way for special cases if you want to).

I kind of like this way of doing things, as it centralises help rather
than having to add a handler to each form. which gets messy (is this
what you meant ?). This way all that needs to be added to a TWinControl
(or perhaps TControl) is a HelpID : LongInt property. This way each
control can have a context help associated.

I may have got parts of this wrong. Wouldn't be hard at all to add in
the help tag I think. The help management system itself ? Don't know.

Cheers
DC

On Fri, 2003-04-11 at 10:43, Tony Maro wrote:
> Under Delphi, wasn't there a "helpid" property or something like it that
> was used for the context sensitive help system?
> 
> Is it possible to add this property to the TControl object (or wherever
> it's more appropriate?)
> 
> I'm working on an HTML context sensitive help system and my idea is for
> a TComponent that you drop on a form that will watch keystrokes for F1. 
> It would then see what control had focus and check it's help id
> property.  Then it maps that help id property to a list of html files
> provided at design time, locates a proper browser on the computer and
> opens the html document with it.
> 
> The only thing I'm not sure of is how to grab the keystrokes with a
> message before any other control grabs it.
> 
> Currently I'm using a context help system like this, but I have each
> control's OnKeyDown event triggering the help file.  That's kind of
> kludgy and painful if there's a lot of controls.  
> 
> Is there a message my control could watch for that would let it see the
> keys before the controls?  Or that would grab leftovers after the
> controls processed everything they could... and if the latter, would F1
> naturally fall through?
> 
> Thanks,
> 
> -- 
> Tony Maro
> tony at maro.net
> http://tony.maro.net/
> 
> Check out my software "CheckBook Tracker"
> A GPL (free) replacement for Microsoft Money!
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives







More information about the Lazarus mailing list