~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to components/chmhelp/packages/idehelp/lazchmhelp.pas

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
  to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16
16
  MA 02111-1307, USA.
17
17
}
18
 
 
19
18
unit LazChmHelp;
20
19
 
21
20
{$mode objfpc}{$H+}
23
22
interface
24
23
 
25
24
uses
26
 
  Classes, SysUtils, FileUtil, LazHelpIntf, HelpIntfs, LazConfigStorage,
27
 
  PropEdits, LHelpControl, Controls;
 
25
  Classes, SysUtils, FileUtil, LazLogger, LazFileUtils, LazHelpIntf, HelpIntfs,
 
26
  LazConfigStorage, PropEdits, LazIDEIntf, LHelpControl, Controls, UTF8Process,
 
27
  ChmLangRef, ChmLcl, ChmProg;
28
28
  
29
29
type
30
30
  
35
35
    fHelpExe: String;
36
36
    fHelpLabel: String;
37
37
    fHelpConnection: TLHelpConnection;
38
 
    fChmsFilePath: String;
39
 
    function GetHelpEXE: String;
40
 
    function DBFindViewer(HelpDB: THelpDatabase; const MimeType: string;
41
 
      var ErrMsg: string; out Viewer: THelpViewer): TShowHelpResult;
 
38
    fCHMSearchPath: String;
 
39
    fHelpExeParams: String;
 
40
    function DBFindViewer({%H-}HelpDB: THelpDatabase; {%H-}const MimeType: string;
 
41
      var {%H-}ErrMsg: string; out Viewer: THelpViewer): TShowHelpResult;
42
42
    function GetHelpLabel: String;
 
43
    procedure SetChmsFilePath(const AValue: String);
 
44
    procedure SetHelpEXE(AValue: String);
43
45
  protected
44
46
    function GetFileNameAndURL(RawUrl: String; out FileName: String; out URL: String): Boolean;
45
 
    procedure SetHelpEXE(AValue: String);
46
47
    procedure SetHelpLabel(AValue: String);
47
48
    function CheckBuildLHelp: Integer; // modal result
48
49
    function GetLazBuildEXE(out ALazBuild: String): Boolean;
51
52
    constructor Create(TheOwner: TComponent); override;
52
53
    destructor Destroy; override;
53
54
    function SupportsTableOfContents: boolean; override;
54
 
    procedure ShowTableOfContents(Node: THelpNode); override;
 
55
    procedure ShowTableOfContents({%H-}Node: THelpNode); override;
55
56
    function SupportsMimeType(const AMimeType: string): boolean; override;
56
57
    function ShowNode(Node: THelpNode; var ErrMsg: string): TShowHelpResult; override;
57
58
    //procedure Hide; virtual;
59
60
    procedure Load(Storage: TConfigStorage); override;
60
61
    procedure Save(Storage: TConfigStorage); override;
61
62
    function GetLocalizedName: string; override;
 
63
    function GetHelpEXE: String; // macros resolved, see property HelpEXE
 
64
    function GetHelpFilesPath: String; // macros resolved, see property HelpFilesPath
62
65
  published
63
 
    property HelpEXE: String read GetHelpEXE write SetHelpEXE;
 
66
    property HelpEXE: String read fHelpEXE write SetHelpEXE; // with macros, see GetHelpEXE
64
67
    property HelpLabel: String read GetHelpLabel write SetHelpLabel;
65
 
    property HelpFilesPath: String read fChmsFilePath write fChmsFilePath;
66
 
 
 
68
    property HelpFilesPath: String read fCHMSearchPath write SetChmsFilePath; // directories separated with semicolon, with macros, see GetHelpFilesPath
 
69
    property HelpExeParams: String read fHelpExeParams write fHelpExeParams;
67
70
  end;
68
71
  
69
72
  procedure Register;
70
73
 
71
74
implementation
 
75
 
72
76
uses Process, MacroIntf, InterfaceBase, Forms, Dialogs, HelpFPDoc, IDEMsgIntf;
73
77
 
74
 
function FixSlash(AStr: String): String;
75
 
var
76
 
  WrongSlash: String;
77
 
  FP: Integer;
78
 
begin
79
 
  Result := AStr;
80
 
  case PathDelim of
81
 
    '/': WrongSlash := '\';
82
 
    '\': WrongSlash := '/';
83
 
  end;
84
 
  // fix wrong delim
85
 
  repeat
86
 
    FP := Pos(WrongSlash, Result);
