[Lazarus] LHelp or help systems that also work on..

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
Hi,

Since I use both Lazarus and Delphi and never just use one or the other,
is there any help system that works in both delphi and Lazarus? i.e.
anyone port LHelp to delphi so delphi apps can have a similar help system?
Or any other help systems that are portable between Laz and Delphi?

I haven't studied much, but my guess is LHelp was specifically built for
Lazarus and never considered Delphi, due to the name "L Help" which stands
for maybe lazarus help.  Assumptions here...


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
On 11/18/2016 06:36 AM, Lars via Lazarus wrote:

> Hi,
>
> Since I use both Lazarus and Delphi and never just use one or the other,
> is there any help system that works in both delphi and Lazarus? i.e.
> anyone port LHelp to delphi so delphi apps can have a similar help system?
> Or any other help systems that are portable between Laz and Delphi?
>
> I haven't studied much, but my guess is LHelp was specifically built for
> Lazarus and never considered Delphi, due to the name "L Help" which stands
> for maybe lazarus help.  Assumptions here...
>
>
lhelp uses IPC to communicate so it wouldn't be too bad to write a
Delphi unit to control it. Compiling lhelp though is a fpc only job.

https://github.com/graemeg/lazarus/blob/upstream/components/chmhelp/packages/help/lhelpcontrol.pas


Regards,


Andrew

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 2016-11-18 11:36, Lars via Lazarus wrote:
> Since I use both Lazarus and Delphi and never just use one or the other,
> is there any help system that works in both delphi and Lazarus?

Yes, Docview and INF help can be used in both cases. I already posted a
full example project for Lazarus LCL applications in the Lazarus Forums.

For Delphi applications you can do the following. Simply set the
HelpContext values for each component or form - as you normally would.
Then implement a global help event handler as shown below. This simply
catches the help request, then launches DocView with the correct
parameters to display the help topic in question.

ps:
  There is a known bug in Delphi 7 where Application.OnHelp is never
  called. Later Delphi versions have fixed this bug. If the application
  is compiled with Delphi 7, then you need to simply catch the WM_HELP
  message in the form, and call AppHelp() explicitly.

========================================
function TForm1.AppHelp(Command: Word; Data: Integer; var CallHelp:
Boolean): Boolean;
const
  cEXE = 'c:\apps\docview.exe myapp.inf -n %d';
var
  SI: TStartupInfo;
  PI: TProcessInformation;
  cmd: string;
begin
  if Command = HELP_CONTEXT then
    CallHelp := False
  else
  begin
    Result := True;
    CallHelp := True;  // don't do anything ourselves.
    Exit;
  end;
  // if we got here, we must display some help.

  cmd := Format(cEXE, [Data]);
  GetStartupInfo(SI);
  // do whatever other setup info you want
  CreateProcess(nil, PChar(cmd), nil, nil, False, 0, nil, nil, SI, PI);
  Result := True;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.HelpFile := 'myapp.inf';
  Application.OnHelp := AppHelp;
end;
==========================================



Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
On 2016-11-18 13:16, Graeme Geldenhuys via Lazarus wrote:
> ps:
>   There is a known bug in Delphi 7 where Application.OnHelp is never
>   called. Later Delphi versions have fixed this bug. If the application
>   is compiled with Delphi 7, then you need to simply catch the WM_HELP
>   message in the form, and call AppHelp() explicitly.

Apparently both D6 and D7's Application.OnHelp was broken. Here is an
alternative fix for those versions of Delphi.

http://web.archive.org/web/20100611210430/http://helpware.net/downloads/index.htm

Scroll down to the "Delphi 6,7,.. OnHelp Fix" and download the example
zip which includes the D6OnHelpFix.pas unit that implements the fix.


Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Fri, November 18, 2016 5:08 am, Andrew Haines via Lazarus wrote:
> lhelp uses IPC to communicate so it wouldn't be too bad to write a Delphi
> unit to control it. Compiling lhelp though is a fpc only job.
>
> https://github.com/graemeg/lazarus/blob/upstream/components/chmhelp/packa
> ges/help/lhelpcontrol.pas
>


Thanks for the tip. So I see many people are using SimpleIPC. Has anyone
come across any problems. When I tried it when it very first came out
almost days or weeks after the first release of it, I noticed some
duplicate messages being passed. Not sure if it was my problem or the IPC
unit problem. Seemed like a really neat tool, SimpleIPC.
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
On Sat, November 19, 2016 3:24 pm, Lars wrote:
> On Fri, November 18, 2016 5:08 am, Andrew Haines via Lazarus wrote:
>
>> lhelp uses IPC to communicate so it wouldn't be too bad to write a
>> Delphi
>> unit to control it.

p.s. in addition to my last message, wouldn't SimpleIPC need to be ported
to delphi then..  or at least some of it's mechanism.

Would be neat if simpleipc was available in delphi so fpc programs could
communicate to delphi programs.  If only simpleipc was standardized and
available in all languages ;-)
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
On 11/19/2016 05:33 PM, Lars via Lazarus wrote:

> On Sat, November 19, 2016 3:24 pm, Lars wrote:
>> On Fri, November 18, 2016 5:08 am, Andrew Haines via Lazarus wrote:
>>
>>> lhelp uses IPC to communicate so it wouldn't be too bad to write a
>>> Delphi
>>> unit to control it.
> p.s. in addition to my last message, wouldn't SimpleIPC need to be ported
> to delphi then..  or at least some of it's mechanism.
>
> Would be neat if simpleipc was available in delphi so fpc programs could
> communicate to delphi programs.  If only simpleipc was standardized and
> available in all languages ;-)

Looking at the simpleipc unit I see

TMsgHeader = Packed record
     Version : Byte;
     MsgType : TMessageType;
     MsgLen  : Integer;
   end;

I guess the message content, assuming any following data, is after
MsgLen. This would be easy to implement.

Regards,


Andrew Haines

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Fri, November 18, 2016 6:16 am, Graeme Geldenhuys via Lazarus wrote:
> On 2016-11-18 11:36, Lars via Lazarus wrote:
>
>> Since I use both Lazarus and Delphi and never just use one or the
>> other, is there any help system that works in both delphi and Lazarus?
>
> Yes, Docview and INF help can be used in both cases.

Docview is an fpGui based project?

If so that would be interesting and maybe my ticket into finally looking
at some fpGui code
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] LHelp or help systems that also work on..

Free Pascal - Lazarus mailing list
On 2016-11-20 06:16, Lars via Lazarus wrote:
> Docview is an fpGui based project?

Yes, and it comes standard with fpGUI. I've also created some pre-built
binaries, available on SourceForge for download.

Regards,
  Graeme

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus