* Consistency of buttons in dialogs. Use TableNameHint in DataExporter

git-svn-id: trunk@15801 -
This commit is contained in:
michael 2008-07-17 19:12:55 +00:00
parent 93fd307e22
commit ace3f1561a
7 changed files with 65 additions and 65 deletions

View File

@ -315,6 +315,7 @@ Var
begin begin
ClearDisplay; ClearDisplay;
P:=TDataPanel.Create(Self); P:=TDataPanel.Create(Self);
P.TableName:=ATableName;
P.Parent:=FDisplay; P.Parent:=FDisplay;
P.Align:=alClient; P.Align:=alClient;
P.Dataset:=FEngine.ViewTable(ATableName,Self); P.Dataset:=FEngine.ViewTable(ATableName,Self);

View File

@ -26,7 +26,7 @@ interface
uses uses
Graphics, Classes, SysUtils, Controls, ExtCtrls, StdCtrls, DB, dbgrids, dbCtrls, Graphics, Classes, SysUtils, Controls, ExtCtrls, StdCtrls, DB, dbgrids, dbCtrls,
buttons; buttons, fpdatadict;
Type Type
@ -34,6 +34,7 @@ Type
TDataPanel = Class(TCustomPanel) TDataPanel = Class(TCustomPanel)
private private
FDataSource: TDatasource; FDataSource: TDatasource;
FTableName: String;
FTopPanel: TPanel; FTopPanel: TPanel;
FDBGrid : TDBGrid; FDBGrid : TDBGrid;
FNavigator : TDBNavigator; FNavigator : TDBNavigator;
@ -54,6 +55,7 @@ Type
Public Public
Constructor Create(AOwner : TComponent); Override; Constructor Create(AOwner : TComponent); Override;
Property Dataset : TDataset Read GetDataset Write SetDataset; Property Dataset : TDataset Read GetDataset Write SetDataset;
Property TableName: String Read FTableName Write FTableName;
Procedure ExportData; Procedure ExportData;
Procedure CreateCode; Procedure CreateCode;
Property ShowExtraButtons : Boolean Read GetExtra Write SetExtra; Property ShowExtraButtons : Boolean Read GetExtra Write SetExtra;
@ -102,6 +104,8 @@ procedure TDataPanel.ExportData;
begin begin
With TFPDataExporter.Create(Dataset) do With TFPDataExporter.Create(Dataset) do
Try Try
If Self.TableName<>'' then
TableNameHint:=Self.TableName;
Execute; Execute;
Finally Finally
Free; Free;

View File

@ -1,5 +1,3 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TGenerateSQLForm','FORMDATA',[ LazarusResources.Add('TGenerateSQLForm','FORMDATA',[
'TPF0'#16'TGenerateSQLForm'#15'GenerateSQLForm'#4'Left'#3#18#1#6'Height'#3#139 'TPF0'#16'TGenerateSQLForm'#15'GenerateSQLForm'#4'Left'#3#18#1#6'Height'#3#139
+#1#3'Top'#3#144#0#5'Width'#3'Q'#2#13'ActiveControl'#7#5'PCSQL'#7'Caption'#6 +#1#3'Top'#3#144#0#5'Width'#3'Q'#2#13'ActiveControl'#7#5'PCSQL'#7'Caption'#6

View File

