Skip to content
3 changes: 2 additions & 1 deletion Packages/Delphi/Delphi 10.4+/PythonFmx.dpk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ contains
WrapFmxMemo in '..\..\..\Source\fmx\WrapFmxMemo.pas',
WrapFmxColors in '..\..\..\Source\fmx\WrapFmxColors.pas',
WrapFmxListView in '..\..\..\Source\fmx\WrapFmxListView.pas',
WrapFmxDataBind in '..\..\..\Source\fmx\WrapFmxDataBind.pas';
WrapFmxDataBind in '..\..\..\Source\fmx\WrapFmxDataBind.pas',
WrapFmxStdActns in '..\..\..\Source\fmx\WrapFmxStdActns.pas';

end.
3 changes: 2 additions & 1 deletion Packages/Delphi/Delphi 10.4+/PythonVcl.dpk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ contains
WrapVclSamplesSpin in '..\..\..\Source\vcl\WrapVclSamplesSpin.pas',
WrapVclStdCtrls in '..\..\..\Source\vcl\WrapVclStdCtrls.pas',
WrapVclWinXCtrls in '..\..\..\Source\vcl\WrapVclWinXCtrls.pas',
WrapVclThemes in '..\..\..\Source\vcl\WrapVclThemes.pas';
WrapVclThemes in '..\..\..\Source\vcl\WrapVclThemes.pas',
WrapVclMedia in '..\..\..\Source\vcl\WrapVclMedia.pas';

end.
1 change: 1 addition & 0 deletions Source/fmx/WrapDelphiFmx.pas
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ implementation
WrapFmxListBox,
WrapFmxListView,
WrapFmxActnList,
WrapFmxStdActns,
WrapFmxComCtrls,
WrapFmxDialogs,
WrapFmxForms,
Expand Down
28 changes: 28 additions & 0 deletions Source/fmx/WrapFmxActnList.pas
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ TPyDelphiAction = class(TPyDelphiContainedAction)
property DelphiObject: TAction read GetDelphiObject write SetDelphiObject;
end;

TPyDelphiCustomViewAction = class(TPyDelphiCustomAction)
private
function GetDelphiObject: TCustomViewAction;
procedure SetDelphiObject(const Value: TCustomViewAction);
public
class function DelphiObjectClass: TClass; override;
property DelphiObject: TCustomViewAction read GetDelphiObject write SetDelphiObject;
end;

implementation

{ Register the wrappers, the globals and the constants }
Expand Down Expand Up @@ -79,6 +88,7 @@ procedure TActnListRegistration.RegisterWrappers(APyDelphiWrapper
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiActionList);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomAction);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiAction);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomViewAction);
end;

{ TPyDelphiCustomActionList }
Expand Down Expand Up @@ -149,6 +159,24 @@ procedure TPyDelphiAction.SetDelphiObject(const Value: TAction);
inherited DelphiObject := Value;
end;

{ TPyDelphiCustomViewAction }

class function TPyDelphiCustomViewAction.DelphiObjectClass: TClass;
begin
Result := TCustomViewAction;
end;

function TPyDelphiCustomViewAction.GetDelphiObject: TCustomViewAction;
begin
Result := TCustomViewAction(inherited DelphiObject);
end;

procedure TPyDelphiCustomViewAction.SetDelphiObject(
const Value: TCustomViewAction);
begin
inherited DelphiObject := Value;
end;

initialization
RegisteredUnits.Add(TActnListRegistration.Create());

Expand Down
81 changes: 55 additions & 26 deletions Source/fmx/WrapFmxControls.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ interface

uses
Classes, SysUtils, TypInfo, Types,
FMX.Types, FMX.Controls,
PythonEngine, WrapDelphi, WrapDelphiClasses, WrapFmxTypes,
FMX.Controls.Presentation;
FMX.Types, FMX.Controls, FMX.Controls.Presentation,
PythonEngine, WrapDelphi, WrapDelphiClasses, WrapFmxTypes, WrapFmxActnList;

type
{
Expand Down Expand Up @@ -136,6 +135,17 @@ TPyDelphiPresentedControl = class(TPyDelphiStyledControl)
property DelphiObject: TPresentedControl read GetDelphiObject write SetDelphiObject;
end;

TPyDelphiCustomControlAction = class(TPyDelphiCustomAction)
private
function GetDelphiObject: TCustomControlAction;
procedure SetDelphiObject(const Value: TCustomControlAction);
public
class function DelphiObjectClass: TClass; override;
public
property DelphiObject: TCustomControlAction read GetDelphiObject
write SetDelphiObject;
end;

implementation

type
Expand All @@ -147,6 +157,30 @@ TControlsRegistration = class(TRegisteredUnit)
procedure DefineVars(APyDelphiWrapper : TPyDelphiWrapper); override;
end;

{ TControlsRegistration }

procedure TControlsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
end;

function TControlsRegistration.Name: string;
begin
Result := 'Controls';
end;

procedure TControlsRegistration.RegisterWrappers(
APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiControl);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyledControl);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTextControl);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyleBook);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiPopup);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomControlAction);
end;

{ TPyDelphiControl }

function TPyDelphiControl.BringToFront_Wrapper(args: PPyObject): PPyObject;
Expand Down Expand Up @@ -425,29 +459,6 @@ function TPyDelphiControl.Set_Visible(AValue: PPyObject;
Result := -1;
end;

{ TControlsRegistration }

procedure TControlsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
end;

function TControlsRegistration.Name: string;
begin
Result := 'Controls';
end;

procedure TControlsRegistration.RegisterWrappers(
APyDelphiWrapper: TPyDelphiWrapper);
begin
inherited;
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiControl);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyledControl);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTextControl);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyleBook);
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiPopup);
end;

{ TControlsAccess }

class function TControlsAccess.ExpectedContainerClass: TClass;
Expand Down Expand Up @@ -740,6 +751,24 @@ procedure TPyDelphiPresentedControl.SetDelphiObject(
inherited DelphiObject := Value;
end;

{ TPyDelphiCustomControlAction }

class function TPyDelphiCustomControlAction.DelphiObjectClass: TClass;
begin
Result := TCustomControlAction;
end;

function TPyDelphiCustomControlAction.GetDelphiObject: TCustomControlAction;
begin
Result := TCustomControlAction(inherited DelphiObject);
end;

procedure TPyDelphiCustomControlAction.SetDelphiObject(
const Value: TCustomControlAction);
begin
inherited DelphiObject := Value;
end;

initialization
RegisteredUnits.Add(TControlsRegistration.Create);

Expand Down
Loading