[Lazarus] THelpEvent declaration discussion

Graeme Geldenhuys graeme at mastermaths.co.za
Fri Nov 6 08:52:02 CET 2009


The fpc-pascal mailing list seems to quite for this discussion and
Lazarus would have a greater impact on the suggested change, so I moved
the conversation no Lazarus mailing list instead. Even though THelpEvent
is defined in FPC (not Lazarus).

Yesterday I found that the THelpEvent definition in Kylix 3 is very
different to the one in Delphi VCL. Looking at the code in FPC, it
follows the Delphi implementation - even though the implementation is
extremely outdated.

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;


I read the latest Embarcadero online help (available on the web) and it
clearly mentions that the THelpEvent signature is based on the WinHelp
help system and API.

Now considering that WinHelp is been discontinued by Microsoft and has
been replaced twice already by different help systems... first CHM, then
again with Microsoft Help 2 - it just shows how old and outdated WinHelp is.

My opinion is that FPC and Lazarus is not that closely tied to Windows
and Windows API - well it shouldn't be, because both products are
cross-platform tools and should have equal footing on all supported
platforms.

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.

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).


Regards,
  - Graeme -

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





More information about the Lazarus mailing list