* Brushed up the GUI, complete code refactoring for dicteditor, making codebase smaller and more clear

git-svn-id: trunk@17396 -
This commit is contained in:
michael 2008-11-15 10:35:03 +00:00
parent 3a9d260426
commit 6db8879420
14 changed files with 3172 additions and 1832 deletions

4
.gitattributes vendored
View File

@ -4298,12 +4298,16 @@ tools/lazdatadesktop/bitmaps/btnup.bmp -text
tools/lazdatadesktop/bitmaps/btnup.xpm -text
tools/lazdatadesktop/bitmaps/ddconnection.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/dddatadict.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/dddomain.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/dddomains.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddfield.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddfields.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddforeignkey.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddforeignkeys.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddindex.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddindexes.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddsequence.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddsequences.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddtable.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddtabledata.png -text svneol=unset#image/png
tools/lazdatadesktop/bitmaps/ddtables.png -text svneol=unset#image/png

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

View File

@ -1,6 +1,7 @@
#!/bin/sh
../../lazres ../dicteditor.lrs ddtables.png ddtable.png ddfields.png ddfield.png\
ddindexes.png ddindex.png ddforeignkeys.png ddforeignkey.png ddtabledata.png\
dddatadict.png ddconnection.png
dddatadict.png ddconnection.png ddsequences.png ddsequence.png dddomains.png dddomain.png

View File

