mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Move creation of tablecomment 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.CreateForm(TMainForm, MainForm); debug('perf: Main created.');
|
||||
|
||||
Application.CreateForm(Ttablecomment, tablecomment); debug('perf: tablecomment created.');
|
||||
Application.CreateForm(Tloaddataform, loaddataform); debug('perf: loaddata created.');
|
||||
Application.CreateForm(TprintlistForm, printlistForm); debug('perf: printlist created.');
|
||||
Application.CreateForm(TCopyTableForm, CopyTableForm); debug('perf: CopyTable created.');
|
||||
|
@ -45,7 +45,6 @@ begin
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
debug('perf: Main created.');
|
||||
|
||||
Application.CreateForm(Ttablecomment, tablecomment); debug('perf: tablecomment created.');
|
||||
Application.CreateForm(Tloaddataform, loaddataform); debug('perf: loaddata created.');
|
||||
Application.CreateForm(TprintlistForm, printlistForm); debug('perf: printlist created.');
|
||||
Application.CreateForm(TCopyTableForm, CopyTableForm); debug('perf: CopyTable created.');
|
||||
|
@ -35,7 +35,6 @@ begin
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.CreateForm(Tconnform, connform);
|
||||
Application.CreateForm(TFieldEditForm, FieldEditForm);
|
||||
Application.CreateForm(Ttablecomment, tablecomment);
|
||||
Application.CreateForm(Tloaddataform, loaddataform);
|
||||
Application.CreateForm(TUserManagerForm, UserManagerForm);
|
||||
Application.CreateForm(TprintlistForm, printlistForm);
|
||||
|
@ -3311,7 +3311,7 @@ end;
|
||||
procedure TMDIChild.MenuTableCommentClick(Sender: TObject);
|
||||
begin
|
||||
// table-comment
|
||||
tablecomment.showmodal;
|
||||
tablecommentWindow(self);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -46,6 +46,7 @@ object tablecomment: Ttablecomment
|
||||
Height = 25
|
||||
Caption = 'OK'
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
TabOrder = 1
|
||||
OnClick = ButtonOKClick
|
||||
end
|
||||
@ -56,6 +57,7 @@ object tablecomment: Ttablecomment
|
||||
Height = 25
|
||||
Cancel = True
|
||||
Caption = 'Cancel'
|
||||
ModalResult = 2
|
||||
TabOrder = 2
|
||||
OnClick = ButtonCancelClick
|
||||
end
|
||||
|
@ -30,8 +30,7 @@ type
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
tablecomment: Ttablecomment;
|
||||
function tablecommentWindow(AOwner: TComponent): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@ -39,6 +38,21 @@ uses Childwin, helpers, Main;
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
{**
|
||||
Create form on demand
|
||||
@param TComponent Owner of form (should be calling form)
|
||||
@return Boolean Form closed using modalresult mrOK
|
||||
}
|
||||
function tablecommentWindow(AOwner: TComponent): Boolean;
|
||||
var
|
||||
f : Ttablecomment;
|
||||
begin
|
||||
f := Ttablecomment.Create(AOwner);
|
||||
Result := (f.ShowModal=mrOK);
|
||||
FreeAndNil(f);
|
||||
end;
|
||||
|
||||
|
||||
procedure Ttablecomment.ButtonCancelClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
|
Reference in New Issue
Block a user