Skip to content

Commit a40578f

Browse files
committed
cpp-builder: 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 1d231aa commit a40578f

2 files changed

Lines changed: 14 additions & 34 deletions

File tree

CPB/uMainForm.dfm

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
object MainForm: TMainForm
22
Left = 0
33
Top = 0
4+
Width = 657
5+
Height = 464
6+
AutoScroll = True
47
AutoSize = True
58
Caption = 'DevExpress Example - Filter Data Records in a Report'
6-
ClientHeight = 425
7-
ClientWidth = 641
89
Color = clBtnFace
910
Font.Charset = DEFAULT_CHARSET
1011
Font.Color = clWindowText
@@ -21,7 +22,7 @@ object MainForm: TMainForm
2122
AutoSize = True
2223
object btnPreview: TcxButton
2324
Left = 12
24-
Top = 24
25+
Top = 12
2526
Width = 557
2627
Height = 25
2728
Caption = 'Preview Report'
@@ -30,12 +31,12 @@ object MainForm: TMainForm
3031
end
3132
object cxGrid1: TcxGrid
3233
Left = 12
33-
Top = 56
34+
Top = 44
3435
Width = 557
3536
Height = 345
3637
TabOrder = 1
3738
object gvProducts: TcxGridDBTableView
38-
DataController.DataSource = DataSource1
39+
DataController.DataSource = dsProducts
3940
OptionsData.CancelOnExit = False
4041
OptionsData.Deleting = False
4142
OptionsData.DeletingConfirmation = False
@@ -84,34 +85,27 @@ object MainForm: TMainForm
8485
Index = -1
8586
end
8687
object liPreview: TdxLayoutItem
87-
Parent = dxLayoutGroup2
88+
Parent = dxButtons
8889
CaptionOptions.Text = 'btnViewReport'
8990
CaptionOptions.Visible = False
9091
Control = btnPreview
9192
ControlOptions.OriginalHeight = 25
92-
ControlOptions.OriginalWidth = 193
93+
ControlOptions.OriginalWidth = 557
9394
ControlOptions.ShowBorder = False
9495
Index = 0
9596
end
9697
object dxLayoutLabeledItem1: TdxLayoutLabeledItem
9798
CaptionOptions.Text = 'Label'
9899
Index = -1
99100
end
100-
object dxLayoutGroup1: TdxLayoutGroup
101-
Parent = dxLayoutGroup3
101+
object dxButtons: TdxLayoutGroup
102+
Parent = dxLayoutControl1Group_Root
102103
CaptionOptions.Text = 'New Group'
103104
CaptionOptions.Visible = False
104105
ShowBorder = False
105106
Index = 0
106107
end
107-
object dxLayoutGroup2: TdxLayoutGroup
108-
Parent = dxLayoutGroup3
109-
CaptionOptions.Text = 'New Group'
110-
CaptionOptions.Visible = False
111-
ShowBorder = False
112-
Index = 1
113-
end
114-
object dxLayoutItem1: TdxLayoutItem
108+
object dxGrid: TdxLayoutItem
115109
Parent = dxLayoutControl1Group_Root
116110
AlignHorz = ahLeft
117111
CaptionOptions.Text = 'cxGrid1'
@@ -122,13 +116,6 @@ object MainForm: TMainForm
122116
ControlOptions.ShowBorder = False
123117
Index = 1
124118
end
125-
object dxLayoutGroup3: TdxLayoutGroup
126-
Parent = dxLayoutControl1Group_Root
127-
CaptionOptions.Text = 'New Group'
128-
ItemIndex = 1
129-
ShowBorder = False
130-
Index = 0
131-
end
132119
end
133120
object dxReport1: TdxReport
134121
ReportName = 'Product List Report'
@@ -381,15 +368,9 @@ object MainForm: TMainForm
381368
object dxReportDataConnectionManager: TdxBackendDataConnectionManager
382369
Left = 40
383370
Top = 144
384-
object ReportsNWindConnectionString: TdxBackendDatabaseSQLConnection
385-
DisplayName = 'NWindConnectionString'
386-
ConnectionString =
387-
'XpoProvider=SQLite; Data Source=|DataDirectory|\..\..\..\nwind.d' +
388-
'b; Mode=ReadOnly'
389-
end
390371
object NWindMemDataConnection: TdxBackendDataSetJSONConnection
391372
object NWindMemDataConnectionItem1: TdxBackendDataSetCollectionItem
392-
DataSet = mdProducts
373+
DataSource = dsProducts
393374
DataSetAlias = 'Products'
394375
end
395376
end
@@ -400,7 +381,7 @@ object MainForm: TMainForm
400381
Left = 88
401382
Top = 144
402383
end
403-
object DataSource1: TDataSource
384+
object dsProducts: TDataSource
404385
DataSet = mdProducts
405386
Left = 88
406387
Top = 192

CPB/uMainForm.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ class TMainForm : public TForm
6868
TdxLayoutGroup *dxLayoutGroup3;
6969
TdxReport *dxReport1;
7070
TdxBackendDataConnectionManager *dxReportDataConnectionManager;
71-
TdxBackendDatabaseSQLConnection *ReportsNWindConnectionString;
7271
TdxBackendDataSetJSONConnection *NWindMemDataConnection;
7372
TdxBackendDataSetCollectionItem *NWindMemDataConnectionItem1;
7473
TdxSkinController *dxSkinController1;
75-
TDataSource *DataSource1;
74+
TDataSource *dsProducts;
7675
TdxMemData *mdProducts;
7776
TIntegerField *mdProductsProductID;
7877
TWideStringField *mdProductsProductName;

0 commit comments

Comments
 (0)