Skip to content

Commit d1ed51f

Browse files
committed
delphi: Replace deprecated DataSet with DataSource
- Field TdxBackendDataSetCollectionItem.DataSet is deprecated. This PR replaces it with DataSource. See: https://docs.devexpress.com/VCL/dxBackend.ConnectionString.JSON.DataSet.TdxBackendDataSetCollectionItem.DataSet https://docs.devexpress.com/VCL/dxBackend.ConnectionString.JSON.DataSet.TdxBackendDataSetCollectionItem.DataSource. - Remove the unused SQLite database connection. - Cleanup the form layout and layout manager.
1 parent e676611 commit d1ed51f

2 files changed

Lines changed: 13 additions & 36 deletions

File tree

Delphi/uMainForm.dfm

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object MainForm: TMainForm
2222
AutoSize = True
2323
object btnPreview: TcxButton
2424
Left = 12
25-
Top = 24
25+
Top = 12
2626
Width = 557
2727
Height = 25
2828
Caption = 'Preview Report'
@@ -31,12 +31,12 @@ object MainForm: TMainForm
3131
end
3232
object cxGrid1: TcxGrid
3333
Left = 12
34-
Top = 56
34+
Top = 44
3535
Width = 557
3636
Height = 345
3737
TabOrder = 1
3838
object gvProducts: TcxGridDBTableView
39-
DataController.DataSource = DataSource1
39+
DataController.DataSource = dsProducts
4040
OptionsData.CancelOnExit = False
4141
OptionsData.Deleting = False
4242
OptionsData.DeletingConfirmation = False
@@ -85,34 +85,27 @@ object MainForm: TMainForm
8585
Index = -1
8686
end
8787
object liPreview: TdxLayoutItem
88-
Parent = dxLayoutGroup2
88+
Parent = dxButtons
8989
CaptionOptions.Text = 'btnViewReport'
9090
CaptionOptions.Visible = False
9191
Control = btnPreview
9292
ControlOptions.OriginalHeight = 25
93-
ControlOptions.OriginalWidth = 193
93+
ControlOptions.OriginalWidth = 557
9494
ControlOptions.ShowBorder = False
9595
Index = 0
9696
end
9797
object dxLayoutLabeledItem1: TdxLayoutLabeledItem
9898
CaptionOptions.Text = 'Label'
9999
Index = -1
100100
end
101-
object dxLayoutGroup1: TdxLayoutGroup
102-
Parent = dxLayoutGroup3
101+
object dxButtons: TdxLayoutGroup
102+
Parent = dxLayoutControl1Group_Root
103103
CaptionOptions.Text = 'New Group'
104104
CaptionOptions.Visible = False
105105
ShowBorder = False
106106
Index = 0
107107
end
108-
object dxLayoutGroup2: TdxLayoutGroup
109-
Parent = dxLayoutGroup3
110-
CaptionOptions.Text = 'New Group'
111-
CaptionOptions.Visible = False
112-
ShowBorder = False
113-
Index = 1
114-
end
115-
object dxLayoutItem1: TdxLayoutItem
108+
object dxGrid: TdxLayoutItem
116109
Parent = dxLayoutControl1Group_Root
117110
AlignHorz = ahLeft
118111
CaptionOptions.Text = 'cxGrid1'
@@ -123,13 +116,6 @@ object MainForm: TMainForm
123116
ControlOptions.ShowBorder = False
124117
Index = 1
125118
end
126-
object dxLayoutGroup3: TdxLayoutGroup
127-
Parent = dxLayoutControl1Group_Root
128-
CaptionOptions.Text = 'New Group'
129-
ItemIndex = 1
130-
ShowBorder = False
131-
Index = 0
132-
end
133119
end
134120
object dxReport1: TdxReport
135121
ReportName = 'Product List Report'
@@ -382,15 +368,9 @@ object MainForm: TMainForm
382368
object dxReportDataConnectionManager: TdxBackendDataConnectionManager
383369
Left = 40
384370
Top = 144
385-
object ReportsNWindConnectionString: TdxBackendDatabaseSQLConnection
386-
DisplayName = 'NWindConnectionString'
387-
ConnectionString =
388-
'XpoProvider=SQLite; Data Source=|DataDirectory|\..\..\..\nwind.d' +
389-
'b; Mode=ReadOnly'
390-
end
391371
object NWindMemDataConnection: TdxBackendDataSetJSONConnection
392372
object NWindMemDataConnectionItem1: TdxBackendDataSetCollectionItem
393-
DataSet = mdProducts
373+
DataSource = dsProducts
394374
DataSetAlias = 'Products'
395375
end
396376
end
@@ -401,7 +381,7 @@ object MainForm: TMainForm
401381
Left = 88
402382
Top = 144
403383
end
404-
object DataSource1: TDataSource
384+
object dsProducts: TDataSource
405385
DataSet = mdProducts
406386
Left = 88
407387
Top = 192

Delphi/uMainForm.pas

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,17 @@ TMainForm = class(TForm)
2424
dxReport1: TdxReport;
2525
btnPreview: TcxButton;
2626
dxReportDataConnectionManager: TdxBackendDataConnectionManager;
27-
ReportsNWindConnectionString: TdxBackendDatabaseSQLConnection;
2827
dxLayoutControl1Group_Root: TdxLayoutGroup;
2928
dxLayoutControl1: TdxLayoutControl;
3029
liPreview: TdxLayoutItem;
3130
dxSkinController1: TdxSkinController;
3231
dxLayoutLabeledItem1: TdxLayoutLabeledItem;
33-
dxLayoutGroup1: TdxLayoutGroup;
34-
dxLayoutGroup2: TdxLayoutGroup;
32+
dxButtons: TdxLayoutGroup;
3533
gvProducts: TcxGridDBTableView;
3634
cxGrid1Level1: TcxGridLevel;
3735
cxGrid1: TcxGrid;
38-
dxLayoutItem1: TdxLayoutItem;
39-
dxLayoutGroup3: TdxLayoutGroup;
40-
DataSource1: TDataSource;
36+
dxGrid: TdxLayoutItem;
37+
dsProducts: TDataSource;
4138
gvProductsProductID: TcxGridDBColumn;
4239
gvProductsProductName: TcxGridDBColumn;
4340
gvProductsQuantityPerUnit: TcxGridDBColumn;

0 commit comments

Comments
 (0)