forked from lmbelo/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrapFmxComCtrls.pas
More file actions
159 lines (127 loc) · 4.04 KB
/
Copy pathWrapFmxComCtrls.pas
File metadata and controls
159 lines (127 loc) · 4.04 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
{$I ..\Definition.Inc}
unit WrapFmxComCtrls;
interface
uses
FMX.Controls.Presentation, FMX.MultiView, FMX.TabControl, WrapFmxControls;
type
TPyDelphiTabControl = class(TPyDelphiStyledControl)
private
function GetDelphiObject: TTabControl;
procedure SetDelphiObject(const Value: TTabControl);
public
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TTabControl read GetDelphiObject write SetDelphiObject;
end;
TPyDelphiTabItem = class(TPyDelphiTextControl)
private
function GetDelphiObject: TTabItem;
procedure SetDelphiObject(const Value: TTabItem);
public
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TTabItem read GetDelphiObject write SetDelphiObject;
end;
TPyDelphiCustomMultiView = class(TPyDelphiPresentedControl)
private
function GetDelphiObject: TCustomMultiView;
procedure SetDelphiObject(const Value: TCustomMultiView);
public
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TCustomMultiView read GetDelphiObject write SetDelphiObject;
end;
TPyDelphiMultiView = class(TPyDelphiCustomMultiView)
private
function GetDelphiObject: TMultiView;
procedure SetDelphiObject(const Value: TMultiView);
public
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TMultiView read GetDelphiObject write SetDelphiObject;
end;
implementation
uses
WrapDelphi;
{ Register the wrappers, the globals and the constants }
type
TComCtrlsRegistration = class(TRegisteredUnit)
public
function Name: string; override;
procedure RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper); override;
procedure DefineVars(APyDelphiWrapper: TPyDelphiWrapper); override;
end;
{ TComCtrlsRegistration }
procedure TComCtrlsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
end;
function TComCtrlsRegistration.Name: string;
begin
Result := 'ComCtrls';
end;
procedure TComCtrlsRegistration.RegisterWrappers(
APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTabControl);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTabItem);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomMultiView);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiMultiView);
end;
{ TPyDelphiTabControl }
class function TPyDelphiTabControl.DelphiObjectClass: TClass;
begin
Result := TTabControl;
end;
function TPyDelphiTabControl.GetDelphiObject: TTabControl;
begin
Result := TTabControl(inherited DelphiObject);
end;
procedure TPyDelphiTabControl.SetDelphiObject(const Value: TTabControl);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiTabItem }
class function TPyDelphiTabItem.DelphiObjectClass: TClass;
begin
Result := TTabItem;
end;
function TPyDelphiTabItem.GetDelphiObject: TTabItem;
begin
Result := TTabItem(inherited DelphiObject);
end;
procedure TPyDelphiTabItem.SetDelphiObject(const Value: TTabItem);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiCustomMultiView }
class function TPyDelphiCustomMultiView.DelphiObjectClass: TClass;
begin
Result := TCustomMultiView;
end;
function TPyDelphiCustomMultiView.GetDelphiObject: TCustomMultiView;
begin
Result := TCustomMultiView(inherited DelphiObject);
end;
procedure TPyDelphiCustomMultiView.SetDelphiObject(
const Value: TCustomMultiView);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiMultiView }
class function TPyDelphiMultiView.DelphiObjectClass: TClass;
begin
Result := TMultiView;
end;
function TPyDelphiMultiView.GetDelphiObject: TMultiView;
begin
Result := TMultiView(inherited DelphiObject);
end;
procedure TPyDelphiMultiView.SetDelphiObject(const Value: TMultiView);
begin
inherited DelphiObject := Value;
end;
initialization
RegisteredUnits.Add( TComCtrlsRegistration.Create );
end.