mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 15:31:09 +02:00
* Consistency of buttons in dialogs. Use TableNameHint in DataExporter
git-svn-id: trunk@15801 -
This commit is contained in:
parent
93fd307e22
commit
ace3f1561a
@ -315,6 +315,7 @@ Var
|
||||
begin
|
||||
ClearDisplay;
|
||||
P:=TDataPanel.Create(Self);
|
||||
P.TableName:=ATableName;
|
||||
P.Parent:=FDisplay;
|
||||
P.Align:=alClient;
|
||||
P.Dataset:=FEngine.ViewTable(ATableName,Self);
|
||||
|
@ -26,7 +26,7 @@ interface
|
||||
|
||||
uses
|
||||
Graphics, Classes, SysUtils, Controls, ExtCtrls, StdCtrls, DB, dbgrids, dbCtrls,
|
||||
buttons;
|
||||
buttons, fpdatadict;
|
||||
|
||||
Type
|
||||
|
||||
@ -34,6 +34,7 @@ Type
|
||||
TDataPanel = Class(TCustomPanel)
|
||||
private
|
||||
FDataSource: TDatasource;
|
||||
FTableName: String;
|
||||
FTopPanel: TPanel;
|
||||
FDBGrid : TDBGrid;
|
||||
FNavigator : TDBNavigator;
|
||||
@ -54,6 +55,7 @@ Type
|
||||
Public
|
||||
Constructor Create(AOwner : TComponent); Override;
|
||||
Property Dataset : TDataset Read GetDataset Write SetDataset;
|
||||
Property TableName: String Read FTableName Write FTableName;
|
||||
Procedure ExportData;
|
||||
Procedure CreateCode;
|
||||
Property ShowExtraButtons : Boolean Read GetExtra Write SetExtra;
|
||||
@ -102,6 +104,8 @@ procedure TDataPanel.ExportData;
|
||||
begin
|
||||
With TFPDataExporter.Create(Dataset) do
|
||||
Try
|
||||
If Self.TableName<>'' then
|
||||
TableNameHint:=Self.TableName;
|
||||
Execute;
|
||||
Finally
|
||||
Free;
|
||||
|
@ -1,5 +1,3 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TGenerateSQLForm','FORMDATA',[
|
||||
'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
|
||||
|
@ -3,14 +3,13 @@ object SQLConnectionForm: TSQLConnectionForm
|
||||
Height = 177
|
||||
Top = 454
|
||||
Width = 314
|
||||
HorzScrollBar.Page = 313
|
||||
VertScrollBar.Page = 176
|
||||
ActiveControl = EHostName
|
||||
BorderIcons = [biSystemMenu]
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'Connect to a database'
|
||||
ClientHeight = 177
|
||||
ClientWidth = 314
|
||||
LCLVersion = '0.9.25'
|
||||
object LEHostName: TLabel
|
||||
Left = 8
|
||||
Height = 23
|
||||
@ -93,38 +92,14 @@ object SQLConnectionForm: TSQLConnectionForm
|
||||
PasswordChar = '*'
|
||||
TabOrder = 3
|
||||
end
|
||||
object PButtons: TPanel
|
||||
Height = 34
|
||||
Top = 143
|
||||
Width = 314
|
||||
object BPButtons: TButtonPanel
|
||||
Left = 6
|
||||
Height = 42
|
||||
Top = 135
|
||||
Width = 302
|
||||
Align = alBottom
|
||||
BevelOuter = bvLowered
|
||||
ClientHeight = 34
|
||||
ClientWidth = 314
|
||||
AutoSize = True
|
||||
TabOrder = 4
|
||||
object BOK: TButton
|
||||
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
|
||||
ShowButtons = [pbOK, pbCancel]
|
||||
end
|
||||
end
|
||||
|
@ -1,20 +1,49 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TSQLConnectionForm','FORMDATA',[
|
||||
'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'
|
||||
+'crollBar.Page'#3#176#0#13'ActiveControl'#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#0#6'TLabel'#10
|
||||
+'LEHostName'#4'Left'#2#8#6'Height'#2#23#3'Top'#2#15#5'Width'#2'J'#9'Alignmen'
|
||||
+'t'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#5'&Host'#12'FocusControl'
|
||||
+#7#9'EHostName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#14'L'
|
||||
+'EDatabaseName'#4'Left'#2#8#6'Height'#2#23#3'Top'#2'+'#5'Width'#2'J'#9'Align'
|
||||
+'ment'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Database'#12'Focus'
|
||||
+'Control'#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'Alignment'#7#14'taRightJustify'#8'AutoSize'#8#7'Caption'#6#9'&Username'#12
|
||||
+'FocusControl'#7#9'EUserName'#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6
|
||||
+'TLabel'#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
|
||||
+#177#0#3'Top'#3#198#1#5'Width'#3':'#1#13'ActiveControl'#7#9'EHostName'#11'Bo'
|
||||
+'rderIcons'#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'LEHostName'#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'EHostName'#6'Layout'#7#8'tlCente'
|
||||
+'r'#11'ParentColor'#8#0#0#6'TLabel'#14'LEDatabaseName'#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'He'
|
||||
+'ight'#2#23#3'Top'#2'J'#5'Width'#2'J'#9'Alignment'#7#14'taRightJustify'#8'Au'
|
||||
+'toSize'#8#7'Caption'#6#9'&Username'#12'FocusControl'#7#9'EUserName'#6'Layou'
|
||||
+'t'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#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'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
|
||||
+'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'
|
||||
@ -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'
|
||||
+'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'
|
||||
+'r'#6#1'*'#8'TabOrder'#2#3#0#0#6'TPanel'#8'PButtons'#6'Height'#2'"'#3'Top'#3
|
||||
+#143#0#5'Width'#3':'#1#5'Align'#7#8'alBottom'#10'BevelOuter'#7#9'bvLowered'
|
||||
+#12'ClientHeight'#2'"'#11'ClientWidth'#3':'#1#8'TabOrder'#2#4#0#7'TButton'#3
|
||||
+'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
|
||||
+'r'#6#1'*'#8'TabOrder'#2#3#0#0#12'TButtonPanel'#9'BPButtons'#4'Left'#2#6#6'H'
|
||||
+'eight'#2'*'#3'Top'#3#135#0#5'Width'#3'.'#1#5'Align'#7#8'alBottom'#8'AutoSiz'
|
||||
+'e'#9#8'TabOrder'#2#4#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#0#0#0#0
|
||||
]);
|
||||
|
@ -26,15 +26,14 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Buttons, ExtCtrls, ComCtrls;
|
||||
Buttons, ExtCtrls, ComCtrls, ButtonPanel;
|
||||
|
||||
type
|
||||
|
||||
{ TSQLConnectionForm }
|
||||
|
||||
TSQLConnectionForm = class(TForm)
|
||||
BCancel: TButton;
|
||||
BOK: TButton;
|
||||
BPButtons: TButtonPanel;
|
||||
EHostName: TEdit;
|
||||
EDatabaseName: TEdit;
|
||||
EUserName: TEdit;
|
||||
@ -43,7 +42,6 @@ type
|
||||
LEPassword: TLabel;
|
||||
LEHostName: TLabel;
|
||||
LEDatabaseName: TLabel;
|
||||
PButtons: TPanel;
|
||||
private
|
||||
function GetShowHost: Boolean;
|
||||
function GetString(Index: integer): String;
|
||||
|
@ -84,6 +84,7 @@
|
||||
<Filename Value="frmsqlconnect.pp"/>
|
||||
<ComponentName Value="SQLConnectionForm"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<ResourceFilename Value="frmsqlconnect.lrs"/>
|
||||
<UnitName Value="frmSQLConnect"/>
|
||||
</Unit5>
|
||||
@ -119,7 +120,7 @@
|
||||
<Filename Value="lazdatadesktop"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<Libraries Value="/opt/gnome/lib64/"/>
|
||||
<Libraries Value="/opt/gnome/lib/"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
|
Loading…
Reference in New Issue
Block a user