Skip to content

Wrapped TNumberBox Component #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion Source/fmx/WrapFmxEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
interface

uses
FMX.Edit, FMX.SearchBox, FMX.ComboEdit, FMX.EditBox, FMX.SpinBox,
FMX.Edit, FMX.SearchBox, FMX.ComboEdit, FMX.EditBox, FMX.SpinBox, FMX.NumberBox,
PythonEngine, WrapFmxTypes, WrapFmxControls;


Expand Down Expand Up @@ -98,6 +98,17 @@ TPyDelphiSpinBox = class(TPyDelphiCustomEditBox)
write SetDelphiObject;
end;

TPyDelphiNumberBox = class(TPyDelphiCustomEditBox)
private
function GetDelphiObject: TNumberBox;
procedure SetDelphiObject(const Value: TNumberBox);
public
class function DelphiObjectClass: TClass; override;
// Properties
property DelphiObject: TNumberBox read GetDelphiObject
write SetDelphiObject;
end;

implementation

uses
Expand Down Expand Up @@ -136,6 +147,7 @@ procedure TEditRegistration.RegisterWrappers(
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiComboEdit);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomEditBox);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiSpinBox);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiNumberBox);
end;

{ TPyDelphiCustomEdit }
Expand Down Expand Up @@ -275,6 +287,23 @@ procedure TPyDelphiSpinBox.SetDelphiObject(const Value: TSpinBox);
inherited DelphiObject := Value;
end;

{ TPyDelphiNumberBox }

class function TPyDelphiNumberBox.DelphiObjectClass: TClass;
begin
Result := TNumberBox;
end;

function TPyDelphiNumberBox.GetDelphiObject: TNumberBox;
begin
Result := TNumberBox(inherited DelphiObject);
end;

procedure TPyDelphiNumberBox.SetDelphiObject(const Value: TNumberBox);
begin
inherited DelphiObject := Value;
end;

initialization
RegisteredUnits.Add(TEditRegistration.Create);

Expand Down