|
| 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. |
0 commit comments