-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMultiDetailMainFormU.pas
89 lines (75 loc) · 2.84 KB
/
MultiDetailMainFormU.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//---------------------------------------------------------------------------
// This software is Copyright (c) 2015 Embarcadero Technologies, Inc.
// You may only use this software if you are an authorized licensee
// of an Embarcadero developer tools product.
// This software is considered a Redistributable as defined under
// the software license agreement that comes with the Embarcadero Products
// and is subject to that software license agreement.
//---------------------------------------------------------------------------
unit MultiDetailMainFormU;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.ListView.Types, FMX.ListView.Appearances,
FMX.StdCtrls, FMX.ListView, Data.Bind.GenData,
Fmx.Bind.GenData, System.Rtti, System.Bindings.Outputs, Fmx.Bind.Editors,
Data.Bind.EngExt, Fmx.Bind.DBEngExt, Data.Bind.Components,
Data.Bind.ObjectScope, FMX.ListBox,
FMX.TabControl, FMX.Objects, MultiDetailAppearanceU, FMX.MobilePreview, FMX.Controls.Presentation;
type
TForm594 = class(TForm)
ToolBar1: TToolBar;
ToggleEditMode: TSpeedButton;
PrototypeBindSource1: TPrototypeBindSource;
BindingsList1: TBindingsList;
ListViewMultiDetail: TListView;
LinkFillControlToField1: TLinkFillControlToField;
SpeedButtonLiveBindings: TSpeedButton;
ToolBar2: TToolBar;
SpeedButtonFill: TSpeedButton;
ImageRAD: TImage;
procedure ToggleEditModeClick(Sender: TObject);
procedure SpeedButtonFillClick(Sender: TObject);
procedure SpeedButtonLiveBindingsClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form594: TForm594;
implementation
{$R *.fmx}
{$R *.LgXhdpiPh.fmx ANDROID}
procedure TForm594.SpeedButtonFillClick(Sender: TObject);
var
I: Integer;
LItem: TListViewItem;
begin
// Code to fill TListView
ListViewMultiDetail.BeginUpdate;
try
ListViewMultiDetail.Items.Clear;
for I := 1 to 20 do
begin
LItem := ListViewMultiDetail.Items.Add;
LItem.Text := Format('Text %d', [I]);
// Update data managed by custom appearance
LItem.Data[TMultiDetailAppearanceNames.Detail1] := Format('Detail1_%d', [I]);
LItem.Data[TMultiDetailAppearanceNames.Detail2] := Format('Detail2_%d', [I]);
LItem.Data[TMultiDetailAppearanceNames.Detail3] := Format('Detail3_%d', [I]);
LItem.BitmapRef := ImageRAD.Bitmap;
end;
finally
ListViewMultiDetail.EndUpdate;
end;
end;
procedure TForm594.SpeedButtonLiveBindingsClick(Sender: TObject);
begin
LinkFillControlToField1.BindList.FillList;
end;
procedure TForm594.ToggleEditModeClick(Sender: TObject);
begin
ListViewMultiDetail.EditMode := not ListViewMultiDetail.EditMode;
end;
end.