You've already forked lazarus-ccr
LazStats: Move chmhelp conponents from DataModule to MainForm.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7619 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
object MainDataModule: TMainDataModule
|
object MainDataModule: TMainDataModule
|
||||||
OnCreate = DataModuleCreate
|
|
||||||
OldCreateOrder = False
|
OldCreateOrder = False
|
||||||
Height = 143
|
Height = 143
|
||||||
HorizontalOffset = 817
|
HorizontalOffset = 817
|
||||||
|
@ -5,7 +5,7 @@ unit MainDM;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Controls, LazHelpCHM;
|
Classes, SysUtils, LResources, Controls;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -13,12 +13,9 @@ type
|
|||||||
|
|
||||||
TMainDataModule = class(TDataModule)
|
TMainDataModule = class(TDataModule)
|
||||||
ImageList: TImageList;
|
ImageList: TImageList;
|
||||||
procedure DataModuleCreate(Sender: TObject);
|
|
||||||
private
|
private
|
||||||
|
|
||||||
public
|
public
|
||||||
CHMHelpDatabase: TCHMHelpDatabase;
|
|
||||||
LHelpConnector: TLHelpConnector;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -27,18 +24,6 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{ TMainDataModule }
|
|
||||||
|
|
||||||
procedure TMainDataModule.DataModuleCreate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
CHMHelpDatabase := TCHMHelpDatabase.Create(self);
|
|
||||||
CHMHelpDatabase.KeywordPrefix := 'html';
|
|
||||||
CHMHelpDatabase.AutoRegister := true;
|
|
||||||
|
|
||||||
LHelpConnector := TLHelpConnector.Create(self);
|
|
||||||
LHelpConnector.AutoRegister := true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I maindm.lrs}
|
{$I maindm.lrs}
|
||||||
|
|
||||||
|
@ -23,6 +23,13 @@ interface
|
|||||||
uses
|
uses
|
||||||
LCLType, Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics,
|
LCLType, Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics,
|
||||||
Dialogs, Menus, ExtCtrls, StdCtrls, Grids,
|
Dialogs, Menus, ExtCtrls, StdCtrls, Grids,
|
||||||
|
{$IFDEF USE_EXTERNAL_HELP_VIEWER}
|
||||||
|
{$IFDEF MSWINDOWS}
|
||||||
|
HtmlHelp,
|
||||||
|
{$ENDIF}
|
||||||
|
{$ELSE}
|
||||||
|
LazHelpIntf, LazHelpCHM,
|
||||||
|
{$ENDIF}
|
||||||
Globals, DataProcs, DictionaryUnit, MainDM;
|
Globals, DataProcs, DictionaryUnit, MainDM;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -439,7 +446,10 @@ type
|
|||||||
{ private declarations }
|
{ private declarations }
|
||||||
{$IFDEF USE_EXTERNAL_HELP_VIEWER}
|
{$IFDEF USE_EXTERNAL_HELP_VIEWER}
|
||||||
function HelpHandler(Command: Word; Data: PtrInt; var CallHelp: Boolean): Boolean;
|
function HelpHandler(Command: Word; Data: PtrInt; var CallHelp: Boolean): Boolean;
|
||||||
{$ENDIF}
|
{$ELSE}
|
||||||
|
CHMHelpDatabase: TCHMHelpDatabase;
|
||||||
|
LHelpConnector: TLHelpConnector;
|
||||||
|
{$ENDIF}
|
||||||
procedure Init;
|
procedure Init;
|
||||||
public
|
public
|
||||||
{ public declarations }
|
{ public declarations }
|
||||||
@ -453,15 +463,7 @@ var
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF USE_EXTERNAL_HELP_VIEWER}
|
Utils, OptionsUnit, OutputUnit, LicenseUnit, TransFrmUnit, DescriptiveUnit,
|
||||||
{$IFDEF MSWINDOWS}
|
|
||||||
HtmlHelp,
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
|
||||||
LazHelpIntf,
|
|
||||||
{$ENDIF}
|
|
||||||
Utils,
|
|
||||||
OptionsUnit, OutputUnit, LicenseUnit, TransFrmUnit, DescriptiveUnit,
|
|
||||||
FreqUnit, CrossTabUnit, BreakDownUnit, BoxPlotUnit, NormalityUnit, Rot3DUnit,
|
FreqUnit, CrossTabUnit, BreakDownUnit, BoxPlotUnit, NormalityUnit, Rot3DUnit,
|
||||||
PlotXYUnit, BubblePlotUnit, StemLeafUnit, MultXvsYUnit, OneSampUnit,
|
PlotXYUnit, BubblePlotUnit, StemLeafUnit, MultXvsYUnit, OneSampUnit,
|
||||||
TwoCorrsUnit, TwoPropUnit, TtestUnit, BlkAnovaUnit, WithinANOVAUnit,
|
TwoCorrsUnit, TwoPropUnit, TtestUnit, BlkAnovaUnit, WithinANOVAUnit,
|
||||||
@ -487,6 +489,9 @@ uses
|
|||||||
MedianPolishUnit, OneCaseAnovaUnit, SmoothDataUnit, SRHTestUnit, AboutUnit,
|
MedianPolishUnit, OneCaseAnovaUnit, SmoothDataUnit, SRHTestUnit, AboutUnit,
|
||||||
ItemBankingUnit, ANOVATESTSUnit, SimpleChiSqrUnit, LifeTableUnit, LSMRunit;
|
ItemBankingUnit, ANOVATESTSUnit, SimpleChiSqrUnit, LifeTableUnit, LSMRunit;
|
||||||
|
|
||||||
|
const
|
||||||
|
HELP_KEYWORD_PREFIX = 'html';
|
||||||
|
|
||||||
{ TOS3MainFrm }
|
{ TOS3MainFrm }
|
||||||
|
|
||||||
// Menu "Options" > "Exit"
|
// Menu "Options" > "Exit"
|
||||||
@ -1318,8 +1323,15 @@ begin
|
|||||||
lhelpfn := Application.Location + 'lhelp' + GetExeExt;
|
lhelpfn := Application.Location + 'lhelp' + GetExeExt;
|
||||||
if FileExists(lhelpfn) then
|
if FileExists(lhelpfn) then
|
||||||
begin
|
begin
|
||||||
Maindatamodule.LHelpConnector.LHelpPath := lhelpfn;
|
CHMHelpDatabase := TCHMHelpDatabase.Create(self);
|
||||||
MainDatamodule.CHMHelpDatabase.Filename := helpfn;
|
CHMHelpDatabase.KeywordPrefix := HELP_KEYWORD_PREFIX;
|
||||||
|
CHMHelpDatabase.AutoRegister := true;
|
||||||
|
CHMHelpDatabase.Filename := helpfn;
|
||||||
|
|
||||||
|
LHelpConnector := TLHelpConnector.Create(self);
|
||||||
|
LHelpConnector.AutoRegister := true;
|
||||||
|
LHelpConnector.LHelpPath := lhelpfn;
|
||||||
|
|
||||||
//CreateLCLHelpSystem;
|
//CreateLCLHelpSystem;
|
||||||
end else
|
end else
|
||||||
MessageDlg('Help viewer LHelp.exe not found.' + LineEnding +
|
MessageDlg('Help viewer LHelp.exe not found.' + LineEnding +
|
||||||
@ -1634,8 +1646,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
s := PChar(Data); // Data is pointer to HelpKeyword here, but
|
s := PChar(Data); // Data is pointer to HelpKeyword here, but
|
||||||
// the Windows help viewer does not want the KeywordPrefix required for LHelp.
|
// the Windows help viewer does not want the KeywordPrefix required for LHelp.
|
||||||
if pos(MainDataModule.CHMHelpDatabase.KeywordPrefix + '/', s) = 1 then
|
if pos(HELP_KEYWORD_PREFIX + '/', s) = 1 then
|
||||||
Delete(s, 1, Length(MainDatamodule.CHMHelpDatabase.KeywordPrefix)+1);
|
Delete(s, 1, Length(HELP_KEYWORD_PREFIX) + 1);
|
||||||
ws := UnicodeString(Application.HelpFile + '::/' + s);
|
ws := UnicodeString(Application.HelpFile + '::/' + s);
|
||||||
res := htmlhelp.HtmlHelpW(0, PWideChar(ws), HH_DISPLAY_TOPIC, 0);
|
res := htmlhelp.HtmlHelpW(0, PWideChar(ws), HH_DISPLAY_TOPIC, 0);
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user