mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:39:20 +02:00
* Fixed 14003
git-svn-id: trunk@20758 -
This commit is contained in:
parent
1e0889bde7
commit
18d16e10cf
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -4780,6 +4780,9 @@ tools/lazdatadesktop/frmimportdd.pp svneol=native#text/plain
|
|||||||
tools/lazdatadesktop/frmmain.lfm svneol=native#text/plain
|
tools/lazdatadesktop/frmmain.lfm svneol=native#text/plain
|
||||||
tools/lazdatadesktop/frmmain.lrs svneol=native#text/pascal
|
tools/lazdatadesktop/frmmain.lrs svneol=native#text/pascal
|
||||||
tools/lazdatadesktop/frmmain.pp svneol=native#text/plain
|
tools/lazdatadesktop/frmmain.pp svneol=native#text/plain
|
||||||
|
tools/lazdatadesktop/frmselectconnectiontype.lfm svneol=native#text/plain
|
||||||
|
tools/lazdatadesktop/frmselectconnectiontype.lrs svneol=native#text/plain
|
||||||
|
tools/lazdatadesktop/frmselectconnectiontype.pp svneol=native#text/plain
|
||||||
tools/lazdatadesktop/frmsqlconnect.lfm svneol=native#text/plain
|
tools/lazdatadesktop/frmsqlconnect.lfm svneol=native#text/plain
|
||||||
tools/lazdatadesktop/frmsqlconnect.lrs svneol=native#text/pascal
|
tools/lazdatadesktop/frmsqlconnect.lrs svneol=native#text/pascal
|
||||||
tools/lazdatadesktop/frmsqlconnect.pp svneol=native#text/plain
|
tools/lazdatadesktop/frmsqlconnect.pp svneol=native#text/plain
|
||||||
|
@ -143,21 +143,22 @@ object MainForm: TMainForm
|
|||||||
Caption = 'Last used on'
|
Caption = 'Last used on'
|
||||||
Width = 487
|
Width = 487
|
||||||
end>
|
end>
|
||||||
|
PopupMenu = PMDataDict
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
RowSelect = True
|
RowSelect = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
ViewStyle = vsReport
|
ViewStyle = vsReport
|
||||||
OnDblClick = LVDictsDblClick
|
OnDblClick = OpenRecentDatadict
|
||||||
OnKeyUp = LVDictsKeyUp
|
OnKeyUp = LVDictsKeyUp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object TSConnections: TTabSheet
|
object TSConnections: TTabSheet
|
||||||
Caption = 'Connections'
|
Caption = 'Connections'
|
||||||
ClientHeight = 274
|
ClientHeight = 278
|
||||||
ClientWidth = 483
|
ClientWidth = 483
|
||||||
object LVConnections: TListView
|
object LVConnections: TListView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 274
|
Height = 278
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 483
|
Width = 483
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -177,12 +178,13 @@ object MainForm: TMainForm
|
|||||||
Caption = 'Description'
|
Caption = 'Description'
|
||||||
Width = 217
|
Width = 217
|
||||||
end>
|
end>
|
||||||
|
PopupMenu = PMRecentConnections
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
RowSelect = True
|
RowSelect = True
|
||||||
SortType = stText
|
SortType = stText
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
ViewStyle = vsReport
|
ViewStyle = vsReport
|
||||||
OnDblClick = LVConnectionsDblClick
|
OnDblClick = OpenRecentConnection
|
||||||
OnKeyUp = LVConnectionsKeyUp
|
OnKeyUp = LVConnectionsKeyUp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -795,6 +797,14 @@ object MainForm: TMainForm
|
|||||||
object MINewConnection: TMenuItem
|
object MINewConnection: TMenuItem
|
||||||
Caption = 'New'
|
Caption = 'New'
|
||||||
end
|
end
|
||||||
|
object MIOpenRecentConnection: TMenuItem
|
||||||
|
Action = AOpenConnection
|
||||||
|
OnClick = OpenRecentConnection
|
||||||
|
end
|
||||||
|
object MIDeleteRecentConnection: TMenuItem
|
||||||
|
Action = ADeleteConnection
|
||||||
|
OnClick = ADeleteConnectionExecute
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ALMain: TActionList
|
object ALMain: TActionList
|
||||||
@ -919,7 +929,8 @@ object MainForm: TMainForm
|
|||||||
object ADeleteConnection: TAction
|
object ADeleteConnection: TAction
|
||||||
Category = 'Connections'
|
Category = 'Connections'
|
||||||
Caption = '&Delete connection'
|
Caption = '&Delete connection'
|
||||||
OnUpdate = HaveConnection
|
OnExecute = ADeleteConnectionExecute
|
||||||
|
OnUpdate = HaveRecentConnection
|
||||||
ShortCut = 49220
|
ShortCut = 49220
|
||||||
end
|
end
|
||||||
object ACopyConnection: TAction
|
object ACopyConnection: TAction
|
||||||
@ -966,6 +977,26 @@ object MainForm: TMainForm
|
|||||||
OnExecute = AAddDomainExecute
|
OnExecute = AAddDomainExecute
|
||||||
OnUpdate = AAddDomainUpdate
|
OnUpdate = AAddDomainUpdate
|
||||||
end
|
end
|
||||||
|
object AOpenConnection: TAction
|
||||||
|
Category = 'Connections'
|
||||||
|
Caption = '&Open connection'
|
||||||
|
Hint = 'Open selected recent connection'
|
||||||
|
OnExecute = OpenRecentConnection
|
||||||
|
OnUpdate = HaveRecentConnection
|
||||||
|
end
|
||||||
|
object AOpenRecentDatadict: TAction
|
||||||
|
Category = 'File'
|
||||||
|
Caption = 'Open'
|
||||||
|
Hint = 'Open selected recent datadictionary'
|
||||||
|
OnExecute = OpenRecentDatadict
|
||||||
|
OnUpdate = HaveRecentDataDict
|
||||||
|
end
|
||||||
|
object ADeleteRecentDataDict: TAction
|
||||||
|
Category = 'File'
|
||||||
|
Caption = '&Delete'
|
||||||
|
OnExecute = ADeleteRecentDataDictExecute
|
||||||
|
OnUpdate = HaveRecentDataDict
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object ILMain: TImageList
|
object ILMain: TImageList
|
||||||
left = 47
|
left = 47
|
||||||
@ -1477,4 +1508,34 @@ object MainForm: TMainForm
|
|||||||
left = 184
|
left = 184
|
||||||
top = 112
|
top = 112
|
||||||
end
|
end
|
||||||
|
object PMRecentConnections: TPopupMenu
|
||||||
|
Images = ILMain
|
||||||
|
left = 121
|
||||||
|
top = 163
|
||||||
|
object PMIOpenConnection: TMenuItem
|
||||||
|
Action = AOpenConnection
|
||||||
|
OnClick = OpenRecentConnection
|
||||||
|
end
|
||||||
|
object PMINewConnection: TMenuItem
|
||||||
|
Action = ANewConnection
|
||||||
|
OnClick = ANewConnectionExecute
|
||||||
|
end
|
||||||
|
object PMIDeleteConnection: TMenuItem
|
||||||
|
Action = ADeleteConnection
|
||||||
|
OnClick = ADeleteConnectionExecute
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object PMDataDict: TPopupMenu
|
||||||
|
Images = ILMain
|
||||||
|
left = 158
|
||||||
|
top = 161
|
||||||
|
object PMIOpenDataDict: TMenuItem
|
||||||
|
Action = AOpenRecentDatadict
|
||||||
|
OnClick = OpenRecentDatadict
|
||||||
|
end
|
||||||
|
object PMINewDataDict: TMenuItem
|
||||||
|
Action = ANew
|
||||||
|
OnClick = ANewExecute
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -56,6 +56,9 @@ type
|
|||||||
AAddSequence: TAction;
|
AAddSequence: TAction;
|
||||||
AAddForeignKey: TAction;
|
AAddForeignKey: TAction;
|
||||||
AAddDomain: TAction;
|
AAddDomain: TAction;
|
||||||
|
ADeleteRecentDataDict: TAction;
|
||||||
|
AOpenRecentDatadict: TAction;
|
||||||
|
AOpenConnection: TAction;
|
||||||
ANewIndex: TAction;
|
ANewIndex: TAction;
|
||||||
ADeleteConnection: TAction;
|
ADeleteConnection: TAction;
|
||||||
ANewConnection: TAction;
|
ANewConnection: TAction;
|
||||||
@ -81,6 +84,13 @@ type
|
|||||||
MenuItem5: TMenuItem;
|
MenuItem5: TMenuItem;
|
||||||
MenuItem6: TMenuItem;
|
MenuItem6: TMenuItem;
|
||||||
MenuItem7: TMenuItem;
|
MenuItem7: TMenuItem;
|
||||||
|
PMINewConnection: TMenuItem;
|
||||||
|
PMINewDataDict: TMenuItem;
|
||||||
|
PMIOpenDataDict: TMenuItem;
|
||||||
|
MIDeleteRecentConnection: TMenuItem;
|
||||||
|
MIOpenRecentConnection: TMenuItem;
|
||||||
|
PMIDeleteConnection: TMenuItem;
|
||||||
|
PMIOpenConnection: TMenuItem;
|
||||||
MINewConnection: TMenuItem;
|
MINewConnection: TMenuItem;
|
||||||
MIConnection: TMenuItem;
|
MIConnection: TMenuItem;
|
||||||
MISaveAs: TMenuItem;
|
MISaveAs: TMenuItem;
|
||||||
@ -99,6 +109,8 @@ type
|
|||||||
MICut: TMenuItem;
|
MICut: TMenuItem;
|
||||||
MIImport: TMenuItem;
|
MIImport: TMenuItem;
|
||||||
MIDataDict: TMenuItem;
|
MIDataDict: TMenuItem;
|
||||||
|
PMRecentConnections: TPopupMenu;
|
||||||
|
PMDataDict: TPopupMenu;
|
||||||
PStatus: TPanel;
|
PStatus: TPanel;
|
||||||
PStatusText: TPanel;
|
PStatusText: TPanel;
|
||||||
PBSTatus: TProgressBar;
|
PBSTatus: TProgressBar;
|
||||||
@ -142,8 +154,10 @@ type
|
|||||||
procedure ACloseExecute(Sender: TObject);
|
procedure ACloseExecute(Sender: TObject);
|
||||||
procedure ACreateCodeExecute(Sender: TObject);
|
procedure ACreateCodeExecute(Sender: TObject);
|
||||||
procedure ACreateCodeUpdate(Sender: TObject);
|
procedure ACreateCodeUpdate(Sender: TObject);
|
||||||
|
procedure ADeleteConnectionExecute(Sender: TObject);
|
||||||
procedure ADeleteObjectExecute(Sender: TObject);
|
procedure ADeleteObjectExecute(Sender: TObject);
|
||||||
procedure ADeleteObjectUpdate(Sender: TObject);
|
procedure ADeleteObjectUpdate(Sender: TObject);
|
||||||
|
procedure ADeleteRecentDataDictExecute(Sender: TObject);
|
||||||
procedure AExitExecute(Sender: TObject);
|
procedure AExitExecute(Sender: TObject);
|
||||||
procedure AGenerateSQLExecute(Sender: TObject);
|
procedure AGenerateSQLExecute(Sender: TObject);
|
||||||
procedure ANewConnectionExecute(Sender: TObject);
|
procedure ANewConnectionExecute(Sender: TObject);
|
||||||
@ -163,13 +177,15 @@ type
|
|||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure HaveConnection(Sender: TObject);
|
procedure HaveConnection(Sender: TObject);
|
||||||
procedure HaveDDEditor(Sender: TObject);
|
procedure HaveDDEditor(Sender: TObject);
|
||||||
|
procedure HaveRecentConnection(Sender: TObject);
|
||||||
|
procedure HaveRecentDataDict(Sender: TObject);
|
||||||
procedure HaveTabs(Sender: TObject);
|
procedure HaveTabs(Sender: TObject);
|
||||||
procedure HaveTab(Sender: TObject);
|
procedure HaveTab(Sender: TObject);
|
||||||
procedure HaveTables(Sender: TObject);
|
procedure HaveTables(Sender: TObject);
|
||||||
procedure LVConnectionsDblClick(Sender: TObject);
|
procedure OpenRecentConnection(Sender: TObject);
|
||||||
procedure LVConnectionsKeyUp(Sender: TObject; var Key: Word;
|
procedure LVConnectionsKeyUp(Sender: TObject; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
procedure LVDictsDblClick(Sender: TObject);
|
procedure OpenRecentDatadict(Sender: TObject);
|
||||||
procedure LVDictsKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure LVDictsKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure MIDataDictClick(Sender: TObject);
|
procedure MIDataDictClick(Sender: TObject);
|
||||||
procedure PCDDChange(Sender: TObject);
|
procedure PCDDChange(Sender: TObject);
|
||||||
@ -181,6 +197,9 @@ type
|
|||||||
procedure CheckParams;
|
procedure CheckParams;
|
||||||
function CloseCurrentConnection: TModalResult;
|
function CloseCurrentConnection: TModalResult;
|
||||||
function CloseCurrentTab(AddCancelClose: Boolean = False): TModalResult;
|
function CloseCurrentTab(AddCancelClose: Boolean = False): TModalResult;
|
||||||
|
procedure DeleteRecentConnection;
|
||||||
|
procedure DeleteRecentDataDict;
|
||||||
|
procedure DoShowNewConnectionTypes(ParentMenu: TMenuItem);
|
||||||
function GetConnectionName(out AName: String): Boolean;
|
function GetConnectionName(out AName: String): Boolean;
|
||||||
function GetCurrentConnection: TConnectionEditor;
|
function GetCurrentConnection: TConnectionEditor;
|
||||||
function GetCurrentEditor: TDataDictEditor;
|
function GetCurrentEditor: TDataDictEditor;
|
||||||
@ -236,6 +255,7 @@ var
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
frmselectconnectiontype,
|
||||||
// Data dictionary support for
|
// Data dictionary support for
|
||||||
fpdddbf, // DBF
|
fpdddbf, // DBF
|
||||||
{$ifndef win64}
|
{$ifndef win64}
|
||||||
@ -581,6 +601,12 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.ShowNewConnectionTypes;
|
procedure TMainForm.ShowNewConnectionTypes;
|
||||||
|
|
||||||
|
begin
|
||||||
|
DoShowNewConnectionTypes(MINewConnection);
|
||||||
|
DoShowNewConnectionTypes(PMINewConnection);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.DoShowNewConnectionTypes(ParentMenu : TMenuItem);
|
||||||
Var
|
Var
|
||||||
MI : TNewConnectionMenuItem;
|
MI : TNewConnectionMenuItem;
|
||||||
L : TStringList;
|
L : TStringList;
|
||||||
@ -589,7 +615,7 @@ Var
|
|||||||
cap : TFPDDEngineCapabilities;
|
cap : TFPDDEngineCapabilities;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
MINewConnection.Clear;
|
ParentMenu.Clear;
|
||||||
L:=TStringList.Create;
|
L:=TStringList.Create;
|
||||||
Try
|
Try
|
||||||
L.Sorted:=True;
|
L.Sorted:=True;
|
||||||
@ -601,7 +627,7 @@ begin
|
|||||||
MI.Caption:=dt;
|
MI.Caption:=dt;
|
||||||
MI.FEngineName:=L[i];
|
MI.FEngineName:=L[i];
|
||||||
MI.OnClick:=@NewConnectionClick;
|
MI.OnClick:=@NewConnectionClick;
|
||||||
MINewConnection.Add(MI);
|
ParentMenu.Add(MI);
|
||||||
// make sure it gets loaded
|
// make sure it gets loaded
|
||||||
PSMain.StoredValue[L[i]]:='';
|
PSMain.StoredValue[L[i]]:='';
|
||||||
end;
|
end;
|
||||||
@ -751,6 +777,27 @@ begin
|
|||||||
(Sender as TAction).Enabled:=B;
|
(Sender as TAction).Enabled:=B;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.ADeleteConnectionExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DeleteRecentConnection;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.DeleteRecentConnection;
|
||||||
|
|
||||||
|
Var
|
||||||
|
R : TRecentConnection;
|
||||||
|
|
||||||
|
begin
|
||||||
|
If (LVConnections.Selected<>Nil)
|
||||||
|
and (LVConnections.Selected.Data<>Nil) then
|
||||||
|
begin
|
||||||
|
R:=TRecentConnection(LVConnections.Selected.Data);
|
||||||
|
If (R<>Nil) then
|
||||||
|
FRecentConnections.Delete(R.Index);
|
||||||
|
ShowRecentConnections;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.ADeleteObjectExecute(Sender: TObject);
|
procedure TMainForm.ADeleteObjectExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DeleteCurrentObject;
|
DeleteCurrentObject;
|
||||||
@ -762,6 +809,11 @@ begin
|
|||||||
Assigned(CurrentEditor.CurrentObject);
|
Assigned(CurrentEditor.CurrentObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.ADeleteRecentDataDictExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DeleteRecentDataDict;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.ACloseAllExecute(Sender: TObject);
|
procedure TMainForm.ACloseAllExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CloseAllEditors;
|
CloseAllEditors;
|
||||||
@ -870,6 +922,18 @@ begin
|
|||||||
(Sender as TAction).Enabled:=(CurrentEditor<>Nil);
|
(Sender as TAction).Enabled:=(CurrentEditor<>Nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.HaveRecentConnection(Sender: TObject);
|
||||||
|
begin
|
||||||
|
(Sender as Taction).Enabled:=(LVConnections.Selected<>Nil)
|
||||||
|
and (LVConnections.Selected.Data<>Nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.HaveRecentDataDict(Sender: TObject);
|
||||||
|
begin
|
||||||
|
(Sender as Taction).Enabled:=(LVDicts.Selected<>Nil)
|
||||||
|
and (LVDicts.Selected.Data<>Nil);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.HaveTabs(Sender: TObject);
|
procedure TMainForm.HaveTabs(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
(Sender as TAction).Enabled:=(CurrentEditor<>Nil) or (CurrentConnection<>Nil);
|
(Sender as TAction).Enabled:=(CurrentEditor<>Nil) or (CurrentConnection<>Nil);
|
||||||
@ -886,7 +950,7 @@ begin
|
|||||||
and (CurrentEditor.DataDictionary.Tables.Count>0);
|
and (CurrentEditor.DataDictionary.Tables.Count>0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.LVConnectionsDblClick(Sender: TObject);
|
procedure TMainForm.OpenRecentConnection(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
If (LVConnections.Selected<>Nil)
|
If (LVConnections.Selected<>Nil)
|
||||||
and (LVConnections.Selected.Data<>Nil) then
|
and (LVConnections.Selected.Data<>Nil) then
|
||||||
@ -897,10 +961,7 @@ procedure TMainForm.LVConnectionsKeyUp(Sender: TObject; var Key: Word;
|
|||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if key=VK_DELETE then
|
if key=VK_DELETE then
|
||||||
begin
|
DeleteRecentConnection;
|
||||||
FRecentConnections.Delete(FRecentConnections.FindByName(LVConnections.ItemFocused.Caption).Index);
|
|
||||||
ShowRecentConnections;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.SaveAsExecute(Sender: TObject);
|
procedure TMainForm.SaveAsExecute(Sender: TObject);
|
||||||
@ -1252,7 +1313,7 @@ end;
|
|||||||
Recent dictionaries tab/handling
|
Recent dictionaries tab/handling
|
||||||
---------------------------------------------------------------------}
|
---------------------------------------------------------------------}
|
||||||
|
|
||||||
procedure TMainForm.LVDictsDblClick(Sender: TObject);
|
procedure TMainForm.OpenRecentDatadict(Sender: TObject);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If (LVDicts.Selected<>Nil)
|
If (LVDicts.Selected<>Nil)
|
||||||
@ -1264,10 +1325,20 @@ procedure TMainForm.LVDictsKeyUp(Sender: TObject; var Key: Word;
|
|||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if key=VK_DELETE then
|
if key=VK_DELETE then
|
||||||
begin
|
DeleteRecentDataDict;
|
||||||
FRecentDicts.Delete(FRecentDicts.FindByName(LVDicts.ItemFocused.Caption).Index);
|
end;
|
||||||
ShowRecentDictionaries;
|
|
||||||
end;
|
procedure TMainForm.DeleteRecentDataDict;
|
||||||
|
|
||||||
|
Var
|
||||||
|
D: TRecentDatadict;
|
||||||
|
begin
|
||||||
|
If (LVDicts.Selected<>Nil) and (LVDicts.Selected.Data<>Nil) then
|
||||||
|
begin
|
||||||
|
D:=TRecentDatadict(LVDicts.Selected.Data);
|
||||||
|
FRecentDicts.Delete(D.Index);
|
||||||
|
ShowRecentDictionaries;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.MIDataDictClick(Sender: TObject);
|
procedure TMainForm.MIDataDictClick(Sender: TObject);
|
||||||
@ -1404,6 +1475,7 @@ Var
|
|||||||
RC : TRecentConnection;
|
RC : TRecentConnection;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
DDE:=CreateDictionaryEngine(EngineName,Self);
|
DDE:=CreateDictionaryEngine(EngineName,Self);
|
||||||
CS:=DDE.GetConnectString;
|
CS:=DDE.GetConnectString;
|
||||||
If (CS='') then
|
If (CS='') then
|
||||||
@ -1443,8 +1515,14 @@ end;
|
|||||||
Function TMainForm.SelectEngineType(out EngineName : String) : Boolean;
|
Function TMainForm.SelectEngineType(out EngineName : String) : Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
EngineName:='SQLDB';
|
With TSelectConnectionTypeForm.Create(Self) do
|
||||||
Result := True;
|
try
|
||||||
|
Result:=(ShowModal=mrOK);
|
||||||
|
If Result then
|
||||||
|
EngineName:=SelectedConnection;
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
29
tools/lazdatadesktop/frmselectconnectiontype.lfm
Normal file
29
tools/lazdatadesktop/frmselectconnectiontype.lfm
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
object SelectConnectionTypeForm: TSelectConnectionTypeForm
|
||||||
|
Left = 413
|
||||||
|
Height = 241
|
||||||
|
Top = 207
|
||||||
|
Width = 335
|
||||||
|
Caption = 'Select a connection type'
|
||||||
|
ClientHeight = 241
|
||||||
|
ClientWidth = 335
|
||||||
|
OnCreate = FormCreate
|
||||||
|
LCLVersion = '0.9.27'
|
||||||
|
object LBConnections: TListBox
|
||||||
|
Left = 0
|
||||||
|
Height = 191
|
||||||
|
Top = 0
|
||||||
|
Width = 335
|
||||||
|
Align = alClient
|
||||||
|
ItemHeight = 0
|
||||||
|
TabOrder = 0
|
||||||
|
TopIndex = -1
|
||||||
|
end
|
||||||
|
object BPConnections: TButtonPanel
|
||||||
|
Left = 6
|
||||||
|
Height = 38
|
||||||
|
Top = 197
|
||||||
|
Width = 323
|
||||||
|
TabOrder = 1
|
||||||
|
ShowButtons = [pbOK, pbCancel]
|
||||||
|
end
|
||||||
|
end
|
12
tools/lazdatadesktop/frmselectconnectiontype.lrs
Normal file
12
tools/lazdatadesktop/frmselectconnectiontype.lrs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
|
LazarusResources.Add('TSelectConnectionTypeForm','FORMDATA',[
|
||||||
|
'TPF0'#25'TSelectConnectionTypeForm'#24'SelectConnectionTypeForm'#4'Left'#3
|
||||||
|
+#157#1#6'Height'#3#241#0#3'Top'#3#207#0#5'Width'#3'O'#1#7'Caption'#6#24'Sele'
|
||||||
|
+'ct a connection type'#12'ClientHeight'#3#241#0#11'ClientWidth'#3'O'#1#8'OnC'
|
||||||
|
+'reate'#7#10'FormCreate'#10'LCLVersion'#6#6'0.9.27'#0#8'TListBox'#13'LBConne'
|
||||||
|
+'ctions'#4'Left'#2#0#6'Height'#3#191#0#3'Top'#2#0#5'Width'#3'O'#1#5'Align'#7
|
||||||
|
+#8'alClient'#10'ItemHeight'#2#0#8'TabOrder'#2#0#8'TopIndex'#2#255#0#0#12'TBu'
|
||||||
|
+'ttonPanel'#13'BPConnections'#4'Left'#2#6#6'Height'#2'&'#3'Top'#3#197#0#5'Wi'
|
||||||
|
+'dth'#3'C'#1#8'TabOrder'#2#1#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#0#0#0#0
|
||||||
|
]);
|
86
tools/lazdatadesktop/frmselectconnectiontype.pp
Normal file
86
tools/lazdatadesktop/frmselectconnectiontype.pp
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
unit frmselectconnectiontype;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
|
StdCtrls, ButtonPanel;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TSelectConnectionTypeForm }
|
||||||
|
|
||||||
|
TSelectConnectionTypeForm = class(TForm)
|
||||||
|
BPConnections: TButtonPanel;
|
||||||
|
LBConnections: TListBox;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
function GetSelected: String;
|
||||||
|
{ private declarations }
|
||||||
|
public
|
||||||
|
{ public declarations }
|
||||||
|
Property SelectedConnection : String Read GetSelected;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
SelectConnectionTypeForm: TSelectConnectionTypeForm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses fpdatadict;
|
||||||
|
|
||||||
|
{ TSelectConnectionTypeForm }
|
||||||
|
|
||||||
|
Type
|
||||||
|
|
||||||
|
{ TEngineObject }
|
||||||
|
|
||||||
|
TEngineObject = Class(TComponent)
|
||||||
|
private
|
||||||
|
FEN: String;
|
||||||
|
Public
|
||||||
|
Property EngineName : String Read FEN Write FEN;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSelectConnectionTypeForm.FormCreate(Sender: TObject);
|
||||||
|
|
||||||
|
Var
|
||||||
|
L : TstringList;
|
||||||
|
I : Integer;
|
||||||
|
E : TEngineObject;
|
||||||
|
dd,dt : string;
|
||||||
|
cap : TFPDDEngineCapabilities;
|
||||||
|
|
||||||
|
begin
|
||||||
|
L:=TStringList.Create;
|
||||||
|
try
|
||||||
|
GetDictionaryEngineList(L);
|
||||||
|
L.Sorted:=True;
|
||||||
|
For i:=0 to L.Count-1 do
|
||||||
|
begin
|
||||||
|
GetDictionaryEngineInfo(L[i],dd,dt,cap);
|
||||||
|
E:=TEngineObject.Create(Self);
|
||||||
|
E.EngineName:=L[i];
|
||||||
|
LBConnections.Items.AddObject(DD,E);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
L.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TSelectConnectionTypeForm.GetSelected: String;
|
||||||
|
begin
|
||||||
|
If LBConnections.ItemIndex=-1 then
|
||||||
|
Result:=''
|
||||||
|
else
|
||||||
|
Result:=TengineObject(LBConnections.Items.Objects[LBConnections.ItemIndex]).EngineName;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I frmselectconnectiontype.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -1,9 +1,11 @@
|
|||||||
|
{ 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#13'ActiveControl'#7#9'EHostName'#11'Bo'
|
+#215#0#3'Top'#3#198#1#5'Width'#3'Y'#1#13'ActiveControl'#7#9'EHostName'#11'Bo'
|
||||||
+'rderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6
|
+'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
|
+#21'Connect to a database'#12'ClientHeight'#3#215#0#11'ClientWidth'#3'Y'#1#10
|
||||||
+'LCLVersion'#6#6'0.9.25'#0#6'TLabel'#10'LEHostName'#4'Left'#2#8#6'Height'#2
|
+'LCLVersion'#6#6'0.9.27'#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
|
+#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'
|
+#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'
|
+'r'#11'ParentColor'#8#0#0#6'TLabel'#14'LEDatabaseName'#4'Left'#2#8#6'Height'
|
||||||
@ -15,16 +17,20 @@ LazarusResources.Add('TSQLConnectionForm','FORMDATA',[
|
|||||||
+'t'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#10'LEPassword'#4'Left'#2#8
|
+'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
|
+#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'
|
+'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'
|
+'out'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TLabel'#8'LCharset'#4'Left'#2'$'
|
||||||
+#6'Height'#2#23#3'Top'#2#15#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'
|
+#6'Height'#2#21#3'Top'#3#143#0#5'Width'#2'.'#9'Alignment'#7#14'taRightJustif'
|
||||||
+#7'akRight'#0#8'TabOrder'#2#0#0#0#5'TEdit'#13'EDatabaseName'#4'Left'#2'Y'#6
|
+'y'#8'AutoSize'#8#7'Caption'#6#8'&Charset'#12'FocusControl'#7#8'ECharset'#6
|
||||||
+'Height'#2#23#3'Top'#2'+'#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'#7
|
+'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#5'TEdit'#9'EHostName'#4'Left'#2
|
||||||
+'akRight'#0#8'TabOrder'#2#1#0#0#5'TEdit'#9'EUserName'#4'Left'#2'Y'#6'Height'
|
+'Y'#6'Height'#2#24#3'Top'#2#15#5'Width'#3#247#0#7'Anchors'#11#5'akTop'#6'akL'
|
||||||
+#2#23#3'Top'#2'J'#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRigh'
|
+'eft'#7'akRight'#0#8'TabOrder'#2#0#0#0#5'TEdit'#13'EDatabaseName'#4'Left'#2
|
||||||
+'t'#0#8'TabOrder'#2#2#0#0#5'TEdit'#9'EPassword'#4'Left'#2'Y'#6'Height'#2#23#3
|
+'Y'#6'Height'#2#24#3'Top'#2'+'#5'Width'#3#247#0#7'Anchors'#11#5'akTop'#6'akL'
|
||||||
+'Top'#2'i'#5'Width'#3#216#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8
|
+'eft'#7'akRight'#0#8'TabOrder'#2#1#0#0#5'TEdit'#9'EUserName'#4'Left'#2'Y'#6
|
||||||
+'EchoMode'#7#10'emPassword'#12'PasswordChar'#6#1'*'#8'TabOrder'#2#3#0#0#12'T'
|
+'Height'#2#24#3'Top'#2'J'#5'Width'#3#247#0#7'Anchors'#11#5'akTop'#6'akLeft'#7
|
||||||
+'ButtonPanel'#9'BPButtons'#4'Left'#2#6#6'Height'#2'*'#3'Top'#3#135#0#5'Width'
|
+'akRight'#0#8'TabOrder'#2#2#0#0#5'TEdit'#9'EPassword'#4'Left'#2'Y'#6'Height'
|
||||||
+#3'.'#1#5'Align'#7#8'alBottom'#8'AutoSize'#9#8'TabOrder'#2#4#11'ShowButtons'
|
+#2#24#3'Top'#2'i'#5'Width'#3#247#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRigh'
|
||||||
+#11#4'pbOK'#8'pbCancel'#0#0#0#0
|
+'t'#0#8'EchoMode'#7#10'emPassword'#12'PasswordChar'#6#1'*'#8'TabOrder'#2#3#0
|
||||||
|
+#0#12'TButtonPanel'#9'BPButtons'#4'Left'#2#6#6'Height'#2'&'#3'Top'#3#171#0#5
|
||||||
|
+'Width'#3'M'#1#8'TabOrder'#2#4#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#0#0#0#5
|
||||||
|
+'TEdit'#8'ECharset'#4'Left'#2'\'#6'Height'#2#24#3'Top'#3#140#0#5'Width'#2'T'
|
||||||
|
+#8'TabOrder'#2#5#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<PackageName Value="lazdbexport"/>
|
<PackageName Value="lazdbexport"/>
|
||||||
</Item7>
|
</Item7>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="11">
|
<Units Count="12">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="lazdatadesktop.lpr"/>
|
<Filename Value="lazdatadesktop.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -56,8 +56,8 @@
|
|||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="frmmain.pp"/>
|
<Filename Value="frmmain.pp"/>
|
||||||
<ComponentName Value="MainForm"/>
|
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="MainForm"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="frmmain"/>
|
<UnitName Value="frmmain"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
@ -68,21 +68,21 @@
|
|||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="frmimportdd.pp"/>
|
<Filename Value="frmimportdd.pp"/>
|
||||||
<ComponentName Value="ImportDDform"/>
|
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="ImportDDform"/>
|
||||||
<UnitName Value="frmimportdd"/>
|
<UnitName Value="frmimportdd"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="frmgeneratesql.pp"/>
|
<Filename Value="frmgeneratesql.pp"/>
|
||||||
<ComponentName Value="GenerateSQLForm"/>
|
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="GenerateSQLForm"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="frmgeneratesql"/>
|
<UnitName Value="frmgeneratesql"/>
|
||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
<Filename Value="frmsqlconnect.pp"/>
|
<Filename Value="frmsqlconnect.pp"/>
|
||||||
<ComponentName Value="SQLConnectionForm"/>
|
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="SQLConnectionForm"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="frmSQLConnect"/>
|
<UnitName Value="frmSQLConnect"/>
|
||||||
</Unit5>
|
</Unit5>
|
||||||
@ -110,6 +110,13 @@
|
|||||||
<Filename Value="README.txt"/>
|
<Filename Value="README.txt"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
</Unit10>
|
</Unit10>
|
||||||
|
<Unit11>
|
||||||
|
<Filename Value="frmselectconnectiontype.pp"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="SelectConnectionTypeForm"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="frmselectconnectiontype"/>
|
||||||
|
</Unit11>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
@ -11,7 +11,7 @@ uses
|
|||||||
{ add your units here }, frmmain, dicteditor, DBFLaz,
|
{ add your units here }, frmmain, dicteditor, DBFLaz,
|
||||||
frmimportdd, RunTimeTypeInfoControls, frmgeneratesql, SQLDBLaz,
|
frmimportdd, RunTimeTypeInfoControls, frmgeneratesql, SQLDBLaz,
|
||||||
frmSQLConnect, ddfiles, conneditor, datapanel, querypanel, lazdbexport,
|
frmSQLConnect, ddfiles, conneditor, datapanel, querypanel, lazdbexport,
|
||||||
lazdatadict;
|
lazdatadict, frmselectconnectiontype;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Application.Title:='Lazarus Data Desktop';
|
Application.Title:='Lazarus Data Desktop';
|
||||||
|
Loading…
Reference in New Issue
Block a user