summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-03-25 16:24:00 +0100
committerErich Eckner <git@eckner.net>2017-03-25 16:24:00 +0100
commit1c76b3b38f6f3eaf15ceface8a99d64c3085f081 (patch)
tree36f0fda3d570d2419a402794f1591cc31e1038e7
parent8c2e9fadc8ec9e9db98d219b6de966a39fd26b7d (diff)
downloadunits-1c76b3b38f6f3eaf15ceface8a99d64c3085f081.tar.xz
picturelistunit neu
-rw-r--r--picturelistunit.pas68
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.
+