@ -68,14 +68,17 @@ LazarusResources.Add('ddindexes','PNG',[
]);
LazarusResources.Add('ddindex','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147#0#0#0#153'IDATx'#218#197#209
+';'#10#194'P'#16#133#225'/"Xj'#229#26#2#130#157';'#177'pK'#238'A'#4'u'#3'.@,'
+#197#210'>'#133#141' '#198#202'F'#240'E,'#188#133#157#185'F'#240'o'#206#192
+'03g8'#188'X'#227#134'B$'#181#160's,UdT'#197#193#215#252'lA'#138#230'['#157
+#150']'#144#4'->'#244#18#255#164'T2'#29'lp'#193#2#237#216'++d'#232#6#157#197
+':'#184'b'#18#234')'#142#177'1'#238#195#27#141#16'a+'#246#133'>'#206'x'#224
+#132'm'#172#131#3'z'#24'`'#135'q'#172#131#12'w'#228#24#162'^v'#240#9'V'#239
+#31'G'#240#168'm'#6#0#0#0#0'IEND'#174'B`'#130
+#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147#0#0#0#219'IDATx'#218#181#146
+'1'#10#194'@'#16'E'#223#6'O'#226#5'$'#23#241#0#138#23#216#164'SH'#149#202'JH'
+#186'D'#176#14#138#133#16#208#194#19#8'j'#19'l-l'#180#244#14'k'#179#209#24'Y'
+#19'"~X'#152#25#152#249''#254#172#176#187'n'#15#152#243'B?[G'#11'j'#194#202
+#155#179'u$'#128#184'4'#172#18#173'<'#176#187#174#162#1#172'<((h6'#192#128'F'
+#170#254#130'ZJ'#228'/'#12'R'#179#200'&J$'#160'N'#151'L'#149#134#200':'#210
+#133'nf'#181'['#2'0'#30'L'#0#156#194'IE'#213#25#157'N'#219'~'#22#252#196#3
+#136'o'#247#171'i'#133#183'g'#1'S'#192#209#204#0'l'#14')'#179'mdR,'#128'P'
+#231#225#135#23#155'C'#170#252#196'S~'#226')'#131#7#129#174#7#197#159'(s'#217
+#199#243#254#219#202#1'0'#212#204#163#162'A'#170#194'h'#227#25#31'p<K'#222
+#173'h'#246#205#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('ddforeignkeys','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
@ -105,21 +108,22 @@ LazarusResources.Add('ddforeignkeys','PNG',[
]);
LazarusResources.Add('ddforeignkey','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147#0#0#1'HIDATx'#218#149#146'?'
+'K'#3'A'#16#197''#185#139#18#4#193'Nb'#136'QI'#161#130#221'}'#6#27#177#177
+#187#207#16#236#211#219#164#218#250#138#16'R_kem'#233#16#162#28#6'L'#12#4';'
+#137#158#23#2'J'#254'\l6 '#186#23#206#129')'#230#205#219'7'#195#155#133#191
+#177'''"E'#160#168#148'*'#1#251#190#239#151#128']'#3#23#203#128'9'#192#17'pX'
+#169'T'#14#128#29#160#0'l'#155#4#178#6#236#162'^'#175''#137#8#211#233#20#165
+#20#173'Vk'#217#187#251'M'#206#24#4#206#129'K'#128'^'#175#247'Y.'#151#151#248
+#21' '#252'#F"2'#2#22#171'H&'#15#206#244#163'M'#157#232#250'4'#173#192'u'#173
+'V#'#12'C'#250#253'>"B'#181'Z'#5#184'I'#187#250'l2'#153#204#128#185'R*'#6'b'
+#223#247#231'@'#156#246#10'q'#20'E'#0#4'A'#176#208'[f'#146#166#153#4#222#7
+#131#129#13#216#141'Fcm'#5'/'#177#241#242'c'#234#6'`'#235':'#155#214#196#7
+#160#11'<5'#155#205#14#208#209'u7'#173#192'3'#208#6#2#215'u'#5'x'#212#162#29
+#147#128'm'#192#10#150'eE'#158#231#133#185'\n'#156#207#231#223'Dd,"'#175#166
+#159'hrw'#11'8'#1'f"'#178#238'8NV'#243#218#192'0'#141#137#31#192'-p'#12','
+#175'p'#159't'#133'o'#148'Np'#204#150#227#220#234#0#0#0#0'IEND'#174'B`'#130
+#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147#0#0#1'PIDATx'#218#173#147'?'
+#138#194'@'#20#198'Y'#236#197#27'Xz'#1'{'#15#176'[y'#133#237#182#216#3'x'#7
+'aoa+ni'#145' ),'#7'Y'#235'D'#9#129'1'#204#16#236#148#228'mc'#134#196#141''
+#138'}'#240#17'2C'#190'y'#191#239'M'#0#198#128#220#208'+O'#148#148'e'#233'T'
+#20#133'DQ$A'#16'T&'#227#167#12#242'<wZ'#173'Vr>'#159'e6'#155'='#236#196#187
+#24'p<'#30#221#226'r'#185'd'#189'^'#147#166')'#251#253#30#223#247#235#223#188
+#1#223#213#203#203#159'vD'#24#14#135't'#187']'#140#201#216'n'#183#0'DQD'#16#4
+#0#139'k'#172#214#0#231#243#185#24'c$'#12'C'#1'nbu'#170'S'#235#21#199'1'#253
+'~'#159','#203#220#158#214#154#201'dB'#154#166#140'F#|'#223'_'#0#158'C'#240
+'<'#207')'#207's'#135'S'#25#180'a'#213#176'E'#172#181#174'}'#165#148#0#162
+#181'v'#227#180#214#138'1'#166#129#213#8#177#215#235'a'#173'm8'#151'e'#233':'
+#168#158#245'5'#151'A'#28#199'('#165#216#237'v('#165#220#230'f'#179'!I'#18#6
+#131'AcJ'#215#153'}'#221#185#202#2#200't:'#21#173#181'S'#237#150#210#1'>/j'
+#228'R'#20#5#135#195#161#129'S'#239#162#129#208'Va'#24'r:'#157'h'#27's'#146
+'$'#0'?'#247#254#143#143'GX'#192';'#255'Q'#191'$n+'#230#12#184#130'k'#0#0#0#0
+'IEND'#174'B`'#130
]);
LazarusResources.Add('ddtabledata','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
@ -189,3 +193,57 @@ LazarusResources.Add('ddconnection','PNG',[
+#24#2#178''#246#3#187#134#255#170#19#252'/'#253#2#193'l'#5#146'7'#136#155'M'
+#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('ddsequences','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0#0#6'bKGD'#0#255#0#255#0#255#160
+#189#167#147#0#0#0#9'pHYs'#0#0#11#18#0#0#11#18#1#210#221'~'#252#0#0#0#7'tIME'
+#7#211#2#19#14#8''''#7'_}Y'#0#0#0#180'IDATx'#218#173'S1'#14#195' '#12'<'#170
+#188#129#135#228#1#236'U~'#144#138#239#245#19'L'#12#249'Cf$'#166#140',Y'#130
+';'#148'D%'#2#220'V'#177#132#132#238'l'#238'd'#27#224#194#160#6#190#159#17'L'
+#210#191'",'#217'7'#29#196#24#1#128#172#181'%zL'#197'}'#133#231'{'#144#4#216
+'b'#2'@Z'#235'sO'#168#192#215'c'#24#238#144'Rf'#142'b'#140'p'#206#21#243#197
+'~Y'#150#5'D'#239#154'y'#158#161#148':'#146#214'uE'#8#225#224#147'@u'#214'd'
+#140#201#200'm'#219#170#251#208#149#220'x'#239'?'#31#22#211'4e|'#194#159'5'#7
+#223'`'#253'/k'#220#196'o'#204'x'#5'7'#255#174#162'&'#24'7'#143#203#190#240
+#11#214'#_r|J'#20#166#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('ddsequence','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147#0#0#0#227'IDATx'#218#213#147
+'='#138#133'0'#28#196''#198'i'#244#10'9'#131#144#179'X{'#132#7#30'B'#208
+#243#216#166#177#11'XY'#136#215#16'DD'#240#21#139#225#185'['#237'Z'#237#192
+#144'd'#152#12'L>'#162'}'#223'O'#30'@'#241#16#143#3'd'#158'g'#188#247''#218
+'l'#173'E'#188#247'XkI'#146#228#215#1#206#185#175#10'i'#154#146'eY'#160'1'
+#134','#203'p'#206'a'#140#161#239#251#160'7M'#19'|'#0#2' "'#136#8#0'Zk.'#173
+',K'#150'eAk'#205#178',a^'#215#245#253#16#227'8'#14'\'#215#149'K['#215#149
+#174#235#194'ZkMUU'#193#27#2#148'R7^'#218'4M'#20'E'#193'0'#12'('#165#216#182
+#141#182'mo'#190#31#21#194#245#136#144#231'9'#0'y'#158's'#28#7'"'#194#235#245
+#186'y'#229#179#194#133#243'<o'#227'w'#253#19#209'8'#142#231#147'w'#16#253
+#255#191#240'8'#224#13'9'#2'Q'#13#169#201#177#197#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('dddomains','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#2#0#0#0#144#145'h6'#0
+#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167#147#0#0#0#153'IDATx'#218#237'P!'
+#14#196'0'#12#243#166'S_Q'#169'h(`'#143'('#234'O'#195#138#166#162#253#160't'
+#168'd'#131#251#130#209#129#234#10'v'#155#180#129'cg`%r'#172'$'#238'H'#226#9
+#250'Co'#140'9'#229'K'#3#128'y'#158'['#189'm'#219'A}'#1#216#247'='#231'l'#173
+#29#199'1'#165#20'BH)'#1'P'#213'a'#24'T'#21#192'4M'#0'D'#4'$c'#140#252#0'@'
+#157'&YJ'#1'PJij'#140#241#228'$'#239'}-'#156's'#141'/'#168'KZt'#223#25#246
+'x'#136#191#225''''#134#142#228#186#174#203#178#220#153#22#145'7'#29#27'O'
+#255#16'['#11#253#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('dddomain','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#250'IDATx'#218#213#147'1n'#132'0'#16'E'#31#182#139#21'Z'#238#176#151
+#240#17'8'#6'g'#216#179'lA'#187'>'#3#245#22'H'#148#184#165#162'ZQ'#208#186'p'
+#131#16#210#164#136'p'#144#18')R'#168'2'#205#255#243#236#249#141#199#217#186
+#174#194#137'R'#156#172#211#1'f'#28'G'#188#247''#26#182#214'b'#188#247'Xk'
+#185'^'#175#191#14#220'n7^'#175#23'eY'#242'~'#191'i'#219#22#156's2M'#147'TU%'
+#128#0'RU'#149#132#16'R'#15'H]'#215#137#133#16'$'#132' '#206'9'#193'9'''#243
+'<'#11' 1F'#137'1&'#191'k'#223#247#223'X'#140'Q'#156'sb'#0#180#214#28#245#232
+#139#162#0#224#241'x'#252'xO'#1'('#245#249#24'y'#158#147#231'9G'#182','#11']'
+#215'q'#191#223#19'SJ%o'#0#140'1'#0'l'#219#198#222#239#236'r'#185#0#240'|>'
+#19#219'5'#5'h'#173#17#249'Z'#200#221#31#25'@'#150'e4M'#131'1&'#157'e'#195'0'
+#200#153'='#200#254#255'_8'#29#240#1#208#13#141#159'e?w'#168#0#0#0#0'IEND'
+#174'B`'#130
]);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,9 @@
* *
***************************************************************************
}
{$ifdef ver2_2}
{$define onlyoldobjects}
{$endif}
unit frmmain;
{$mode objfpc}{$H+}
@ -27,8 +30,7 @@ interface
uses
Classes, SysUtils, LResources, FileUtil, Forms, Controls, Graphics, Dialogs,
Menus, ActnList, StdActns, ComCtrls, dicteditor, fpdatadict, IniPropStorage,
conneditor, LCLType,
RTTICtrls, ExtCtrls, StdCtrls, ddfiles;
conneditor, LCLType, RTTICtrls, ExtCtrls, StdCtrls, ddfiles;
type
TEngineMenuItem = Class(TMenuItem)
@ -51,14 +53,15 @@ type
ACloseAll: TAction;
ACopyConnection: TAction;
ACreateCode: TAction;
AAddSequence: TAction;
AAddForeignKey: TAction;
AAddDomain: TAction;
ANewIndex: TAction;
ADeleteIndex: TAction;
ADeleteConnection: TAction;
ANewConnection: TAction;
ASaveAs: TAction;
AGenerateSQL: TAction;
ADeleteField: TAction;
ADeleteTable: TAction;
ADeleteObject: TAction;
ANewField: TAction;
ANewTable: TAction;
AOpen: TAction;
@ -74,6 +77,10 @@ type
LVDicts: TListView;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
MenuItem4: TMenuItem;
MenuItem5: TMenuItem;
MenuItem6: TMenuItem;
MenuItem7: TMenuItem;
MINewConnection: TMenuItem;
MIConnection: TMenuItem;
MISaveAs: TMenuItem;
@ -106,18 +113,18 @@ type
ODDD: TOpenDialog;
PCDD: TPageControl;
SDDD: TSaveDialog;
ToolButton4: TToolButton;
TBAddIndex: TToolButton;
TBDeleteIndex: TToolButton;
TBCreateCode: TToolButton;
TBAddSequence: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
TSConnections: TTabSheet;
ToolButton1: TToolButton;
TBNewTable: TToolButton;
TBNewField: TToolButton;
ToolButton2: TToolButton;
TBDeleteTable: TToolButton;
TBDeleteField: TToolButton;
ToolButton3: TToolButton;
TBGenerateSQL: TToolButton;
TSRecent: TTabSheet;
@ -125,16 +132,18 @@ type
TBSave: TToolButton;
TBOPen: TToolButton;
TBNew: TToolButton;
procedure AAddDomainExecute(Sender: TObject);
procedure AAddDomainUpdate(Sender: TObject);
procedure AAddForeignKeyExecute(Sender: TObject);
procedure AAddForeignKeyUpdate(Sender: TObject);
procedure AAddSequenceExecute(Sender: TObject);
procedure AAddSequenceUpdate(Sender: TObject);
procedure ACloseAllExecute(Sender: TObject);
procedure ACloseExecute(Sender: TObject);
procedure ACreateCodeExecute(Sender: TObject);
procedure ACreateCodeUpdate(Sender: TObject);
procedure ADeleteFieldExecute(Sender: TObject);
procedure ADeleteFieldUpdate(Sender: TObject);
procedure ADeleteIndexExecute(Sender: TObject);
procedure ADeleteIndexUpdate(Sender: TObject);
procedure ADeleteTableExecute(Sender: TObject);
procedure ADeleteTableUpdate(Sender: TObject);
procedure ADeleteObjectExecute(Sender: TObject);
procedure ADeleteObjectUpdate(Sender: TObject);
procedure AExitExecute(Sender: TObject);
procedure AGenerateSQLExecute(Sender: TObject);
procedure ANewConnectionExecute(Sender: TObject);
@ -144,7 +153,7 @@ type
procedure ANewIndexExecute(Sender: TObject);
procedure ANewIndexUpdate(Sender: TObject);
procedure ANewTableExecute(Sender: TObject);
procedure ANewTableUpdate(Sender: TObject);
procedure HaveDataDict(Sender: TObject);
procedure AOpenExecute(Sender: TObject);
procedure ASaveExecute(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
@ -212,12 +221,9 @@ type
Function NewDataDict : TFPDataDictionary;
Function NewDataEditor : TDataDictEditor;
function NewConnectionEditor(AName : String): TConnectionEditor;
procedure DeleteCurrentTable;
procedure DeleteCurrentField;
procedure DeleteCurrentIndex;
Procedure DoNewTable;
Procedure DoNewField;
Procedure DoNewIndex;
procedure DeleteCurrentObject;
procedure DoNewGlobalObject(AObjectType: TEditObjectType);
procedure DoNewTableObject(AObjectType: TEditObjectType);
procedure ShowGenerateSQL;
Property CurrentEditor : TDataDictEditor Read GetCurrentEditor;
Property CurrentConnection : TConnectionEditor Read GetCurrentConnection;
@ -256,10 +262,16 @@ ResourceString
SUseNewDict = 'No, import in a new dictionary';
SNewTable = 'Create new table';
SNewTableName = 'Enter a name for the new table:';
SNewSequence = 'Create new sequence';
SNewSequenceName = 'Enter a name for the new sequence:';
SNewDomain = 'Create new domain';
SNewDomainName = 'Enter a name for the new domain:';
SNewField = 'Create new field in table %s';
SNewFieldName = 'Enter a name for the new field:';
SNewIndex = 'Create new index on table %s';
SNewIndexName = 'Enter a name for the new index:';
SNewForeignKey = 'Create new foreign key in table %s';
SNewForeignKeyName = 'Enter a name for the new foreign key:';
SSelectDBFDir = 'Select a directory with DBF files';
SNewConnection = 'New connection';
SConnectionDescription = 'Enter a descriptive name for the connection';
@ -735,37 +747,15 @@ begin
(Sender as TAction).Enabled:=B;
end;
procedure TMainForm.ADeleteFieldExecute(Sender: TObject);
procedure TMainForm.ADeleteObjectExecute(Sender: TObject);
begin
DeleteCurrentField;
DeleteCurrentObject;
end;
procedure TMainForm.ADeleteFieldUpdate(Sender: TObject);
procedure TMainForm.ADeleteObjectUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled:=Assigned(CurrentEditor) and
Assigned(CurrentEditor.CurrentField);
end;
procedure TMainForm.ADeleteIndexExecute(Sender: TObject);
begin
DeleteCurrentIndex;
end;
procedure TMainForm.ADeleteIndexUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled:=Assigned(CurrentEditor) and
Assigned(CurrentEditor.CurrentIndex);
end;
procedure TMainForm.ADeleteTableExecute(Sender: TObject);
begin
DeleteCurrentTable;
end;
procedure TMainForm.ADeleteTableUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled:=Assigned(CurrentEditor) and
Assigned(CurrentEditor.CurrentTable);
Assigned(CurrentEditor.CurrentObject);
end;
procedure TMainForm.ACloseAllExecute(Sender: TObject);
@ -773,6 +763,48 @@ begin
CloseAllEditors;
end;
procedure TMainForm.AAddSequenceUpdate(Sender: TObject);
begin
{$ifdef onlyoldobjects}
(Sender as TAction).Enabled:=False;
{$else}
(Sender as TAction).Enabled:=(CurrentEditor<>Nil);
{$endif}
end;
procedure TMainForm.AAddDomainUpdate(Sender: TObject);
begin
{$ifdef onlyoldobjects}
(Sender as TAction).Enabled:=False;
{$else}
(Sender as TAction).Enabled:=(CurrentEditor<>Nil);
{$endif}
end;
procedure TMainForm.AAddForeignKeyUpdate(Sender: TObject);
begin
{$ifdef onlyoldobjects}
(Sender as TAction).Enabled:=False
{$else}
(Sender as TAction).Enabled:=(CurrentEditor<>Nil) and (CurrentEditor.CurrentTable<>Nil);
{$endif}
end;
procedure TMainForm.AAddDomainExecute(Sender: TObject);
begin
DoNewGlobalObject(eotDomain);
end;
procedure TMainForm.AAddForeignKeyExecute(Sender: TObject);
begin
DoNewTableObject(eotForeignKey);
end;
procedure TMainForm.AAddSequenceExecute(Sender: TObject);
begin
DoNewGlobalObject(eotSequence)
end;
procedure TMainForm.ANewExecute(Sender: TObject);
begin
NewDataDict;
@ -780,7 +812,7 @@ end;
procedure TMainForm.ANewFieldExecute(Sender: TObject);
begin
DoNewField;
DoNewTableObject(eotField);
end;
procedure TMainForm.ANewFieldUpdate(Sender: TObject);
@ -791,7 +823,7 @@ end;
procedure TMainForm.ANewIndexExecute(Sender: TObject);
begin
DoNewIndex;
DoNewTableObject(eotIndex);
end;
procedure TMainForm.ANewIndexUpdate(Sender: TObject);
@ -802,10 +834,10 @@ end;
procedure TMainForm.ANewTableExecute(Sender: TObject);
begin
DoNewTable;
DoNewGlobalObject(eotTable)
end;
procedure TMainForm.ANewTableUpdate(Sender: TObject);
procedure TMainForm.HaveDataDict(Sender: TObject);
begin
(Sender as TAction).Enabled:=(CurrentEditor<>Nil);
end;
@ -1066,90 +1098,80 @@ begin
end;
end;
procedure TMainForm.DeleteCurrentTable;
begin
if Assigned(CurrentEditor) then
With CurrentEditor do
If Assigned(CurrentTable) then
DeleteTable(CurrentTable);
end;
procedure TMainForm.DeleteCurrentField;
begin
if Assigned(CurrentEditor) then
With CurrentEditor do
If Assigned(CurrentField) then
DeleteField(CurrentField);
end;
procedure TMainForm.DeleteCurrentIndex;
begin
if Assigned(CurrentEditor) then
With CurrentEditor do
If Assigned(CurrentIndex) then
DeleteIndex(CurrentIndex);
end;
procedure TMainForm.DoNewField;
procedure TMainForm.DeleteCurrentObject;
Var
TD : TDDTableDef;
AFieldName : String;
DD : TDataDictEditor;
begin
If Assigned(CurrentEditor) then
begin
TD:=CurrentEditor.CurrentTable;
If Assigned(TD) then
DD:=CurrentEditor;
If Assigned(DD) then
DD.DeleteCurrentObject;
end;
procedure TMainForm.DoNewGlobalObject(AObjectType : TEditObjectType);
Var
ACaption,ALabel, AObjectName : String;
begin
AObjectName:='';
Case AObjectType of
eotTable :
begin
AFieldName:='';
If InputQuery(Format(SNewField,[TD.TableName]),SNEwFieldName,AFieldName) then
If (AFieldName<>'') then
CurrentEditor.NewField(AFieldName,TD);
ACaption:=SNewTable;
ALabel:=SNewTableName
end;
end;
end;
procedure TMainForm.DoNewIndex;
Var
TD : TDDTableDef;
AIndexName : String;
begin
If Assigned(CurrentEditor) then
begin
TD:=CurrentEditor.CurrentTable;
If Assigned(TD) then
eotSequence:
begin
AIndexName:='';
If InputQuery(Format(SNewIndex,[TD.TableName]),SNewIndexName,AIndexName) then
If (AIndexName<>'') then
CurrentEditor.NewIndex(AIndexName,TD);
ACaption:=SNewSequence;
ALabel:=SNewSequenceName
end;
end;
eotDomain :
begin
ACaption:=SNewDomain;
ALabel:=SNewDomainName
end
end;
If InputQuery(ACaption,ALabel,AObjectName) then
If (AObjectName<>'') then
CurrentEditor.NewGlobalObject(AObjectName,AObjectType);
end;
procedure TMainForm.DoNewTable;
procedure TMainForm.DoNewTableObject(AObjectType : TEditObjectType);
Var
ATableName : String;
ACaption,ALabel, AObjectName : String;
TD : TDDTableDef;
begin
If Assigned(CurrentEditor) then
begin
ATableName:='';
If InputQuery(SNewTable,SNEwTableName,ATableName) then
If (ATableName<>'') then
CurrentEditor.NewTable(ATableName);
end;
TD:=CurrentEditor.CurrentTable;
If (TD=Nil) then
Exit;
AObjectName:='';
Case AObjectType of
eotField :
begin
ACaption:=SNewField;
ALabel:=SNewFieldName
end;
eotIndex:
begin
ACaption:=SNewIndex;
ALabel:=SNewIndexName
end;
eotForeignKey :
begin
ACaption:=SNewForeignKey;
ALabel:=SNewForeignKeyName
end
end;
If InputQuery(Format(ACaption,[TD.TableName]),ALabel,AObjectName) then
If (AObjectName<>'') then
CurrentEditor.NewTableObject(AObjectName,TD,AObjectType);
end;
procedure TMainForm.DoImport(Const EngineName : String);
begin

View File

@ -4,10 +4,12 @@
<PathDelim Value="/"/>
<Version Value="6"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<AutoCreateForms Value="False"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<Title Value="Lazarus Data Desktop"/>
</General>