Implement a parent class for all database object editors (table, view, routine, trigger) and let these editors derive from this class. Could simplify code in the future.

This commit is contained in:
Ansgar Becker
2009-12-11 18:20:16 +00:00
parent 68a1ae0416
commit 2dcf02feb3
6 changed files with 66 additions and 46 deletions

View File

@@ -5,10 +5,10 @@ interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TntStdCtrls, SynEdit, SynMemo, ExtCtrls, mysql_connection, mysql_api,
SynCompletionProposal, VirtualTrees;
SynCompletionProposal, VirtualTrees, helpers;
type
TfrmTriggerEditor = class(TFrame)
TfrmTriggerEditor = class(TDBObjectEditor)
lblName: TLabel;
editName: TTntEdit;
SynMemoStatement: TSynMemo;
@@ -39,7 +39,7 @@ type
implementation
uses main, helpers;
uses main;
{$R *.dfm}
@@ -108,8 +108,9 @@ begin
Mainform.SetEditorTabCaption(Self, '');
editName.Text := 'Enter trigger name';
end;
btnSave.Enabled := False;
btnDiscard.Enabled := False;
Modified := False;
btnSave.Enabled := Modified;
btnDiscard.Enabled := Modified;
end;
@@ -120,6 +121,7 @@ begin
and (comboTiming.ItemIndex > -1) and (comboEvent.ItemIndex > -1)
and (SynMemoStatement.Text <> '');
btnDiscard.Enabled := True;
Modified := True;
end;