@ -3,14 +3,13 @@ object SQLConnectionForm: TSQLConnectionForm
Height = 177 Height = 177
Top = 454 Top = 454
Width = 314 Width = 314
HorzScrollBar.Page = 313
VertScrollBar.Page = 176
ActiveControl = EHostName ActiveControl = EHostName
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'Connect to a database' Caption = 'Connect to a database'
ClientHeight = 177 ClientHeight = 177
ClientWidth = 314 ClientWidth = 314
LCLVersion = '0.9.25'
object LEHostName: TLabel object LEHostName: TLabel
Left = 8 Left = 8
Height = 23 Height = 23
@ -93,38 +92,14 @@ object SQLConnectionForm: TSQLConnectionForm
PasswordChar = '*' PasswordChar = '*'
TabOrder = 3 TabOrder = 3
end end
object PButtons: TPanel object BPButtons: TButtonPanel
Height = 34 Left = 6
Top = 143 Height = 42
Width = 314 Top = 135
Width = 302
Align = alBottom Align = alBottom
BevelOuter = bvLowered AutoSize = True
ClientHeight = 34
ClientWidth = 314
TabOrder = 4 TabOrder = 4
object BOK: TButton ShowButtons = [pbOK, pbCancel]
Left = 229
Height = 25
Top = 6
Width = 75
Anchors = [akTop, akRight]
BorderSpacing.InnerBorder = 4
Caption = '&OK'
Default = True
ModalResult = 1
TabOrder = 0
end
object BCancel: TButton
Left = 146
Height = 25
Top = 6
Width = 75
Anchors = [akTop, akRight]
BorderSpacing.InnerBorder = 4
Cancel = True
Caption = '&Cancel'
ModalResult = 2
TabOrder = 1
end
end end
end end

View File

