diff options
author | Erich Eckner <git@eckner.net> | 2017-03-25 16:24:00 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-03-25 16:24:00 +0100 |
commit | 1c76b3b38f6f3eaf15ceface8a99d64c3085f081 (patch) | |
tree | 36f0fda3d570d2419a402794f1591cc31e1038e7 /picturelistunit.pas | |
parent | 8c2e9fadc8ec9e9db98d219b6de966a39fd26b7d (diff) | |
download | units-1c76b3b38f6f3eaf15ceface8a99d64c3085f081.tar.xz |
picturelistunit neu
Diffstat (limited to 'picturelistunit.pas')
-rw-r--r-- | picturelistunit.pas | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/picturelistunit.pas b/picturelistunit.pas new file mode 100644 index 0000000..a9dd881 --- /dev/null +++ b/picturelistunit.pas @@ -0,0 +1,68 @@ +unit picturelistunit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, ExtCtrls, Graphics; + +type + tMyPictureList = class + private + content: tList; + public + constructor create; + destructor destroy; + procedure addFromFile(s: string); + procedure saveLastToFile(s: string); + end; + +implementation + +constructor tMyPictureList.create; +begin + inherited create; + content:=tList.create; +end; + +destructor tMyPictureList.destroy; +begin + content.clear; + content.free; + inherited destroy; +end; + +procedure tMyPictureList.addFromFile(s: string); +begin + content.add(tPicture.create); + last.loadFromFile(s); +end; + +function tMyPictureList.last: tPicture; +begin + result:=items[count-1]; +end; + +procedure tMyPictureList.delete(idx: int64); +begin + items[idx].free; + inherited delete(idx); +end; + +procedure tMyPictureList.add; +begin + inherited add(tPicture.create); +end; + +procedure tMyPictureList.clear; +var + i: longint; +begin + for i:=0 to count-1 do + items[i].free; + inherited clear; +end; + +end. + |