Replace remaining loadXYZwindow() functions for dialogs by a more native way.

This commit is contained in:
Ansgar Becker
2010-02-21 10:44:55 +00:00
parent bf4639360b
commit 0e271ee7de
3 changed files with 10 additions and 34 deletions

View File

@ -42,8 +42,6 @@ type
{ Public declarations }
end;
function CopyTableWindow(AOwner: TComponent): Boolean;
implementation
@ -51,19 +49,6 @@ uses 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 CopyTableWindow(AOwner: TComponent): Boolean;
var
f : TCopyTableForm;
begin
f := TCopyTableForm.Create(AOwner);
Result := (f.ShowModal=mrOK);
FreeAndNil(f);
end;
procedure TCopyTableForm.radioStructureClick(Sender: TObject);

View File

@ -72,7 +72,6 @@ type
{ Public declarations }
end;
function loaddataWindow(AOwner: TComponent): Boolean;
implementation
@ -81,20 +80,6 @@ uses Main, helpers;
{$R *.DFM}
{**
Create form on demand
@param TComponent Owner of form (should be calling form)
@return Boolean Form closed using modalresult mrOK
}
function loaddataWindow(AOwner: TComponent): Boolean;
var
f : Tloaddataform;
begin
f := Tloaddataform.Create(AOwner);
Result := (f.ShowModal=mrOK);
FreeAndNil(f);
end;
{**
FormCreat

View File

@ -18,7 +18,7 @@ uses
CommCtrl, Contnrs, Generics.Collections,
routine_editor, trigger_editor, options, EditVar, helpers, createdatabase, table_editor,
TableTools, View, Usermanager, SelectDBObject, connections, sqlhelp, mysql_connection,
mysql_api, insertfiles, searchreplace;
mysql_api, insertfiles, searchreplace, loaddata, copytable;
type
@ -791,6 +791,8 @@ type
InsertFiles: TfrmInsertFiles;
EditVariableForm: TfrmEditVariable;
SearchReplaceDialog: TfrmSearchReplace;
ImportTextfileDialog: Tloaddataform;
CopyTableDialog: TCopyTableForm;
// Virtual Tree data arrays
VTRowDataListVariables,
@ -923,7 +925,7 @@ const
implementation
uses
About, loaddata, printlist, copytable, mysql_structures, UpdateCheck, uVistaFuncs, runsqlfile,
About, printlist, mysql_structures, UpdateCheck, uVistaFuncs, runsqlfile,
column_selection, data_sorting, grideditlinks;
@ -1818,7 +1820,9 @@ end;
procedure TMainForm.actImportCSVExecute(Sender: TObject);
begin
// Import Textfile
loaddataWindow(self);
if not Assigned(ImportTextfileDialog) then
ImportTextfileDialog := Tloaddataform.Create(Self);
ImportTextfileDialog.ShowModal;
end;
procedure TMainForm.actPreferencesExecute(Sender: TObject);
@ -1941,7 +1945,9 @@ end;
procedure TMainForm.actCopyTableExecute(Sender: TObject);
begin
// copy table
CopyTableWindow(self);
if not Assigned(CopyTableDialog) then
CopyTableDialog := TCopyTableForm.Create(Self);
CopyTableDialog.ShowModal;
end;