1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
unit ChmLcl;
{$mode objfpc}{$H+}
interface
uses
Classes, LazHelpIntf, HelpFPDoc;
const
sLclUnits = 'LCL - Lazarus component library';
type
{ TLclChmHelpDatabase }
TLclChmHelpDatabase = class(TFPDocHTMLHelpDatabase)
private
FBaseURL: THelpBaseURLObject;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
end;
procedure RegisterLclHelpDatabase;
var
LCLHelpDatabase: TLclChmHelpDatabase = nil;
implementation
procedure RegisterLclHelpDatabase;
var
FPDocNode: THelpNode;
DirItem: THelpDBISourceDirectory;
begin
if Assigned(LCLHelpDatabase) then Exit;
LCLHelpDatabase := TLclChmHelpDatabase(
HelpDatabases.CreateHelpDatabase(sLclUnits, TLclChmHelpDatabase, True));
// FPDoc nodes for units in the LCL
FPDocNode := THelpNode.CreateURL(LCLHelpDatabase,
'LCL - Lazarus Component Library Units',
'file://index.html');
LCLHelpDatabase.TOCNode := THelpNode.Create(LCLHelpDatabase, FPDocNode);
DirItem := THelpDBISourceDirectory.Create(FPDocNode, '$(LazarusDir)/lcl',
'*.pp;*.pas;*.inc', True);// and once as normal page
LCLHelpDatabase.RegisterItem(DirItem);
end;
{ TLclChmHelpDatabase }
constructor TLclChmHelpDatabase.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FBaseURL := THelpBaseURLObject.Create;
FBaseURL.BaseURL := 'lcl.chm://';
BasePathObject := FBaseURL;
end;
destructor TLclChmHelpDatabase.Destroy;
begin
FBaseURL.Free;
inherited Destroy;
end;
end.
|