Skip to content

Commit 3756ea7

Browse files
authored
Wrapped TNumberBox Component
1 parent de5c5a0 commit 3756ea7

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Source/fmx/WrapFmxEdit.pas

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
interface
66

77
uses
8-
FMX.Edit, FMX.SearchBox, FMX.ComboEdit, FMX.EditBox, FMX.SpinBox,
8+
FMX.Edit, FMX.SearchBox, FMX.ComboEdit, FMX.EditBox, FMX.SpinBox, FMX.NumberBox,
99
PythonEngine, WrapFmxTypes, WrapFmxControls;
1010

1111

@@ -98,6 +98,17 @@ TPyDelphiSpinBox = class(TPyDelphiCustomEditBox)
9898
write SetDelphiObject;
9999
end;
100100

101+
TPyDelphiNumberBox = class(TPyDelphiCustomEditBox)
102+
private
103+
function GetDelphiObject: TNumberBox;
104+
procedure SetDelphiObject(const Value: TNumberBox);
105+
public
106+
class function DelphiObjectClass: TClass; override;
107+
// Properties
108+
property DelphiObject: TNumberBox read GetDelphiObject
109+
write SetDelphiObject;
110+
end;
111+
101112
implementation
102113

103114
uses
@@ -136,6 +147,7 @@ procedure TEditRegistration.RegisterWrappers(
136147
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiComboEdit);
137148
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomEditBox);
138149
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiSpinBox);
150+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiNumberBox);
139151
end;
140152

141153
{ TPyDelphiCustomEdit }
@@ -275,6 +287,23 @@ procedure TPyDelphiSpinBox.SetDelphiObject(const Value: TSpinBox);
275287
inherited DelphiObject := Value;
276288
end;
277289

290+
{ TPyDelphiNumberBox }
291+
292+
class function TPyDelphiNumberBox.DelphiObjectClass: TClass;
293+
begin
294+
Result := TNumberBox;
295+
end;
296+
297+
function TPyDelphiNumberBox.GetDelphiObject: TNumberBox;
298+
begin
299+
Result := TNumberBox(inherited DelphiObject);
300+
end;
301+
302+
procedure TPyDelphiNumberBox.SetDelphiObject(const Value: TNumberBox);
303+
begin
304+
inherited DelphiObject := Value;
305+
end;
306+
278307
initialization
279308
RegisteredUnits.Add(TEditRegistration.Create);
280309

0 commit comments

Comments
 (0)