@ -1,20 +1,49 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TSQLConnectionForm','FORMDATA',[ LazarusResources.Add('TSQLConnectionForm','FORMDATA',[
'TPF0'#18'TSQLConnectionForm'#17'SQLConnectionForm'#4'Left'#3'%'#2#6'Height'#3 'TPF0'#18'TSQLConnectionForm'#17'SQLConnectionForm'#4'Left'#3'%'#2#6'Height'#3
+#177#0#3'Top'#3#198#1#5'Width'#3':'#1#18'HorzScrollBar.Page'#3'9'#1#18'VertS' +#177#0#3'Top'#3#198#1#5'Width'#3':'#1#13'ActiveControl'#7#9'EHostName'#11'Bo'
+'crollBar.Page'#3#176#0#13'ActiveControl'#7#9'EHostName'#11'BorderIcons'#11 +'rderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6
+#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#21'Connect to' +#21'Connect to a database'#12'ClientHeight'#3#177#0#11'ClientWidth'#3':'#1#10
+' a database'#12'ClientHeight'#3#177#0#11'ClientWidth'#3':'#1#0#6'TLabel'#10 +'LCLVersion'#6#6'0.9.25'#0#6'TLabel'#10'LEHostName'#4'Left'#2#8#6'Height'#2
+'LEHostName'#4'Left'#2#8#6'Height'#2#23#3'Top'#2#15#5'Width'#2'J'#9'Alignmen' +#23#3'Top'#2#15#5'Width'#2'J'#9'Alignment'#7#14'taRightJustify'#8'AutoSize'#8
+'t'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#5'&Host'#12'FocusControl' +#7'Caption'#6#5'&Host'#12'FocusControl'#7#9'EHostName'#6'Layout'#7#8'tlCente'
+#7#9'EHostName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#14'L' +'r'#11'ParentColor'#8#0#0#6'TLabel'#14'LEDatabaseName'#4'Left'#2#8#6'Height'
+'EDatabaseName'#4'Left'#2#8#6'Height'#2#23#3'Top'#2'+'#5'Width'#2'J'#9'Align' +#2#23#3'Top'#2'+'#5'Width'#2'J'#9'Alignment'#7#14'taRightJustify'#8'AutoSize'
+'ment'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Database'#12'Focus' +#8#7'Caption'#6#9'&Database'#12'FocusControl'#7#13'EDatabaseName'#6'Layout'#7
+'Control'#7#13'EDatabaseName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6 +#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#10'LEUserName'#4'Left'#2#8#6'He'
+'TLabel'#10'LEUserName'#4'Left'#2#8#6'Height'#2#23#3'Top'#2'J'#5'Width'#2'J' +'ight'#2#23#3'Top'#2'J'#5'Width'#2'J'#9'Alignment'#7#14'taRightJustify'#8'Au'
+#9'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Username'#12 +'toSize'#8#7'Caption'#6#9'&Username'#12'FocusControl'#7#9'EUserName'#6'Layou'
+'FocusControl'#7#9'EUserName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6 +'t'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#10'LEPassword'#4'Left'#2#8
+'TLabel'#10'LEPassword'#4'Left'#2#8#6'Height'#2#23#3'Top'#2'i'#5'Width'#2'J' +#6'Height'#2#23#3'Top'#2'i'#5'Width'#2'J'#9'Alignment'#7#14'taRightJustify'#8
+#9'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Password'#12 +'AutoSize'#8#7'Caption'#6#9'&Password'#12'FocusControl'#7#9'EPassword'#6'Lay'
+'out'#7#8'tlCenter'#11'ParentColor'#8#0#0#5'TEdit'#9'EHostName'#4'Left'#2'Y'
+#6'Height'#2#23#3'Top'#2#15#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'
+#7'akRight'#0#8'TabOrder'#2#0#0#0#5'TEdit'#13'EDatabaseName'#4'Left'#2'Y'#6
+'Height'#2#23#3'Top'#2'+'#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'#7
+'akRight'#0#8'TabOrder'#2#1#0#0#5'TEdit'#9'EUserName'#4'Left'#2'Y'#6'Height'
+#2#23#3'Top'#2'J'#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRigh'
+'t'#0#8'TabOrder'#2#2#0#0#5'TEdit'#9'EPassword'#4'Left'#2'Y'#6'Height'#2#23#3
+'Top'#2'i'#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8
+'EchoMode'#7#10'emPassword'#12'PasswordChar'#6#1'*'#8'TabOrder'#2#3#0#0#12'T'
+'ButtonPanel'#9'BPButtons'#4'Left'#2#6#6'Height'#2'*'#3'Top'#3#135#0#5'Width'
+#3'.'#1#5'Align'#7#8'alBottom'#8'AutoSize'#9#8'TabOrder'#2#4#11'ShowButtons'
+#11#4'pbOK'#8'pbCancel'#0#0#0#0#18'TSQLConnectionForm'#17'SQLConnectionForm'
+#4'Left'#3'%'#2#6'Height'#3#177#0#3'Top'#3#198#1#5'Width'#3':'#1#13'ActiveCo'
+'ntrol'#7#9'EHostName'#11'BorderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'
+#7#8'bsDialog'#7'Caption'#6#21'Connect to a database'#12'ClientHeight'#3#177
+#0#11'ClientWidth'#3':'#1#10'LCLVersion'#6#6'0.9.25'#0#6'TLabel'#10'LEHostNa'
+'me'#4'Left'#2#8#6'Height'#2#23#3'Top'#2#15#5'Width'#2'J'#9'Alignment'#7#14
+'taRightJustify'#8'AutoSize'#8#7'Caption'#6#5'&Host'#12'FocusControl'#7#9'EH'
+'ostName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#14'LEDatab'
+'aseName'#4'Left'#2#8#6'Height'#2#23#3'Top'#2'+'#5'Width'#2'J'#9'Alignment'#7
+#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Database'#12'FocusControl'
+#7#13'EDatabaseName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'
+#10'LEUserName'#4'Left'#2#8#6'Height'#2#23#3'Top'#2'J'#5'Width'#2'J'#9'Align'
+'ment'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Username'#12'Focus'
+'Control'#7#9'EUserName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLa'
+'bel'#10'LEPassword'#4'Left'#2#8#6'Height'#2#23#3'Top'#2'i'#5'Width'#2'J'#9
+'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Password'#12
+'FocusControl'#7#9'EPassword'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#5 +'FocusControl'#7#9'EPassword'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#5
+'TEdit'#9'EHostName'#4'Left'#2'Y'#6'Height'#2#23#3'Top'#2#15#5'Width'#3#216#0 +'TEdit'#9'EHostName'#4'Left'#2'Y'#6'Height'#2#23#3'Top'#2#15#5'Width'#3#216#0
+#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#0#0#0#5'TEdit' +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#0#0#0#5'TEdit'
@ -24,13 +53,7 @@ LazarusResources.Add('TSQLConnectionForm','FORMDATA',[
+'rs'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0#0#5'TEdit'#9'EPass' +'rs'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0#0#5'TEdit'#9'EPass'
+'word'#4'Left'#2'Y'#6'Height'#2#23#3'Top'#2'i'#5'Width'#3#216#0#7'Anchors'#11 +'word'#4'Left'#2'Y'#6'Height'#2#23#3'Top'#2'i'#5'Width'#3#216#0#7'Anchors'#11
+#5'akTop'#6'akLeft'#7'akRight'#0#8'EchoMode'#7#10'emPassword'#12'PasswordCha' +#5'akTop'#6'akLeft'#7'akRight'#0#8'EchoMode'#7#10'emPassword'#12'PasswordCha'
+'r'#6#1'*'#8'TabOrder'#2#3#0#0#6'TPanel'#8'PButtons'#6'Height'#2'"'#3'Top'#3 +'r'#6#1'*'#8'TabOrder'#2#3#0#0#12'TButtonPanel'#9'BPButtons'#4'Left'#2#6#6'H'
+#143#0#5'Width'#3':'#1#5'Align'#7#8'alBottom'#10'BevelOuter'#7#9'bvLowered' +'eight'#2'*'#3'Top'#3#135#0#5'Width'#3'.'#1#5'Align'#7#8'alBottom'#8'AutoSiz'
+#12'ClientHeight'#2'"'#11'ClientWidth'#3':'#1#8'TabOrder'#2#4#0#7'TButton'#3 +'e'#9#8'TabOrder'#2#4#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#0#0#0#0
+'BOK'#4'Left'#3#229#0#6'Height'#2#25#3'Top'#2#6#5'Width'#2'K'#7'Anchors'#11#5
+'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'&OK'#7
+'Default'#9#11'ModalResult'#2#1#8'TabOrder'#2#0#0#0#7'TButton'#7'BCancel'#4
+'Left'#3#146#0#6'Height'#2#25#3'Top'#2#6#5'Width'#2'K'#7'Anchors'#11#5'akTop'
+#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#4#6'Cancel'#9#7'Caption'#6#7'&'
+'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#1#0#0#0#0
]); ]);

