-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcastle_help.pas
More file actions
50 lines (39 loc) · 1012 Bytes
/
castle_help.pas
File metadata and controls
50 lines (39 loc) · 1012 Bytes
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
unit castle_help;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw_TLB, EmbeddedWB;
type
TfrmHelp = class(TForm)
WBHelp: TEmbeddedWB;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure OpenHelp(page: string);
implementation
uses castle_utils;
{$R *.dfm}
procedure OpenHelp(page: string);
var
path: string;
begin
with TfrmHelp.Create(Screen.ActiveForm) do
begin
path := ExtractFilePath(ParamStr(0));
WBHelp.Navigate('mk:@MSITStore:' + path + '\castleclient.chm::\' + page + '.htm');
end;
end;
procedure TfrmHelp.FormClose(Sender: TObject; var Action: TCloseAction);
begin
SaveFormState('Ïîìîùü', Self);
Action := caFree;
end;
procedure TfrmHelp.FormShow(Sender: TObject);
begin
ReadFormState('Ïîìîùü', Self);
end;
end.