forked from lmbelo/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrapFmxListBox.pas
More file actions
133 lines (105 loc) · 3.03 KB
/
Copy pathWrapFmxListBox.pas
File metadata and controls
133 lines (105 loc) · 3.03 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{$I ..\Definition.Inc}
unit WrapFmxListBox;
interface
uses
FMX.ListBox, WrapFmxTypes, WrapFmxControls, WrapFmxLayouts, PythonEngine;
type
TPyListBoxItem = class(TPyDelphiTextControl)
private
function GetDelphiObject: TListBoxItem;
procedure SetDelphiObject(const Value: TListBoxItem);
public
class function DelphiObjectClass: TClass; override;
property DelphiObject: TListBoxItem read GetDelphiObject
write SetDelphiObject;
end;
TPyDelphiCustomListBox = class(TPyDelphiScrollBox)
private
function GetDelphiObject: TCustomListBox;
procedure SetDelphiObject(const Value: TCustomListBox);
public
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TCustomListBox read GetDelphiObject
write SetDelphiObject;
end;
TPyDelphiListBox = class(TPyDelphiCustomListBox)
private
function GetDelphiObject: TListBox;
procedure SetDelphiObject(const Value: TListBox);
public
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TListBox read GetDelphiObject
write SetDelphiObject;
end;
implementation
uses
WrapDelphi;
{ Register the wrappers, the globals and the constants }
type
TListBoxRegistration = class(TRegisteredUnit)
public
function Name: string; override;
procedure RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper); override;
procedure DefineVars(APyDelphiWrapper: TPyDelphiWrapper); override;
end;
{ TListBoxRegistration }
procedure TListBoxRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
end;
function TListBoxRegistration.Name: string;
begin
Result := 'ListBox';
end;
procedure TListBoxRegistration.RegisterWrappers(
APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.RegisterDelphiWrapper(TPyListBoxItem);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomListBox);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiListBox);
end;
{ TPyListBoxItem }
class function TPyListBoxItem.DelphiObjectClass: TClass;
begin
Result := TListBoxItem;
end;
function TPyListBoxItem.GetDelphiObject: TListBoxItem;
begin
Result := TListBoxItem(inherited DelphiObject);
end;
procedure TPyListBoxItem.SetDelphiObject(const Value: TListBoxItem);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiCustomListBox }
class function TPyDelphiCustomListBox.DelphiObjectClass: TClass;
begin
Result := TCustomListBox;
end;
function TPyDelphiCustomListBox.GetDelphiObject: TCustomListBox;
begin
Result := TCustomListBox(inherited DelphiObject);
end;
procedure TPyDelphiCustomListBox.SetDelphiObject(const Value: TCustomListBox);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiListBox }
class function TPyDelphiListBox.DelphiObjectClass: TClass;
begin
Result := TListBox;
end;
function TPyDelphiListBox.GetDelphiObject: TListBox;
begin
Result := TListBox(inherited DelphiObject);
end;
procedure TPyDelphiListBox.SetDelphiObject(const Value: TListBox);
begin
inherited DelphiObject := Value;
end;
initialization
RegisteredUnits.Add(TListBoxRegistration.Create);
end.