1- { $I Definition.Inc}
1+ { $I ..\ Definition.Inc}
22
33unit WrapFmxListBox;
44
55interface
66
77uses
8- FMX.ListBox, WrapFmxTypes, PythonEngine;
8+ FMX.ListBox, WrapFmxTypes, WrapFmxControls, WrapFmxLayouts, PythonEngine;
99
1010type
11- TPyListBoxItem = class (TPyDelphiFMXObject )
11+ TPyListBoxItem = class (TPyDelphiTextControl )
1212 private
1313 function GetDelphiObject : TListBoxItem;
1414 procedure SetDelphiObject (const Value : TListBoxItem);
@@ -17,7 +17,19 @@ TPyListBoxItem = class(TPyDelphiFMXObject)
1717 property DelphiObject: TListBoxItem read GetDelphiObject
1818 write SetDelphiObject;
1919 end ;
20- TPyDelphiListBox = class (TPyDelphiFMXObject)
20+
21+ TPyDelphiCustomListBox = class (TPyDelphiScrollBox)
22+ private
23+ function GetDelphiObject : TCustomListBox;
24+ procedure SetDelphiObject (const Value : TCustomListBox);
25+ public
26+ class function DelphiObjectClass : TClass; override;
27+ // Properties
28+ property DelphiObject: TCustomListBox read GetDelphiObject
29+ write SetDelphiObject;
30+ end ;
31+
32+ TPyDelphiListBox = class (TPyDelphiCustomListBox)
2133 private
2234 function GetDelphiObject : TListBox;
2335 procedure SetDelphiObject (const Value : TListBox);
@@ -58,40 +70,59 @@ procedure TListBoxRegistration.RegisterWrappers(
5870 APyDelphiWrapper: TPyDelphiWrapper);
5971begin
6072 inherited ;
73+ APyDelphiWrapper.RegisterDelphiWrapper(TPyListBoxItem);
74+ APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomListBox);
6175 APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiListBox);
6276end ;
6377
64- { TPyDelphiListBox }
78+ { TPyListBoxItem }
6579
66- class function TPyDelphiListBox .DelphiObjectClass : TClass;
80+ class function TPyListBoxItem .DelphiObjectClass : TClass;
6781begin
6882 Result := TListBox;
6983end ;
7084
71- function TPyDelphiListBox .GetDelphiObject : TListBox ;
85+ function TPyListBoxItem .GetDelphiObject : TListBoxItem ;
7286begin
73- Result := TListBox (inherited DelphiObject);
87+ Result := TListBoxItem (inherited DelphiObject);
7488end ;
7589
90+ procedure TPyListBoxItem.SetDelphiObject (const Value : TListBoxItem);
91+ begin
92+ inherited DelphiObject := Value ;
93+ end ;
7694
77- procedure TPyDelphiListBox.SetDelphiObject (const Value : TListBox);
95+ { TPyDelphiCustomListBox }
96+
97+ class function TPyDelphiCustomListBox.DelphiObjectClass : TClass;
98+ begin
99+ Result := TCustomListBox;
100+ end ;
101+
102+ function TPyDelphiCustomListBox.GetDelphiObject : TCustomListBox;
103+ begin
104+ Result := TCustomListBox(inherited DelphiObject);
105+ end ;
106+
107+ procedure TPyDelphiCustomListBox.SetDelphiObject (const Value : TCustomListBox);
78108begin
79109 inherited DelphiObject := Value ;
80110end ;
81111
82- { TPyListBoxItem }
112+ { TPyDelphiListBox }
83113
84- class function TPyListBoxItem .DelphiObjectClass : TClass;
114+ class function TPyDelphiListBox .DelphiObjectClass : TClass;
85115begin
86116 Result := TListBox;
87117end ;
88118
89- function TPyListBoxItem .GetDelphiObject : TListBoxItem ;
119+ function TPyDelphiListBox .GetDelphiObject : TListBox ;
90120begin
91121 Result := TListBox(inherited DelphiObject);
92122end ;
93123
94- procedure TPyListBoxItem.SetDelphiObject (const Value : TListBoxItem);
124+
125+ procedure TPyDelphiListBox.SetDelphiObject (const Value : TListBox);
95126begin
96127 inherited DelphiObject := Value ;
97128end ;
0 commit comments