87
 
    if FP > 0 then
88
 
      Result[FP] := PathDelim;
89
 
  until FP = 0;
90
 
  // fix double path delim
91
 
  repeat
92
 
    FP := Pos(PathDelim+PathDelim, Result);
93
 
    if FP <> 0 then
94
 
      Delete(Result, FP, 1);
95
 
  until FP = 0;
96
 
end;
97
 
 
98
78
{ TChmHelpViewer }
99
79
 
100
80
function TChmHelpViewer.DBFindViewer(HelpDB: THelpDatabase;
112
92
  Result := fHelpLabel;
113
93
end;
114
94
 
 
95
procedure TChmHelpViewer.SetChmsFilePath(const AValue: String);
 
96
var
 
97
  p: String;
 
98
begin
 
99
  if fCHMSearchPath = AValue then Exit;
 
100
  fCHMSearchPath := AppendPathDelim(AValue);
 
101
  p:=GetHelpFilesPath;
 
102
  if Assigned(LangRefHelpDatabase) then
 
103
    LangRefHelpDatabase.LoadKeywordList(p);
 
104
  if Assigned(FPCDirectivesHelpDatabase) then
 
105
    FPCDirectivesHelpDatabase.CHMSearchPath := p;
 
106
end;
 
107
 
 
108
procedure TChmHelpViewer.SetHelpEXE(AValue: String);
 
109
begin
 
110
  if fHelpEXE=AValue then Exit;
 
111
  fHelpEXE:=AValue;
 
112
end;
 
113
 
115
114
function TChmHelpViewer.GetHelpEXE: String;
116
115
begin
117
 
  if fHelpExe <> '' then
118
 
    Exit(fHelpExe);
119
 
  Result := '$(LazarusDir)/components/chmhelp/lhelp/lhelp$(ExeExt)';
 
116
  Result:=fHelpExe;
 
117
  if Result='' then
 
118
    Result := SetDirSeparators('$(LazarusDir)/components/chmhelp/lhelp/lhelp$(ExeExt)');
120
119
  if not IDEMacros.SubstituteMacros(Result) then
121
120
    Exit('');
122
 
  Result := FixSlash(Result);
 
121
end;
 
122
 
 
123
function TChmHelpViewer.GetHelpFilesPath: String;
 
124
begin
 
125
  Result:=fCHMSearchPath;
 
126
  if Result='' then
 
127
    Result:='$(LazarusDir)/docs/html;$(LazarusDir)/docs/html/lcl;$(LazarusDir)/docs/chm';
 
128
  IDEMacros.SubstituteMacros(Result);
 
129
  Result:=MinimizeSearchPath(SetDirSeparators(Result));
123
130
end;
124
131
 
125
132
function TChmHelpViewer.GetFileNameAndURL(RawUrl:String; out FileName: String; out URL: String
126
133
  ): Boolean;
127
134
var
128
 
fPos: Integer;
 
135
  fPos: Integer;
129
136
begin
130
137
  Result := False;
131
138
 
136
143
  Result := True;
137
144
end;
138
145
 
139
 
procedure TChmHelpViewer.SetHelpEXE(AValue: String);
140
 
begin
141
 
  fHelpExe := AValue;
142
 
end;
143
 
 
144
146
procedure TChmHelpViewer.SetHelpLabel(AValue: String);
145
147
var
146
148
  i: Integer;
153
155
 
154
156
function TChmHelpViewer.CheckBuildLHelp: Integer;
155
157
var
156
 
  Proc: TProcess;
 
158
  Proc: TProcessUTF8;
157
159
  Lazbuild: String;
158
160
  LHelpProject: String;
159
161
  WS: String;
160
162
  LastWasEOL: Boolean;
161
 
  EOLP: Integer;
162
163
  BufC: Char;
163
164
  Buffer: array[0..511] of char;
164
165
  BufP: Integer;
 
166
  PCP: String;
165
167
begin
166
168
  Result := mrCancel;
167
169
 
168
 
  if FileExistsUTF8(HelpExe) = True then
 
170
  if FileExistsUTF8(GetHelpExe) then
169
171
    Exit(mrOK);
170
172
 
171
173
  if not GetLazBuildEXE(Lazbuild) then
172
 
    Exit;
173
 
 
174
 
  LHelpProject := FixSlash('$(LazarusDir)/components/chmhelp/lhelp/lhelp.lpi');
175
 
 
176
 
  if not (IDEMacros.SubstituteMacros(LHelpProject)
177
 
          and FileExistsUTF8(LHelpProject))
178
 
  then
179
 
    Exit;
180
 
 
181
 
  WS := ' --ws='+LCLPlatformDirNames[WidgetSet.LCLPlatform]+' ';
 
174
  begin
 
175
    debugln(['TChmHelpViewer.CheckBuildLHelp failed because lazbuild not found']);
 
176
    Exit;
 
177
  end;
 
178
 
 
179
  LHelpProject := '$(LazarusDir)/components/chmhelp/lhelp/lhelp.lpi';
 
180
  if not IDEMacros.SubstituteMacros(LHelpProject) then exit;
 
181
  LHelpProject:=TrimFilename(SetDirSeparators(LHelpProject));
 
182
  if not FileExistsUTF8(LHelpProject) then
 
183
  begin
 
184
    debugln(['TChmHelpViewer.CheckBuildLHelp failed because lhelp.lpi not found']);
 
185
    Exit;
 
186
  end;
 
187
 
 
188
  WS := '--ws='+LCLPlatformDirNames[WidgetSet.LCLPlatform];
 
189
  PCP := '--pcp='+LazarusIDE.GetPrimaryConfigPath;
182
190
 
183
191
  //Result := MessageDlg('The help viewer is not compiled yet. Try to compile it now?', mtConfirmation, mbYesNo ,0);
184
192
  //if Result <> mrYes then
185
193
  //  Exit;
186
194
 
187
 
  Proc := TProcess.Create(nil);
188
 
  Proc.CommandLine := Lazbuild + WS + LHelpProject;
 
195
  Proc := TProcessUTF8.Create(nil);
 
196
  {$if (fpc_version=2) and (fpc_release<5)}
 
197
  Proc.CommandLine := Lazbuild+' '+WS+' '+PCP+' '+LHelpProject;
 
198
  {$else}
 
199
  Proc.Executable := Lazbuild;
 
200
  Proc.Parameters.Add(WS);
 
201
  Proc.Parameters.Add(PCP);
 
202
  Proc.Parameters.Add(LHelpProject);
 
203
  {$endif}
189
204
  Proc.Options := [poUsePipes, poStderrToOutPut];
 
205
  debugln(['TChmHelpViewer.CheckBuildLHelp running "',Lazbuild,' ',WS,' ',PCP,' ',LHelpProject,'" ...']);
190
206
  Proc.Execute;
191
207
 
192
208
 
196
212
  IDEMessagesWindow.BeginBlock;
197
213
  IDEMessagesWindow.AddMsg('- Building lhelp -','',0);
198
214
 
199
 
  LHelpProject := FixSlash('$(LazarusDir)/components/chmhelp/lhelp/');
 
215
  LHelpProject := '$(LazarusDir)/components/chmhelp/lhelp/';
200
216
  IDEMacros.SubstituteMacros(LHelpProject);
 
217
  LHelpProject:=TrimFilename(SetDirSeparators(LHelpProject));
 
218
 
201
219
  while Proc.Running do begin
202
220
    while Proc.Output.NumBytesAvailable > 0 do
203
221
    begin
245
263
end;
246
264
 
247
265
function TChmHelpViewer.GetLazBuildEXE(out ALazBuild: String): Boolean;
248
 
var
249
 
  LazBuildMacro: String;
250
266
begin
251
 
   Result := False;
252
 
   LazBuildMacro:= '$(LazarusDir)/$MakeExe(lazbuild)';
253
 
   Result := IDEMacros.SubstituteMacros(LazBuildMacro)
254
 
             and FileExistsUTF8(LazBuildMacro);
255
 
   if Result then
256
 
     ALazBuild := FixSlash(LazBuildMacro);
 
267
  Result := False;
 
268
  ALazBuild:= '$(LazarusDir)/$MakeExe(lazbuild)';
 
269
  if not IDEMacros.SubstituteMacros(ALazBuild) then exit;
 
270
  ALazBuild:=TrimFilename(SetDirSeparators(ALazBuild));
 
271
  Result:=FileExistsUTF8(ALazBuild);
257
272
end;
258
273
 
259
274
function TChmHelpViewer.PassTheBuck(Node: THelpNode; var ErrMsg: string
319
334
 
320
335
function TChmHelpViewer.SupportsMimeType(const AMimeType: string): boolean;
321
336
begin
322
 
  REsult := inherited;
 
337
  Result := inherited;
323
338
end;
324
339
 
325
340
function TChmHelpViewer.ShowNode(Node: THelpNode; var ErrMsg: string
326
341
  ): TShowHelpResult;
327
342
var
328
 
FileName: String;
329
 
Url: String;
330
 
Res: TLHelpResponse;
331
 
DocsDir: String;
 
343
  FileName: String;
 
344
  Url: String;
 
345
  Res: TLHelpResponse;
 
346
  SearchPath: String;
 
347
  Proc: TProcessUTF8;
 
348
  FoundFileName: String;
 
349
  LHelpPath: String;
332
350
begin
333
351
  if Pos('file://', Node.URL) = 1 then
334
352
  begin
336
354
    Exit;
337
355
  end;
338
356
  Result:=shrNone;
339
 
  if CheckBuildLHelp <> mrOK then begin
340
 
    ErrMsg := 'The program "' + HelpEXE + '" doesn''t seem to exist'+LineEnding+
 
357
  if (ExtractFileNameOnly(GetHelpEXE) = 'lhelp') and (CheckBuildLHelp <> mrOK) then begin
 
358
    ErrMsg := 'The program "' + GetHelpEXE + '" doesn''t seem to exist'+LineEnding+
341
359
              'or could not be built!';
342
360
    Exit(shrViewerNotFound);
343
361
  end;
346
364
    Exit(shrDatabaseNotFound);
347
365
  end;
348
366
 
349
 
  if HelpFilesPath = '' then
 
367
  SearchPath := GetHelpFilesPath;
 
368
  FoundFileName:=SearchFileInPath(Filename,'',SearchPath,';',[]);
 
369
  debugln(['TChmHelpViewer.ShowNode Filename="',Filename,'" SearchPath="',SearchPath,'" Found="',FoundFileName,'"']);
 
370
 
 
371
  if FoundFileName='' then
350
372
  begin
351
 
    DocsDir := FixSlash('$(LazarusDir)/docs/html/');
352
 
    IDEMacros.SubstituteMacros(DocsDir);
353
 
    if not FileExistsUTF8(DocsDir+FileName) then
 
373
    Result := shrDatabaseNotFound;
 
374
    ErrMsg := FileName +' not found. Please put the chm help files in '+ LineEnding
 
375
                       +SearchPath+  LineEnding
 
376
                       +' or set the path to lcl.chm rtl.chm fcl.chm with "HelpFilesPath" in '
 
377
                       +' Environment Options -> Help -> Help Options ->'+LineEnding
 
378
                       +' under HelpViewers - CHMHelpViewer';
 
379
    Exit;
 
380
  end;
 
381
 
 
382
  FileName := CleanAndExpandFilename(FoundFileName);
 
383
 
 
384
  if ExtractFileNameOnly(GetHelpExe) = 'lhelp' then begin
 
385
    fHelpConnection.StartHelpServer(HelpLabel, GetHelpExe);
 
386
    Res := fHelpConnection.OpenURL(FileName, Url);
 
387
  end else begin
 
388
    if Trim(fHelpExeParams) = '' then
354
389
    begin
355
 
      Result := shrDatabaseNotFound;
356
 
      ErrMsg := FileName +' not found. Please put the chm help files in '+ LineEnding
357
 
                         +DocsDir+  LineEnding
358
 
                         +' or set the path to lcl.chm rtl.chm fcl.chm with "HelpFilesPath" in '
359
 
                         +' Environment Options -> Help -> Help Options ->'+LineEnding
360
 
                         +' under HelpViewers - CHMHelpViewer';
 
390
      Result := shrViewerError;
 
391
      ErrMsg := 'If you do not use "lhelp" as viewer you have to setup '
 
392
              + 'HelpExeParams correctly in' + sLineBreak
 
393
              + 'Tools -> Options -> Help -> Help Options -> '
 
394
              + 'under HelpViewers - CHM Help Viewer' + sLineBreak
 
395
              + 'e.g. for HH.EXE (HTML Help in Windows) it must be' + sLineBreak
 
396
              + '  "%s::%s"' + sLineBreak
 
397
              + 'where first %s will be replaced by CHM file name' + sLineBreak
 
398
              + 'and the second one will be replaced by URL';
361
399
      Exit;
362
400
    end;
363
 
 
364
 
  end
365
 
  else
366
 
    DocsDir := fChmsFilePath;
367
 
 
368
 
  FileName := IncludeTrailingPathDelimiter(DocsDir)+FileName;
369
 
 
370
 
  fHelpConnection.StartHelpServer(HelpLabel, HelpExe);
371
 
  Res := fHelpConnection.OpenURL(FileName, Url);
 
401
    Proc := TProcessUTF8.Create(nil);
 
402
    try
 
403
      {$if (fpc_version=2) and (fpc_release<5)}
 
404
      Proc.CommandLine := GetHelpExe + ' ' + Format(fHelpExeParams, [FileName, Url]);
 
405
      {$else}
 
406
      LHelpPath:=GetHelpEXE;
 
407
      Proc.Executable := LHelpPath;
 
408
      {$IFDEF darwin}
 
409
      debugln(['TChmHelpViewer.ShowNode LHelpPath=',LHelpPath]);
 
410
      if DirectoryExistsUTF8(LHelpPath+'.app') then
 
411
        LHelpPath+='.app';
 
412
      if DirectoryExistsUTF8(LHelpPath) then begin
 
413
        // application bundle
 
414
        // to put lhelp into the foreground, use "open -n lhelp.app --args args"
 
415
        Proc.Executable := '/usr/bin/open';
 
416
        Proc.Parameters.Add('-n');
 
417
        Proc.Parameters.Add(LHelpPath);
 
418
        Proc.Parameters.Add('--args');
 
419
        Proc.Parameters.Add(Format(fHelpExeParams, [FileName, Url]));
 
420
      end;
 
421
      {$ENDIF}
 
422
      Proc.Parameters.Add(Format(fHelpExeParams, [FileName, Url]));
 
423
      {$endif}
 
424
      debugln(['TChmHelpViewer.ShowNode Executable=',Proc.Executable,' Params="',dbgstr(Proc.Parameters.Text),'"']);
 
425
      Proc.Execute;
 
426
      Res := srSuccess;
 
427
    except
 
428
      Res := srUnknown;
 
429
    end;
 
430
    Proc.Free;
 
431
  end;
372
432
 
373
433
  case Res of
374
434
    srSuccess: Result := shrSuccess;
397
457
procedure TChmHelpViewer.Load(Storage: TConfigStorage);
398
458
begin
399
459
  HelpEXE:=Storage.GetValue('CHMHelp/Exe','');
 
460
  HelpExeParams := Storage.GetValue('CHMHelp/ExeParams','');
400
461
  HelpLabel:=Storage.GetValue('CHMHelp/Name','lazhelp');
401
462
  HelpFilesPath := Storage.GetValue('CHMHelp/FilesPath','');
402
463
end;
404
465
procedure TChmHelpViewer.Save(Storage: TConfigStorage);
405
466
begin
406
467
  Storage.SetDeleteValue('CHMHelp/Exe',HelpEXE,'');
 
468
  Storage.SetDeleteValue('CHMHelp/ExeParams',HelpExeParams,'');
407
469
  Storage.SetDeleteValue('CHMHelp/Name',HelpLabel,'lazhelp');
408
470
  Storage.SetDeleteValue('CHMHelp/FilesPath',HelpFilesPath,'');
409
471
end;
419
481
begin
420
482
  ChmHelp := TChmHelpViewer.Create(nil);
421
483
  HelpViewers.RegisterViewer(ChmHelp);
 
484
  RegisterLangRefHelpDatabase;
 
485
  LangRefHelpDatabase.OnFindViewer := @ChmHelp.DBFindViewer;
 
486
  RegisterLclHelpDatabase;
 
487
  LCLHelpDatabase.OnFindViewer := @ChmHelp.DBFindViewer;
 
488
  RegisterFPCDirectivesHelpDatabase;
 
489
  FPCDirectivesHelpDatabase.OnFindViewer := @ChmHelp.DBFindViewer;
422
490
end;
423
491
 
424
492
initialization
425
493
  RegisterPropertyEditor(TypeInfo(AnsiString),
426
 
    TCHmHelpViewer,'HelpEXE',TFileNamePropertyEditor);
 
494
    TChmHelpViewer,'HelpEXE',TFileNamePropertyEditor);
427
495
  RegisterPropertyEditor(TypeInfo(AnsiString),
428
 
    TCHmHelpViewer,'HelpFilesPath',TFileNamePropertyEditor);
 
496
    TChmHelpViewer,'HelpFilesPath',TDirectoryPropertyEditor);
429
497
end.
430
498