IDE: Extending IDE context help search to lazutils.chm, issue #32022 from zbyna

git-svn-id: branches/fixes_1_8@55352 -
This commit is contained in:
mattias 2017-06-15 18:17:12 +00:00
parent 5ce7b893d7
commit e4db52e558
2 changed files with 38 additions and 0 deletions

View File

@ -472,6 +472,10 @@ begin
begin
BaseURL.BaseURL := 'lcl.chm://';
DB.OnFindViewer:=@DBFindViewer;
end else if (DB.ID = 'LazUtilsUnits') and (BaseURL.BaseURL = '') then
begin
BaseURL.BaseURL := 'lazutils.chm://';
DB.OnFindViewer:=@DBFindViewer;
end;
end;
end;

View File

@ -189,6 +189,8 @@ type
FMainHelpDBPath: THelpBasePathObject;
FRTLHelpDB: THelpDatabase;
FRTLHelpDBPath: THelpBaseURLObject;
FLazUtilsHelpDB: THelpDatabase;
FLazUtilsHelpDBPath: THelpBaseURLObject;
// Used by CreateHint
FHtmlHelpProvider: TAbstractIDEHTMLProvider;
FHintWindow: THintWindow;
@ -235,6 +237,8 @@ type
property LCLHelpDBPath: THelpBaseURLObject read FLCLHelpDBPath;
property RTLHelpDB: THelpDatabase read FRTLHelpDB;
property RTLHelpDBPath: THelpBaseURLObject read FRTLHelpDBPath;
property LazUtilsHelpDB: THelpDatabase read FLazUtilsHelpDB;
property LazUtilsHelpDBPath: THelpBaseURLObject read FLazUtilsHelpDBPath;
end;
{ TIDEHintWindowManager }
@ -273,6 +277,8 @@ const
lihcRTLUnits = 'RTLUnits';
lihcFCLUnits = 'FCLUnits';
lihcLCLUnits = 'LCLUnits';
lihcLazUtilsUnits = 'LazUtilsUnits';
lihBaseUrl = 'http://lazarus-ccr.sourceforge.net/docs/';
@ -280,6 +286,9 @@ const
lihFCLURL = lihBaseUrl+'fcl/';
lihLCLURL = lihBaseUrl+'lcl/';
lihLazUtilsURL = 'lazutils.chm://';
// not important see: ../components/chmhelp/packages/idehelp/lazchmhelp.pas
var
HelpBoss: TBaseHelpManager = nil;
@ -1316,6 +1325,30 @@ procedure TIDEHelpManager.RegisterIDEHelpDatabases;
HTMLHelp.RegisterItem(DirItem);
end;
procedure CreateLazUtilsHelpDB;
var
HTMLHelp: TFPDocHTMLHelpDatabase;
FPDocNode: THelpNode;
DirItem: THelpDBISourceDirectory;
begin
FLazUtilsHelpDB:=HelpDatabases.CreateHelpDatabase(lihcLazUtilsUnits,
TFPDocHTMLHelpDatabase,true);
HTMLHelp:=FLazUtilsHelpDB as TFPDocHTMLHelpDatabase;
HTMLHelp.DefaultBaseURL:=lihLazUtilsURL;
FLazUtilsHelpDBPath:=THelpBaseURLObject.Create;
HTMLHelp.BasePathObject:=FLazUtilsHelpDBPath;
// FPDoc nodes for units in the LazUtils
FPDocNode:=THelpNode.CreateURL(HTMLHelp,
'LazUtils - Lazarus Utilities Library Units',
'file://index.html');
HTMLHelp.TOCNode:=THelpNode.Create(HTMLHelp,FPDocNode);// once as TOC
DirItem:=THelpDBISourceDirectory.Create(FPDocNode,
'$(LazarusDir)/components/lazutils',
'*.pp;*.pas',true);// and once as normal page
HTMLHelp.RegisterItem(DirItem);
end;
procedure CreateFPCKeywordsHelpDB;
begin
{$IFDEF EnableSimpleFPCKeyWordHelpDB}
@ -1331,6 +1364,7 @@ begin
CreateLCLHelpDB;
CreateFPCMessagesHelpDB;
CreateFPCKeywordsHelpDB;
CreateLazUtilsHelpDB;
end;
procedure TIDEHelpManager.RegisterDefaultIDEHelpViewers;