Skip to content

Commit a1ae2f4

Browse files
committed
Partial backport from the Embarcadero fork.
1 parent fa65e38 commit a1ae2f4

33 files changed

Lines changed: 4123 additions & 575 deletions

Packages/Delphi/Delphi 10.4+/Python.dpk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package Python;
2+
23
{$R *.res}
34
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
45
{$ALIGN 8}
@@ -48,6 +49,7 @@ contains
4849
WrapDelphiWindows in '..\..\..\Source\WrapDelphiWindows.pas',
4950
WrapFireDAC in '..\..\..\Source\WrapFireDAC.pas',
5051
WrapActions in '..\..\..\Source\WrapActions.pas',
51-
WrapDelphiDataBind in '..\..\..\Source\WrapDelphiDataBind.pas';
52+
WrapDelphiDataBind in '..\..\..\Source\WrapDelphiDataBind.pas',
53+
WrapDelphiImageList in '..\..\..\Source\WrapDelphiImageList.pas';
5254

5355
end.

Packages/Delphi/Delphi 10.4+/Python.dproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
<DCCReference Include="..\..\..\Source\WrapFireDAC.pas"/>
178178
<DCCReference Include="..\..\..\Source\WrapActions.pas"/>
179179
<DCCReference Include="..\..\..\Source\WrapDelphiDataBind.pas"/>
180+
<DCCReference Include="..\..\..\Source\WrapDelphiImageList.pas"/>
180181
<BuildConfiguration Include="Base">
181182
<Key>Base</Key>
182183
</BuildConfiguration>

Packages/Delphi/Delphi 10.4+/PythonFmx.dpk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ contains
5959
WrapFmxStdCtrls in '..\..\..\Source\fmx\WrapFmxStdCtrls.pas',
6060
WrapFmxStyles in '..\..\..\Source\fmx\WrapFmxStyles.pas',
6161
WrapFmxTypes in '..\..\..\Source\fmx\WrapFmxTypes.pas',
62-
WrapFmxDateTime in '..\..\..\Source\fmx\WrapFmxDateTime.pas';
62+
WrapFmxDateTime in '..\..\..\Source\fmx\WrapFmxDateTime.pas',
63+
WrapFmxImgList in '..\..\..\Source\fmx\WrapFmxImgList.pas';
6364

6465
end.

Packages/Delphi/Delphi 10.4+/PythonVcl.dpk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ contains
5555
WrapVclStdCtrls in '..\..\..\Source\vcl\WrapVclStdCtrls.pas',
5656
WrapVclWinXCtrls in '..\..\..\Source\vcl\WrapVclWinXCtrls.pas',
5757
WrapVclThemes in '..\..\..\Source\vcl\WrapVclThemes.pas',
58-
WrapVclMedia in '..\..\..\Source\vcl\WrapVclMedia.pas';
58+
WrapVclMedia in '..\..\..\Source\vcl\WrapVclMedia.pas',
59+
WrapVclImgList in '..\..\..\Source\vcl\WrapVclImgList.pas';
5960

6061
end.

Packages/Delphi/Delphi 10.4+/PythonVcl.dproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
<DCCReference Include="..\..\..\Source\vcl\WrapVclWinXCtrls.pas"/>
119119
<DCCReference Include="..\..\..\Source\vcl\WrapVclThemes.pas"/>
120120
<DCCReference Include="..\..\..\Source\vcl\WrapVclMedia.pas"/>
121+
<DCCReference Include="..\..\..\Source\vcl\WrapVclImgList.pas"/>
121122
<BuildConfiguration Include="Base">
122123
<Key>Base</Key>
123124
</BuildConfiguration>

Source/WrapDelphi.pas

Lines changed: 182 additions & 33 deletions
Large diffs are not rendered by default.

Source/WrapDelphiImageList.pas

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
(**************************************************************************)
2+
(* This unit is part of the Python for Delphi (P4D) library *)
3+
(* Project home: https://github.com/pyscripter/python4delphi *)
4+
(* *)
5+
(* Project Maintainer: PyScripter (pyscripter@gmail.com) *)
6+
(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *)
7+
(* Morgan Martinet (https://github.com/mmm-experts) *)
8+
(* Core developer: Lucas Belo (lucas.belo@live.com) *)
9+
(* Contributors: See contributors.md at project home *)
10+
(* *)
11+
(* LICENCE and Copyright: MIT (see project home) *)
12+
(**************************************************************************)
13+
{$I Definition.Inc}
14+
15+
unit WrapDelphiImageList;
16+
17+
interface
18+
19+
uses
20+
System.Classes, System.SysUtils, System.ImageList,
21+
PythonEngine, WrapDelphi, WrapDelphiClasses;
22+
23+
type
24+
TPyDelphiBaseImageList = class (TPyDelphiComponent)
25+
private
26+
function GetDelphiObject: TBaseImageList;
27+
procedure SetDelphiObject(const Value: TBaseImageList);
28+
public
29+
class function DelphiObjectClass : TClass; override;
30+
// Properties
31+
property DelphiObject: TBaseImageList read GetDelphiObject write SetDelphiObject;
32+
end;
33+
34+
implementation
35+
36+
{ Register the wrappers, the globals and the constants }
37+
type
38+
TImageListRegistration = class(TRegisteredUnit)
39+
public
40+
function Name : string; override;
41+
procedure RegisterWrappers(APyDelphiWrapper : TPyDelphiWrapper); override;
42+
end;
43+
44+
{ TImageListRegistration }
45+
46+
function TImageListRegistration.Name: string;
47+
begin
48+
Result := 'ImageList';
49+
end;
50+
51+
procedure TImageListRegistration.RegisterWrappers(
52+
APyDelphiWrapper: TPyDelphiWrapper);
53+
begin
54+
inherited;
55+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiBaseImageList);
56+
end;
57+
58+
{ TPyDelphiBaseImageList }
59+
60+
class function TPyDelphiBaseImageList.DelphiObjectClass: TClass;
61+
begin
62+
Result := TBaseImageList;
63+
end;
64+
65+
function TPyDelphiBaseImageList.GetDelphiObject: TBaseImageList;
66+
begin
67+
Result := TBaseImageList(inherited DelphiObject);
68+
end;
69+
70+
procedure TPyDelphiBaseImageList.SetDelphiObject(const Value: TBaseImageList);
71+
begin
72+
inherited DelphiObject := Value;
73+
end;
74+
75+
initialization
76+
RegisteredUnits.Add(TImageListRegistration.Create());
77+
78+
end.

Source/fmx/WrapDelphiFmx.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ implementation
2828
WrapFmxDataBind,
2929
{$ENDIF LINUX}
3030
WrapFmxTypes,
31+
WrapFmxImgList,
3132
WrapFmxControls,
3233
WrapFmxStdCtrls,
3334
WrapFmxEdit,

Source/fmx/WrapFmxActnList.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
(**************************************************************************)
1313

1414
{$I ..\Definition.Inc}
15+
1516
unit WrapFmxActnList;
1617

1718
interface

Source/fmx/WrapFmxColors.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
(* LICENCE and Copyright: MIT (see project home) *)
1212
(**************************************************************************)
1313

14+
{$I ..\Definition.Inc}
15+
1416
unit WrapFmxColors;
1517

1618
interface

0 commit comments

Comments
 (0)