Bin gerade dabei mir eine Combi aus TTimer und TImage zu basteln, beim Testen des Objektes TRunImage erhalte ich einen Fehler der geliebten Access Vioation
die Section schaut wie folgt aus.
Code: Alles auswählen
unit RunImage;
{$mode objfpc}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls;
type
TRunImage = class(TTimer)
private
{ Private declarations }
Pic: TImage;
FLines: TStrings;
protected
{ Protected declarations }
procedure SetLines(const Value: TStrings);
public
{ Public declarations }
published
{ Published declarations }
constructor Create(AOwner: TComponent);
property Enabled;
property Interval;
property OnTimer;
property OnStartTimer;
property OnStopTimer;
property Lines: TStrings read FLines write SetLines;
end;
procedure Register;
implementation
constructor TRunImage.Create(AOwner: TComponent);
begin
inherited;
Pic.Width := 65;
Pic.Height := 65;
fLines := TStrings.Create;
fLines.Add('Lines');
Interval := 100;
Enabled := False;
end;
procedure TRunImage.SetLines(const Value: TStrings);
var Count: Integer;
begin
if (Value <> nil) then
for Count:= 0 to Value.Count do
fLines.Add(Value[Count-1]);
end;
procedure Register;
begin
RegisterComponents('Additional',[TRunImage]);
end;
end.
Code: Alles auswählen
procedure TRunImage.SetLines(const Value: TStrings);
begin
if (Value <> nil) then
FLines.Assign(Value);
end;
FIndet Ihr das für zuviel aufwand oder was wäre eure Meinung dazu?