Skip to content

Commit 15012d4

Browse files
authored
Merge pull request Embarcadero#26 from Embarcadero/wrappers
Including the Media Player wrappers for both VCL and FMX
2 parents e23487c + 27503c0 commit 15012d4

10 files changed

+1069
-31
lines changed

Packages/Delphi/Delphi 10.4+/PythonFmx.dpk

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ contains
5858
WrapFmxMemo in '..\..\..\Source\fmx\WrapFmxMemo.pas',
5959
WrapFmxColors in '..\..\..\Source\fmx\WrapFmxColors.pas',
6060
WrapFmxListView in '..\..\..\Source\fmx\WrapFmxListView.pas',
61-
WrapFmxDataBind in '..\..\..\Source\fmx\WrapFmxDataBind.pas';
61+
WrapFmxDataBind in '..\..\..\Source\fmx\WrapFmxDataBind.pas',
62+
WrapFmxStdActns in '..\..\..\Source\fmx\WrapFmxStdActns.pas';
6263

6364
end.

Packages/Delphi/Delphi 10.4+/PythonVcl.dpk

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ contains
5454
WrapVclSamplesSpin in '..\..\..\Source\vcl\WrapVclSamplesSpin.pas',
5555
WrapVclStdCtrls in '..\..\..\Source\vcl\WrapVclStdCtrls.pas',
5656
WrapVclWinXCtrls in '..\..\..\Source\vcl\WrapVclWinXCtrls.pas',
57-
WrapVclThemes in '..\..\..\Source\vcl\WrapVclThemes.pas';
57+
WrapVclThemes in '..\..\..\Source\vcl\WrapVclThemes.pas',
58+
WrapVclMedia in '..\..\..\Source\vcl\WrapVclMedia.pas';
5859

5960
end.

Source/fmx/WrapDelphiFmx.pas

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ implementation
1717
WrapFmxListBox,
1818
WrapFmxListView,
1919
WrapFmxActnList,
20+
WrapFmxStdActns,
2021
WrapFmxComCtrls,
2122
WrapFmxDialogs,
2223
WrapFmxForms,

Source/fmx/WrapFmxActnList.pas

+28
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ TPyDelphiAction = class(TPyDelphiContainedAction)
4949
property DelphiObject: TAction read GetDelphiObject write SetDelphiObject;
5050
end;
5151

52+
TPyDelphiCustomViewAction = class(TPyDelphiCustomAction)
53+
private
54+
function GetDelphiObject: TCustomViewAction;
55+
procedure SetDelphiObject(const Value: TCustomViewAction);
56+
public
57+
class function DelphiObjectClass: TClass; override;
58+
property DelphiObject: TCustomViewAction read GetDelphiObject write SetDelphiObject;
59+
end;
60+
5261
implementation
5362

5463
{ Register the wrappers, the globals and the constants }
@@ -79,6 +88,7 @@ procedure TActnListRegistration.RegisterWrappers(APyDelphiWrapper
7988
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiActionList);
8089
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomAction);
8190
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiAction);
91+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomViewAction);
8292
end;
8393

8494
{ TPyDelphiCustomActionList }
@@ -149,6 +159,24 @@ procedure TPyDelphiAction.SetDelphiObject(const Value: TAction);
149159
inherited DelphiObject := Value;
150160
end;
151161

162+
{ TPyDelphiCustomViewAction }
163+
164+
class function TPyDelphiCustomViewAction.DelphiObjectClass: TClass;
165+
begin
166+
Result := TCustomViewAction;
167+
end;
168+
169+
function TPyDelphiCustomViewAction.GetDelphiObject: TCustomViewAction;
170+
begin
171+
Result := TCustomViewAction(inherited DelphiObject);
172+
end;
173+
174+
procedure TPyDelphiCustomViewAction.SetDelphiObject(
175+
const Value: TCustomViewAction);
176+
begin
177+
inherited DelphiObject := Value;
178+
end;
179+
152180
initialization
153181
RegisteredUnits.Add(TActnListRegistration.Create());
154182

