LazStats: Show help contents. Improved help system. More entries in chm help file.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7606 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-08-16 13:22:07 +00:00
parent 4d6f43d583
commit f48d460f8f
8 changed files with 91 additions and 47 deletions

View File

@@ -5,7 +5,7 @@ unit HelpUnit;
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
Classes, SysUtils, {FileUtil, }LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, LazHelpHTML, HelpIntfs;
type
@@ -30,8 +30,44 @@ type
var
HelpFrm: THelpFrm;
procedure ShowHelpTopic(AHelpContext: Word); overload;
procedure ShowHelpTopic(AHelpID: PChar); overload;
implementation
uses
{$IFDEF USE_EXTERNAL_HELP_VIEWER}
{$IFDEF MSWINDOWS}
htmlhelp,
{$ENDIF}
{$ENDIF}
LazFileUtils;
procedure ShowHelpTopic(AHelpContext: Word);
var
fn: UnicodeString;
begin
{$IFDEF USE_EXTERNAL_HELP_VIEWER}
{$IFDEF MSWINDOWS}
// see: http://www.helpware.net/download/delphi/hh_doc.txt
fn := UnicodeString(Application.HelpFile);
htmlhelp.HtmlHelpW(0, PWideChar(fn), HH_HELP_CONTEXT, AHelpContext);
{$ENDIF}
{$ENDIF}
end;
procedure ShowHelpTopic(AHelpID: PChar);
var
topic: UnicodeString;
begin
{$IFDEF USE_EXTERNAL_HELP_VIEWER}
{$IFDEF MSWINDOWS}
topic := UnicodeString(Application.HelpFile + '::/' + AHelpID);
htmlhelp.HtmlHelpW(0, PWideChar(topic), HH_DISPLAY_TOPIC, 0);
{$ENDIF}
{$ENDIF}
end;
{ THelpFrm }
procedure THelpFrm.FormShow(Sender: TObject);
@@ -45,8 +81,11 @@ begin
end;
procedure THelpFrm.HelpBtnClick(Sender: TObject);
var
fn: String;
begin
ShowHelpOrErrorForKeyword('','HTML/LAZTOC.html');
fn := Application.Location + 'html/LAZTOC.html';
ShowHelpOrErrorForKeyword('', SwitchPathDelims(fn, true)); //Application.Location + 'html/LAZTOC.html');
end;
initialization