Skip to content

Commit 868ca7d

Browse files
authored
Merge pull request pyscripter#255 from Embarcadero/fmxcomctrlswrappers
Fmx ComCtrls wrappers
2 parents 46d2e38 + c5130ba commit 868ca7d

File tree

1 file changed

+129
-0
lines changed

1 file changed

+129
-0
lines changed

Source/fmx/WrapFmxComCtrls.pas

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
unit WrapFmxComCtrls;
2+
3+
interface
4+
5+
uses
6+
FMX.Controls.Presentation, FMX.MultiView, FMX.TabControl, WrapFmxControls;
7+
8+
type
9+
TPyDelphiTabControl = class(TPyDelphiStyledControl)
10+
private
11+
function GetDelphiObject: TTabControl;
12+
procedure SetDelphiObject(const Value: TTabControl);
13+
public
14+
class function DelphiObjectClass: TClass; override;
15+
// Properties
16+
property DelphiObject: TTabControl read GetDelphiObject write SetDelphiObject;
17+
end;
18+
19+
TPyDelphiCustomMultiView = class(TPyDelphiPresentedControl)
20+
private
21+
function GetDelphiObject: TCustomMultiView;
22+
procedure SetDelphiObject(const Value: TCustomMultiView);
23+
public
24+
class function DelphiObjectClass: TClass; override;
25+
// Properties
26+
property DelphiObject: TCustomMultiView read GetDelphiObject write SetDelphiObject;
27+
end;
28+
29+
TPyDelphiMultiView = class(TPyDelphiCustomMultiView)
30+
private
31+
function GetDelphiObject: TMultiView;
32+
procedure SetDelphiObject(const Value: TMultiView);
33+
public
34+
class function DelphiObjectClass: TClass; override;
35+
// Properties
36+
property DelphiObject: TMultiView read GetDelphiObject write SetDelphiObject;
37+
end;
38+
39+
implementation
40+
41+
uses
42+
WrapDelphi;
43+
44+
{ Register the wrappers, the globals and the constants }
45+
type
46+
TComCtrlsRegistration = class(TRegisteredUnit)
47+
public
48+
function Name: string; override;
49+
procedure RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper); override;
50+
procedure DefineVars(APyDelphiWrapper: TPyDelphiWrapper); override;
51+
end;
52+
53+
{ TComCtrlsRegistration }
54+
55+
procedure TComCtrlsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
56+
begin
57+
inherited;
58+
end;
59+
60+
function TComCtrlsRegistration.Name: string;
61+
begin
62+
Result := 'ComCtrls';
63+
end;
64+
65+
procedure TComCtrlsRegistration.RegisterWrappers(
66+
APyDelphiWrapper: TPyDelphiWrapper);
67+
begin
68+
inherited;
69+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTabControl);
70+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomMultiView);
71+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiMultiView);
72+
end;
73+
74+
{ TPyDelphiTabControl }
75+
76+
class function TPyDelphiTabControl.DelphiObjectClass: TClass;
77+
begin
78+
Result := TTabControl;
79+
end;
80+
81+
function TPyDelphiTabControl.GetDelphiObject: TTabControl;
82+
begin
83+
Result := TTabControl(inherited DelphiObject);
84+
end;
85+
86+
procedure TPyDelphiTabControl.SetDelphiObject(const Value: TTabControl);
87+
begin
88+
inherited DelphiObject := Value;
89+
end;
90+
91+
{ TPyDelphiCustomMultiView }
92+
93+
class function TPyDelphiCustomMultiView.DelphiObjectClass: TClass;
94+
begin
95+
Result := TCustomMultiView;
96+
end;
97+
98+
function TPyDelphiCustomMultiView.GetDelphiObject: TCustomMultiView;
99+
begin
100+
Result := TCustomMultiView(inherited DelphiObject);
101+
end;
102+
103+
procedure TPyDelphiCustomMultiView.SetDelphiObject(
104+
const Value: TCustomMultiView);
105+
begin
106+
inherited DelphiObject := Value;
107+
end;
108+
109+
{ TPyDelphiMultiView }
110+
111+
class function TPyDelphiMultiView.DelphiObjectClass: TClass;
112+
begin
113+
Result := TMultiView;
114+
end;
115+
116+
function TPyDelphiMultiView.GetDelphiObject: TMultiView;
117+
begin
118+
Result := TMultiView(inherited DelphiObject);
119+
end;
120+
121+
procedure TPyDelphiMultiView.SetDelphiObject(const Value: TMultiView);
122+
begin
123+
inherited DelphiObject := Value;
124+
end;
125+
126+
initialization
127+
RegisteredUnits.Add( TComCtrlsRegistration.Create );
128+
129+
end.

0 commit comments

Comments
 (0)