unit Fr_LocalMailListView;
interface
uses
SysUtils, Classes, Controls, ComCtrls, Graphics, Windows, Fr_LocalMail;
type
TFr_LocalMailListView =
class(TListView)
private
{ Private-Deklarationen }
...
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
published
{ Published-Deklarationen }
...
end;
procedure Register;
implementation
{$R res/ImageList.res}
procedure Register;
begin
RegisterComponents('
FriFra', [TFr_LocalMailListView]);
end;
constructor TFr_LocalMailListView.Create(AOwner: TComponent);
var
RS: TResourceStream;
bmp: Graphics.TBitmap;
n: integer;
begin
inherited;
RS :=
nil;
LocalMail := TFr_LocalMail.Create(
nil);
SmallIcons := TImageList.CreateSize(16, 16);
LargeIcons := TImageList.CreateSize(32, 32);
bmp := Graphics.TBitmap.Create;
try
for n := 0
to 6
do
begin
try
RS := TResourceStream.Create(0, '
Large' + IntToStr(n), RT_RCDATA);
RS.Position := 0;
bmp.LoadFromStream(RS);
LargeIcons.AddMasked(bmp, clFuchsia);
finally
RS.Free;
end;
try
RS := TResourceStream.Create(0, '
Small' + IntToStr(n), RT_RCDATA);
RS.Position := 0;
bmp.LoadFromStream(RS);
SmallIcons.AddMasked(bmp, clFuchsia);
finally
RS.Free;
end;
end;
finally
bmp.Free;
end;
LargeImages:=LargeIcons;
SmallImages:=LargeIcons;
SetDefaults;
end;
destructor TFr_LocalMailListView.Destroy;
begin
LocalMail.Free;
SmallIcons.Free;
LargeIcons.Free;
inherited;
end;
...
end.