Re: [Lazarus] Confused by help
On 2014-03-23 23:37, Luca Olivetti wrote: > Not as straightforward but it's possible. The thing is, I like things straightforward, cross-platform and developer friendly. ;-) Again, thanks for the info on THelpManager. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Confused by help
El 23/03/14 19:06, Graeme Geldenhuys ha escrit: > On 2014-03-22 19:35, Luca Olivetti wrote: >> You just have to create a class derived from THelmManager (in unit >> HelpIntfs). > > > Thanks for that info. > > > On a side note: > I see the Lazarus team still didn't update the OnHelp event - which uses > the event signature written for Windows 3.1 help viewers (also showing > Delphi's ancestry). I have suggested in the past they take up the Kylix > 3 OnHelp signature (shown below) which makes a lot more sense for > cross-platform, newer or custom written help systems. > > type > THelpEvent = function (HelpType: THelpType; HelpContext: Integer; > HelpKeyword: string; HelpFile: string; var Handled: Boolean): Boolean of > object; While that is true for the OnHelp event, by subclassing THelpManager you can bypass it and actually query by keyword or context. Not as straightforward but it's possible. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Confused by help
On 2014-03-23 19:50, Mattias Gaertner wrote: > Please describe where the event should be added, what the parameters > and result do, what the default implementation does, for those people > not having Kylix. Marco explained it. The event should replace the TApplication.OnHelp and TCustomForm.OnHelp implementations. Here is the details as described by the Kylix documentation. THelpEvent defines event handlers for user help requests. Unit QForms Delphi syntax: -- type THelpEvent = function (HelpType: THelpType; HelpContext: Integer; HelpKeyword: string; HelpFile: string; var Handled: Boolean): Boolean of object; Description --- The help request event handler has the following parameters. HelpType indicates whether the help topic is identified by context ID or by keyword. HelpContext identifies the help topic to display when HelpType is htContext. HelpKeyword identifies the help topic to display when HelpType is htKeyword. HelpFile identifies the help file that contains the specified topic. Handled returns an indication of whether the default help system should display the specified topic after the event handler exits. Set Handled to true if the event handler displays a help topic, and this prevents the application from proceeding to display the identified topic.The event handler should return true if it succeeds, false if it fails. The OnHelp event handler is defined for the TApplication and TCustomForm classes. Here is the OnHelp event (TApplication) documentation Occurs when the application receives a request for help. Delphi syntax: property OnHelp: THelpEvent; Description Write an OnHelp event handler to perform special processing when the user requests help. This event occurs when the help system is invoked by a call to InvokeHelp, ContextHelp, or KeywordHelp.The event handler returns true if it succeeds, false if it fails. Here is a very simplistic example as shown by the Kylix help. The following code changes the Help file depending on the active form, before the help viewer is called. AppHelp is assigned to the OnHelp event handler of Application in the OnCreate event of Form1. function TForm1.AppHelp(Command: Word; Data: Longint; var CallHelp: Boolean): Boolean; begin Application.HelpFile := Screen.ActiveForm.Name + '.hlp'; CallHelp := True; end; function TForm1.FormCreate(Sender: TObject); begin Application.OnHelp := AppHelp; end; As Marco mentioned, the THelpEvent, as currently defined, is right out of the Win32 documentation on how to communicate with the MS Windows .HLP help viewer. I hope this answers your question. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Confused by help
On Sun, Mar 23, 2014 at 08:50:14PM +0100, Mattias Gaertner wrote: > >[...lots of words, maybe helpful for someone having Kylix 3...] > > I will try to rephrase my question: > Please describe where the event should be added, what the parameters > and result do, what the default implementation does, for those people > not having Kylix. It is not really Kylix, but probably anything D6+. The old definition THelpEvent = function(Command: Word; Data: PtrInt; var CallHelp: Boolean): Boolean of object requires an integer for a topic, like .hlp, and is not very suitable for helptypes that lookup topics by string (like also CHM). CHM also can call topics by integer, but that is the "legacy" way. The newer definition is for CHM, but some attempt was made to make it multiple helptypes compatible (since they also had to support .hlp) THelpEvent = function (HelpType: THelpType; HelpContext: Integer; HelpKeyword: string; HelpFile: string; var Handled: Boolean): Boolean of object; The first param is probably some enum that denotes the helptype. The second and fourth parameter is the key (file+context id) for .hlp like helpsystems. The third and fourth are the key (file+ textual context) for helpsystems that have a string as context. Since the generic helpsystems polls various plugged helphandlers (enumerates over the THelpType enums, and if registers calls it), probably the handled boolean is to signal that the current handling found a result. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Confused by help
On Sun, 23 Mar 2014 19:30:27 + Graeme Geldenhuys wrote: >[...lots of words, maybe helpful for someone having Kylix 3...] I will try to rephrase my question: Please describe where the event should be added, what the parameters and result do, what the default implementation does, for those people not having Kylix. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Confused by help
On 2014-03-23 18:57, Mattias Gaertner wrote: > On Sun, 23 Mar 2014 18:06:16 + > Graeme Geldenhuys 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/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Confused by help
On Sun, 23 Mar 2014 18:06:16 + Graeme Geldenhuys wrote: >[...] > type > THelpEvent = function (HelpType: THelpType; HelpContext: Integer; > HelpKeyword: string; HelpFile: string; var Handled: Boolean): Boolean of > object; Please explain, what it should do. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Confused by help
On 2014-03-22 19:35, Luca Olivetti wrote: > You just have to create a class derived from THelmManager (in unit > HelpIntfs). Thanks for that info. On a side note: I see the Lazarus team still didn't update the OnHelp event - which uses the event signature written for Windows 3.1 help viewers (also showing Delphi's ancestry). I have suggested in the past they take up the Kylix 3 OnHelp signature (shown below) which makes a lot more sense for cross-platform, newer or custom written help systems. type THelpEvent = function (HelpType: THelpType; HelpContext: Integer; HelpKeyword: string; HelpFile: string; var Handled: Boolean): Boolean of object; Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] CeCILL-C licence and Lazarus?
Le lundi 17 mars 2014 19:29:16 Fabio Luis Girardi a écrit : > Somebody used this licence to release components for Lazarus? I'm sometimes using CeCILL license for some software I'm making. After re- reading the license there's no opposition to use it allong with Lazarus made software. CeCILL is fully GPL compatible. For components you must add the same exception that FCL have with LGPL if you want to allow the use of your component in closed source software. Regards, -- Geoffray « Fatalerrors » Levasseur-Brandin http://www.geoffray-levasseur.org/ http://0linux.org/ GNU/PG public key : A25E944254C62E34A8E58DCF688A5F74289C1897 Errare humanum est sed perseverare diabolicum aut cretinum. signature.asc Description: This is a digitally signed message part. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Setting TStringGrid row/col border styles
On 22/03/2014 22:04, Howard Page-Clark wrote: > On 22/03/2014 20:53, Gary Randall wrote: > may be all you need, without custom drawing. Apart from Howard's suggestion you'll find a lot of info on Lazarus on the wiki - in this case http://wiki.lazarus.freepascal.org/Grids_Reference_Page -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus