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

View File

@ -72,7 +72,6 @@ type
{ Public declarations } { Public declarations }
end; end;
function loaddataWindow(AOwner: TComponent): Boolean;
implementation implementation
@ -81,20 +80,6 @@ uses Main, helpers;
{$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 loaddataWindow(AOwner: TComponent): Boolean;
var
f : Tloaddataform;
begin
f := Tloaddataform.Create(AOwner);
Result := (f.ShowModal=mrOK);
FreeAndNil(f);
end;
{** {**
FormCreat FormCreat

View File

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