[Lazarus] THelpEvent declaration discussion

Mattias Gärtner nc-gaertnma at netcologne.de
Fri Nov 6 09:51:02 CET 2009


Zitat von Graeme Geldenhuys <graeme at mastermaths.co.za>:

> [...]
> Here is the difference....
>
> Kylix 3 type signature:
>   THelpEvent = function(HelpType: THelpType; HelpContext: THelpContext;
>        const HelpKeyword: String; const HelpFile: String;
>        var Handled: Boolean): Boolean of object;
>
>
> Free Pascal & Delphi type signature:
>   THelpEvent = function (Command: Word; Data: Longint;
>     var CallHelp: Boolean): Boolean of object;

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

Where Data is PHelpInfo. It is used by the widgetsets.


> [...]
> The Kylix 3 signature seems more useful to me as a cross-platform
> developer, as it clearly defines the parameters (no ambiguous
> parameters) and sends all information needed to the OnHelp event
> handler. My proposal is that the THelpEvent definition in FPC be changed
> to the Kylix 3 signature.

I miss a "Sender: TObject".


> Why - you ask?
>  * The K3 THelpEvent parameters are more related to newer help systems.
>    Not tied to the deprecated WinHelp from Microsoft.
>  * The parameters used in that even is what is already defined and
>    used elsewhere:
>    - HelpType     (TComponent)
>    - HelpContext  (TComponent)
>    - HelpKeyword  (TComponent)
>    - HelpFile     (TApplication)
>
> So yes, this will break backward compatibility in Lazarus, but Lazarus
> is not the only GUI toolkit and development tools using FPC and it's
> classes. Also FPC and Lazarus have already implemented things that break
> compatibility with Delphi - simply because FPC and Lazarus are not so
> closely tied to Windows; it may be a better design and for the greater
> good (better cross-platform support).

I see no gain in Kylix compatibility.

Lazarus has already a help system, which is quite different from Delphi's.

Mattias






More information about the Lazarus mailing list