[Lazarus] Confused by help

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Sun Mar 23 20:30:27 CET 2014


On 2014-03-23 18:57, Mattias Gaertner wrote:
> On Sun, 23 Mar 2014 18:06:16 +0000
> Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:
> 
>> [...]
>> type
>>  THelpEvent = function (HelpType: THelpType; HelpContext: Integer;
>> HelpKeyword: string; HelpFile: string; var Handled: Boolean): Boolean of
>> object;
> 
> Please explain, what it should do.

The current OnHelp event signature is define as follows:

THelpEvent = function(Command: Word; Data: PtrInt; var CallHelp:
Boolean): Boolean of object


As you can see Command is of Word type, Data is of PtrInt etc. Pretty
meaningless parameters to a developer. The will have to go hunt down the
Win32 documentation to see what they mean.

Yet everywhere else in LCL's help context, the help is define by a help
file, a THelpType, a HelpKeyword or a HelpContext number. Nowhere else
is PtrData or Word types used? So why must OnHelp be such a old (and
Windows specific) signature that was designed for a very old Windows
help viewer.

Using the Kylix 3 style THelpEvent signature means it makes it MUCH
easier to use for the developer - knowing exactly what each parameter
means and contains. It is also then very easy for the developer to
implement new help systems into their LCL applications - be that a
custom viewer (eg: built into the application), MAN style help viewer,
PDF lookup, DocView etc.

The Kylix 3 style signature also makes it much more cross-platform
friendly... one of the goals of CLX and LCL.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/




More information about the Lazarus mailing list