mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Move creation of printlistForm from application startup to a place where it's done on demand.
This commit is contained in:
@ -45,7 +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(TprintlistForm, printlistForm); debug('perf: printlist created.');
|
|
||||||
Application.CreateForm(TCopyTableForm, CopyTableForm); debug('perf: CopyTable created.');
|
Application.CreateForm(TCopyTableForm, CopyTableForm); debug('perf: CopyTable created.');
|
||||||
Application.CreateForm(TFormEditUser, FormEditUser); debug('perf: EditUser created.');
|
Application.CreateForm(TFormEditUser, FormEditUser); debug('perf: EditUser created.');
|
||||||
Application.CreateForm(TfrmSQLhelp, frmSQLhelp); debug('perf: frmSQLhelp created.');
|
Application.CreateForm(TfrmSQLhelp, frmSQLhelp); debug('perf: frmSQLhelp created.');
|
||||||
|
@ -45,7 +45,6 @@ begin
|
|||||||
Application.CreateForm(TMainForm, MainForm);
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
debug('perf: Main created.');
|
debug('perf: Main created.');
|
||||||
|
|
||||||
Application.CreateForm(TprintlistForm, printlistForm); debug('perf: printlist created.');
|
|
||||||
Application.CreateForm(TCopyTableForm, CopyTableForm); debug('perf: CopyTable created.');
|
Application.CreateForm(TCopyTableForm, CopyTableForm); debug('perf: CopyTable created.');
|
||||||
Application.CreateForm(TFormEditUser, FormEditUser); debug('perf: EditUser created.');
|
Application.CreateForm(TFormEditUser, FormEditUser); debug('perf: EditUser created.');
|
||||||
Application.CreateForm(TfrmSQLhelp, frmSQLhelp); debug('perf: frmSQLhelp created.');
|
Application.CreateForm(TfrmSQLhelp, frmSQLhelp); debug('perf: frmSQLhelp created.');
|
||||||
|
@ -36,7 +36,6 @@ begin
|
|||||||
Application.CreateForm(Tconnform, connform);
|
Application.CreateForm(Tconnform, connform);
|
||||||
Application.CreateForm(TFieldEditForm, FieldEditForm);
|
Application.CreateForm(TFieldEditForm, FieldEditForm);
|
||||||
Application.CreateForm(TUserManagerForm, UserManagerForm);
|
Application.CreateForm(TUserManagerForm, UserManagerForm);
|
||||||
Application.CreateForm(TprintlistForm, printlistForm);
|
|
||||||
Application.CreateForm(TCopyTableForm, CopyTableForm);
|
Application.CreateForm(TCopyTableForm, CopyTableForm);
|
||||||
Application.CreateForm(TFormEditUser, FormEditUser);
|
Application.CreateForm(TFormEditUser, FormEditUser);
|
||||||
Application.Run;
|
Application.Run;
|
||||||
|
@ -789,7 +789,7 @@ begin
|
|||||||
// TODO: Print data
|
// TODO: Print data
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
printlistform.showmodal;
|
printlistWindow(self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ object printlistForm: TprintlistForm
|
|||||||
Height = 25
|
Height = 25
|
||||||
Cancel = True
|
Cancel = True
|
||||||
Caption = 'Cancel'
|
Caption = 'Cancel'
|
||||||
|
ModalResult = 2
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
OnClick = Button2Click
|
OnClick = Button2Click
|
||||||
end
|
end
|
||||||
@ -122,6 +123,7 @@ object printlistForm: TprintlistForm
|
|||||||
Height = 25
|
Height = 25
|
||||||
Caption = 'Print'
|
Caption = 'Print'
|
||||||
Default = True
|
Default = True
|
||||||
|
ModalResult = 1
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
OnClick = Button3Click
|
OnClick = Button3Click
|
||||||
end
|
end
|
||||||
|
@ -36,8 +36,7 @@ type
|
|||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
function printlistWindow(AOwner: TComponent): Boolean;
|
||||||
printlistForm: TprintlistForm;
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -45,6 +44,21 @@ uses childwin, main;
|
|||||||
|
|
||||||
{$R *.DFM}
|
{$R *.DFM}
|
||||||
|
|
||||||
|
{**
|
||||||
|
Create form on demand
|
||||||
|
@param TComponent Owner of form (should be calling form)
|
||||||
|
@return Boolean Form closed using modalresult mrOK
|
||||||
|
}
|
||||||
|
function printlistWindow(AOwner: TComponent): Boolean;
|
||||||
|
var
|
||||||
|
f : TprintlistForm;
|
||||||
|
begin
|
||||||
|
f := TprintlistForm.Create(AOwner);
|
||||||
|
Result := (f.ShowModal=mrOK);
|
||||||
|
FreeAndNil(f);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TprintlistForm.FormShow(Sender: TObject);
|
procedure TprintlistForm.FormShow(Sender: TObject);
|
||||||
var
|
var
|
||||||
i,t : Integer;
|
i,t : Integer;
|
||||||
|
Reference in New Issue
Block a user