Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-11

LHelp or help systems that also work on..

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lars

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

Reply by email

Andrew Haines
to Lars
Lars wrote 12 lines
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

Reply by email

Graeme Geldenhuys
to Lars: Since I use both Lazarus and Delphi and never just use one or the other, is there any…
Lars 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

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 5 lines
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

Reply by email

Lars
to Andrew Haines: lhelp uses IPC to communicate so it wouldn't be too bad to write a Delphi unit to control…
Andrew Haines wrote 6 lines
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.

Reply by email

Lars
to Lars
Lars wrote 5 lines
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 ;-)

Reply by email

Andrew Haines
to Lars
Lars wrote 12 lines
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

Reply by email

Lars
to Graeme Geldenhuys: Yes, Docview and INF help can be used in both cases. I already posted a full example…
Graeme Geldenhuys wrote 6 lines
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

Reply by email

Graeme Geldenhuys
to Lars
Lars 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

Reply by email