Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
110 lines (89 loc) · 3.03 KB

File metadata and controls

110 lines (89 loc) · 3.03 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
{$I Definition.Inc}
unit WrapDelphiButtons;
interface
uses
Classes, SysUtils, PythonEngine, WrapDelphi, WrapDelphiClasses,
WrapDelphiControls, Buttons;
type
TPyDelphiSpeedButton = class (TPyDelphiControl)
private
function GetDelphiObject: TSpeedButton;
procedure SetDelphiObject(const Value: TSpeedButton);
public
class function DelphiObjectClass : TClass; override;
// Properties
property DelphiObject: TSpeedButton read GetDelphiObject write SetDelphiObject;
end;
TPyDelphiBitBtn = class (TPyDelphiWinControl)
private
function GetDelphiObject: TBitBtn;
procedure SetDelphiObject(const Value: TBitBtn);
public
class function DelphiObjectClass : TClass; override;
// Properties
property DelphiObject: TBitBtn read GetDelphiObject write SetDelphiObject;
end;
implementation
{ Register the wrappers, the globals and the constants }
type
TButtonsRegistration = class(TRegisteredUnit)
public
function Name : string; override;
procedure RegisterWrappers(APyDelphiWrapper : TPyDelphiWrapper); override;
procedure DefineVars(APyDelphiWrapper : TPyDelphiWrapper); override;
end;
{ TButtonsRegistration }
procedure TButtonsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.DefineVar('bkCustom', bkCustom);
APyDelphiWrapper.DefineVar('bkOK', bkOK);
APyDelphiWrapper.DefineVar('bkCancel', bkCancel);
APyDelphiWrapper.DefineVar('bkHelp', bkHelp);
APyDelphiWrapper.DefineVar('bkYes', bkYes);
APyDelphiWrapper.DefineVar('bkNo', bkNo);
APyDelphiWrapper.DefineVar('bkClose', bkClose);
APyDelphiWrapper.DefineVar('bkAbort', bkAbort);
APyDelphiWrapper.DefineVar('bkRetry', bkRetry);
APyDelphiWrapper.DefineVar('bkIgnore', bkIgnore);
APyDelphiWrapper.DefineVar('bkAll', bkAll);
end;
function TButtonsRegistration.Name: string;
begin
Result := 'Buttons';
end;
procedure TButtonsRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiSpeedButton);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiBitBtn);
end;
{ TPyDelphiSpeedButton }
class function TPyDelphiSpeedButton.DelphiObjectClass: TClass;
begin
Result := TSpeedButton;
end;
function TPyDelphiSpeedButton.GetDelphiObject: TSpeedButton;
begin
Result := TSpeedButton(inherited DelphiObject);
end;
procedure TPyDelphiSpeedButton.SetDelphiObject(const Value: TSpeedButton);
begin
inherited DelphiObject := Value;
end;
{ TPyDelphiBitBtn }
class function TPyDelphiBitBtn.DelphiObjectClass: TClass;
begin
Result := TBitBtn;
end;
function TPyDelphiBitBtn.GetDelphiObject: TBitBtn;
begin
Result := TBitBtn(inherited DelphiObject);
end;
procedure TPyDelphiBitBtn.SetDelphiObject(const Value: TBitBtn);
begin
inherited DelphiObject := Value;
end;
initialization
RegisteredUnits.Add( TButtonsRegistration.Create );
end.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.