View File

@ -26,15 +26,14 @@ interface
uses uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons, ExtCtrls, ComCtrls; Buttons, ExtCtrls, ComCtrls, ButtonPanel;
type type
{ TSQLConnectionForm } { TSQLConnectionForm }
TSQLConnectionForm = class(TForm) TSQLConnectionForm = class(TForm)
BCancel: TButton; BPButtons: TButtonPanel;
BOK: TButton;
EHostName: TEdit; EHostName: TEdit;
EDatabaseName: TEdit; EDatabaseName: TEdit;
EUserName: TEdit; EUserName: TEdit;
@ -43,7 +42,6 @@ type
LEPassword: TLabel; LEPassword: TLabel;
LEHostName: TLabel; LEHostName: TLabel;
LEDatabaseName: TLabel; LEDatabaseName: TLabel;
PButtons: TPanel;
private private
function GetShowHost: Boolean; function GetShowHost: Boolean;
function GetString(Index: integer): String; function GetString(Index: integer): String;

View File

@ -84,6 +84,7 @@
<Filename Value="frmsqlconnect.pp"/> <Filename Value="frmsqlconnect.pp"/>
<ComponentName Value="SQLConnectionForm"/> <ComponentName Value="SQLConnectionForm"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="frmsqlconnect.lrs"/> <ResourceFilename Value="frmsqlconnect.lrs"/>
<UnitName Value="frmSQLConnect"/> <UnitName Value="frmSQLConnect"/>
</Unit5> </Unit5>
@ -119,7 +120,7 @@
<Filename Value="lazdatadesktop"/> <Filename Value="lazdatadesktop"/>
</Target> </Target>
<SearchPaths> <SearchPaths>
<Libraries Value="/opt/gnome/lib64/"/> <Libraries Value="/opt/gnome/lib/"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<Generate Value="Faster"/> <Generate Value="Faster"/>