mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Move creation of SQLhelp from application startup to a place where it's done on demand.
Move public property keyword to the private context as it is no longer accessed from outside.
This commit is contained in:
@ -45,8 +45,6 @@ begin
|
|||||||
Application.Title := APPNAME;
|
Application.Title := APPNAME;
|
||||||
Application.CreateForm(TMainForm, MainForm); debug('perf: Main created.');
|
Application.CreateForm(TMainForm, MainForm); debug('perf: Main created.');
|
||||||
|
|
||||||
Application.CreateForm(TfrmSQLhelp, frmSQLhelp); debug('perf: frmSQLhelp created.');
|
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
try
|
try
|
||||||
|
@ -45,8 +45,6 @@ begin
|
|||||||
Application.CreateForm(TMainForm, MainForm);
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
debug('perf: Main created.');
|
debug('perf: Main created.');
|
||||||
|
|
||||||
Application.CreateForm(TfrmSQLhelp, frmSQLhelp); debug('perf: frmSQLhelp created.');
|
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
try
|
try
|
||||||
|
@ -4290,8 +4290,7 @@ end;
|
|||||||
procedure TMDIChild.CallSQLHelpWithKeyword( keyword: String );
|
procedure TMDIChild.CallSQLHelpWithKeyword( keyword: String );
|
||||||
begin
|
begin
|
||||||
// Set help-keyword and show window
|
// Set help-keyword and show window
|
||||||
frmSQLhelp.keyword := keyword;
|
SQLhelpWindow(self, keyword);
|
||||||
frmSQLhelp.Show;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMDIChild.ToolButton4Click(Sender: TObject);
|
procedure TMDIChild.ToolButton4Click(Sender: TObject);
|
||||||
|
@ -202,6 +202,7 @@ object frmSQLhelp: TfrmSQLhelp
|
|||||||
Cancel = True
|
Cancel = True
|
||||||
Caption = 'Close'
|
Caption = 'Close'
|
||||||
Default = True
|
Default = True
|
||||||
|
ModalResult = 1
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnClick = ButtonCloseClick
|
OnClick = ButtonCloseClick
|
||||||
end
|
end
|
||||||
|
@ -40,9 +40,9 @@ type
|
|||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
m : TMDIChild;
|
m : TMDIChild;
|
||||||
|
Keyword: String;
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
Keyword: String;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -51,8 +51,7 @@ type
|
|||||||
ICONINDEX_CATEGORY_OPENED : Integer = 97;
|
ICONINDEX_CATEGORY_OPENED : Integer = 97;
|
||||||
ICONINDEX_HELPITEM : Integer = 98;
|
ICONINDEX_HELPITEM : Integer = 98;
|
||||||
|
|
||||||
var
|
function SQLhelpWindow(AOwner: TComponent; Keyword: String = ''): Boolean;
|
||||||
frmSQLhelp : TfrmSQLhelp;
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -64,6 +63,22 @@ uses ZDataset, helpers, main, db;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{**
|
||||||
|
Create form on demand
|
||||||
|
@param TComponent Owner of form (should be calling form)
|
||||||
|
@return Boolean Form closed using modalresult mrOK
|
||||||
|
}
|
||||||
|
function SQLhelpWindow(AOwner: TComponent; Keyword: String = ''): Boolean;
|
||||||
|
var
|
||||||
|
f : TfrmSQLhelp;
|
||||||
|
begin
|
||||||
|
f := TfrmSQLhelp.Create(AOwner);
|
||||||
|
f.Keyword := Keyword;
|
||||||
|
Result := (f.ShowModal=mrOK);
|
||||||
|
FreeAndNil(f);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{***
|
{***
|
||||||
Startup
|
Startup
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user