Source/fmx/WrapFmxControls.pas

+55-26
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ interface
66

77
uses
88
Classes, SysUtils, TypInfo, Types,
9-
FMX.Types, FMX.Controls,
10-
PythonEngine, WrapDelphi, WrapDelphiClasses, WrapFmxTypes,
11-
FMX.Controls.Presentation;
9+
FMX.Types, FMX.Controls, FMX.Controls.Presentation,
10+
PythonEngine, WrapDelphi, WrapDelphiClasses, WrapFmxTypes, WrapFmxActnList;
1211

1312
type
1413
{
@@ -136,6 +135,17 @@ TPyDelphiPresentedControl = class(TPyDelphiStyledControl)
136135
property DelphiObject: TPresentedControl read GetDelphiObject write SetDelphiObject;
137136
end;
138137

138+
TPyDelphiCustomControlAction = class(TPyDelphiCustomAction)
139+
private
140+
function GetDelphiObject: TCustomControlAction;
141+
procedure SetDelphiObject(const Value: TCustomControlAction);
142+
public
143+
class function DelphiObjectClass: TClass; override;
144+
public
145+
property DelphiObject: TCustomControlAction read GetDelphiObject
146+
write SetDelphiObject;
147+
end;
148+
139149
implementation
140150

141151
type
@@ -147,6 +157,30 @@ TControlsRegistration = class(TRegisteredUnit)
147157
procedure DefineVars(APyDelphiWrapper : TPyDelphiWrapper); override;
148158
end;
149159

160+
{ TControlsRegistration }
161+
162+
procedure TControlsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
163+
begin
164+
inherited;
165+
end;
166+
167+
function TControlsRegistration.Name: string;
168+
begin
169+
Result := 'Controls';
170+
end;
171+
172+
procedure TControlsRegistration.RegisterWrappers(
173+
APyDelphiWrapper: TPyDelphiWrapper);
174+
begin
175+
inherited;
176+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiControl);
177+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyledControl);
178+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTextControl);
179+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyleBook);
180+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiPopup);
181+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomControlAction);
182+
end;
183+
150184
{ TPyDelphiControl }
151185

152186
function TPyDelphiControl.BringToFront_Wrapper(args: PPyObject): PPyObject;
@@ -425,29 +459,6 @@ function TPyDelphiControl.Set_Visible(AValue: PPyObject;
425459
Result := -1;
426460
end;
427461

428-
{ TControlsRegistration }
429-
430-
procedure TControlsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
431-
begin
432-
inherited;
433-
end;
434-
435-
function TControlsRegistration.Name: string;
436-
begin
437-
Result := 'Controls';
438-
end;
439-
440-
procedure TControlsRegistration.RegisterWrappers(
441-
APyDelphiWrapper: TPyDelphiWrapper);
442-
begin
443-
inherited;
444-
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiControl);
445-
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyledControl);
446-
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTextControl);
447-
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiStyleBook);
448-
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiPopup);
449-
end;
450-
451462
{ TControlsAccess }
452463

453464
class function TControlsAccess.ExpectedContainerClass: TClass;
@@ -740,6 +751,24 @@ procedure TPyDelphiPresentedControl.SetDelphiObject(
740751
inherited DelphiObject := Value;
741752
end;
742753

754+
{ TPyDelphiCustomControlAction }
755+
756+
class function TPyDelphiCustomControlAction.DelphiObjectClass: TClass;
757+
begin
758+
Result := TCustomControlAction;
759+
end;
760+
761+
function TPyDelphiCustomControlAction.GetDelphiObject: TCustomControlAction;
762+
begin
763+
Result := TCustomControlAction(inherited DelphiObject);
764+
end;
765+
766+
procedure TPyDelphiCustomControlAction.SetDelphiObject(
767+
const Value: TCustomControlAction);
768+
begin
769+
inherited DelphiObject := Value;
770+
end;
771+
743772
initialization
744773
RegisteredUnits.Add(TControlsRegistration.Create);
745774

0 commit comments

Comments
 (0)