-
-
Notifications
You must be signed in to change notification settings - Fork 317
/
Copy pathWrapVclSamplesSpin.pas
113 lines (90 loc) · 3.41 KB
/
WrapVclSamplesSpin.pas
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
(**************************************************************************)
(* This unit is part of the Python for Delphi (P4D) library *)
(* Project home: https://github.com/pyscripter/python4delphi *)
(* *)
(* Project Maintainer: PyScripter (pyscripter@gmail.com) *)
(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *)
(* Morgan Martinet (https://github.com/mmm-experts) *)
(* Core developer: Lucas Belo (lucas.belo@live.com) *)
(* Contributors: See contributors.md at project home *)
(* *)
(* LICENCE and Copyright: MIT (see project home) *)
(**************************************************************************)
{$I ..\Definition.Inc}
unit WrapVclSamplesSpin;
interface
uses
Classes, Vcl.Samples.Spin, WrapDelphi, WrapVclControls, WrapVclStdCtrls;
type
TPyDelphiSpinButton = class (TPyDelphiWinControl)
private
function GetDelphiObject: TSpinButton;
procedure SetDelphiObject(const Value: TSpinButton);
public
class function DelphiObjectClass : TClass; override;
// Properties
property DelphiObject: TSpinButton read GetDelphiObject write SetDelphiObject;
end;
TPyDelphiSpinEdit = class (TPyDelphiCustomEdit)
private
function GetDelphiObject: TSpinEdit;
procedure SetDelphiObject(const Value: TSpinEdit);
public
class function DelphiObjectClass : TClass; override;
// Properties
property DelphiObject: TSpinEdit read GetDelphiObject write SetDelphiObject;
end;
implementation
{ Register the wrappers, the globals and the constants }
type
TSamplesSpinRegistration = class(TRegisteredUnit)
public
function Name: string; override;
procedure RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper); override;
procedure DefineVars(APyDelphiWrapper: TPyDelphiWrapper); override;
end;
{ TStdCtrlsRegistration }
procedure TSamplesSpinRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
end;
function TSamplesSpinRegistration.Name: string;
begin
Result := 'Samples.Spin';
end;
procedure TSamplesSpinRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiSpinButton);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiSpinEdit);
end;
{ TPyDelphiSpinButton }
class function TPyDelphiSpinButton.DelphiObjectClass: TClass;
begin
Result := TSpinButton;
end;
function TPyDelphiSpinButton.GetDelphiObject: TSpinButton;
begin
Result := TSpinButton(inherited DelphiObject);
end;
procedure TPyDelphiSpinButton.SetDelphiObject(const Value: TSpinButton);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiSpinEdit }
class function TPyDelphiSpinEdit.DelphiObjectClass: TClass;
begin
Result := TSpinEdit;
end;
function TPyDelphiSpinEdit.GetDelphiObject: TSpinEdit;
begin
Result := TSpinEdit(inherited DelphiObject);
end;
procedure TPyDelphiSpinEdit.SetDelphiObject(const Value: TSpinEdit);
begin
inherited DelphiObject := Value;
end;
initialization
RegisteredUnits.Add( TSamplesSpinRegistration.Create );
Classes.RegisterClasses([TSpinButton, TSpinEdit]);
end.