forked from lmbelo/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrapFmxActnList.pas
More file actions
183 lines (150 loc) · 4.92 KB
/
Copy pathWrapFmxActnList.pas
File metadata and controls
183 lines (150 loc) · 4.92 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{$I ..\Definition.Inc}
unit WrapFmxActnList;
interface
uses
System.Classes, FMX.ActnList, PythonEngine, WrapDelphi, WrapDelphiClasses,
System.Actions, WrapActions;
type
TPyDelphiCustomActionList = class(TPyDelphiContainedActionList)
private
function GetDelphiObject: TCustomActionList;
procedure SetDelphiObject(const Value: TCustomActionList);
public
class function DelphiObjectClass: TClass; override;
property DelphiObject: TCustomActionList read GetDelphiObject
write SetDelphiObject;
end;
TPyDelphiActionList = class(TPyDelphiCustomActionList)
private
function GetDelphiObject: TActionList;
procedure SetDelphiObject(const Value: TActionList);
public
// Class methods
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TActionList read GetDelphiObject
write SetDelphiObject;
end;
TPyDelphiCustomAction = class(TPyDelphiContainedAction)
private
function GetDelphiObject: TCustomAction;
procedure SetDelphiObject(const Value: TCustomAction);
public
class function DelphiObjectClass: TClass; override;
property DelphiObject: TCustomAction read GetDelphiObject
write SetDelphiObject;
end;
TPyDelphiAction = class(TPyDelphiContainedAction)
private
function GetDelphiObject: TAction;
procedure SetDelphiObject(const Value: TAction);
public
class function DelphiObjectClass: TClass; override;
property DelphiObject: TAction read GetDelphiObject write SetDelphiObject;
end;
TPyDelphiCustomViewAction = class(TPyDelphiCustomAction)
private
function GetDelphiObject: TCustomViewAction;
procedure SetDelphiObject(const Value: TCustomViewAction);
public
class function DelphiObjectClass: TClass; override;
property DelphiObject: TCustomViewAction read GetDelphiObject write SetDelphiObject;
end;
implementation
{ Register the wrappers, the globals and the constants }
type
TActnListRegistration = class(TRegisteredUnit)
public
function Name: string; override;
procedure RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper); override;
procedure DefineVars(APyDelphiWrapper: TPyDelphiWrapper); override;
end;
{ TActnListRegistration }
procedure TActnListRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
end;
function TActnListRegistration.Name: string;
begin
Result := 'FMX ActnList';
end;
procedure TActnListRegistration.RegisterWrappers(APyDelphiWrapper
: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomActionList);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiActionList);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomAction);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiAction);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomViewAction);
end;
{ TPyDelphiCustomActionList }
class function TPyDelphiCustomActionList.DelphiObjectClass: TClass;
begin
Result := TCustomActionList;
end;
function TPyDelphiCustomActionList.GetDelphiObject: TCustomActionList;
begin
Result := TCustomActionList(inherited DelphiObject);
end;
procedure TPyDelphiCustomActionList.SetDelphiObject
(const Value: TCustomActionList);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiActionList }
class function TPyDelphiActionList.DelphiObjectClass: TClass;
begin
Result := TActionList;
end;
function TPyDelphiActionList.GetDelphiObject: TActionList;
begin
Result := TActionList(inherited DelphiObject);
end;
procedure TPyDelphiActionList.SetDelphiObject(const Value: TActionList);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiCustomAction }
class function TPyDelphiCustomAction.DelphiObjectClass: TClass;
begin
Result := TCustomAction;
end;
function TPyDelphiCustomAction.GetDelphiObject: TCustomAction;
begin
Result := TCustomAction(inherited DelphiObject);
end;
procedure TPyDelphiCustomAction.SetDelphiObject(const Value: TCustomAction);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiAction }
class function TPyDelphiAction.DelphiObjectClass: TClass;
begin
Result := TAction;
end;
function TPyDelphiAction.GetDelphiObject: TAction;
begin
Result := TAction(inherited DelphiObject);
end;
procedure TPyDelphiAction.SetDelphiObject(const Value: TAction);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiCustomViewAction }
class function TPyDelphiCustomViewAction.DelphiObjectClass: TClass;
begin
Result := TCustomViewAction;
end;
function TPyDelphiCustomViewAction.GetDelphiObject: TCustomViewAction;
begin
Result := TCustomViewAction(inherited DelphiObject);
end;
procedure TPyDelphiCustomViewAction.SetDelphiObject(
const Value: TCustomViewAction);
begin
inherited DelphiObject := Value;
end;
initialization
RegisteredUnits.Add(TActnListRegistration.Create());
end.