Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread TCell revisited
Fri, Jun 28 2013 6:01 AMPermanent Link

Ronald

Hi,

I tried to include a TTimer in my basic component.
If I create an instance of my component, I get the following error:
(translated form Dutch)


Application error:
Cannot get the property ttimer_setenabled of a not defined or empty value

What is my mistake here?


type
TCell = class(TPanel)
  private
  aTimer   :TTimer;
  public
  constructor Create(AOwner: TComponent); override;
  destructor Destroy; override;

  end;

implementation

constructor TCell.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
aTimer.Enabled:=false;
end;


destructor TCell.Destroy;
begin
inherited Destroy;
end;


Fri, Jun 28 2013 8:01 AMPermanent Link

Matthew Jones

Same as with Delphi - you have to create the timer in your constructor.

/Matthew Jones/
Fri, Jun 28 2013 9:14 AMPermanent Link

Ronald

I know, but I can not create an instance of TTimer (aTimer:=TTimer.CreateWink
This does not exist for TTimer.

"Matthew Jones"  schreef in bericht
news:memo.20130628130144.9656C@nothanks.nothanks.co.uk...

Same as with Delphi - you have to create the timer in your constructor.

/Matthew Jones/
Fri, Jun 28 2013 9:32 AMPermanent Link

Matthew Jones

> I know, but I can not create an instance of TTimer
> (aTimer:=TTimer.CreateWink
> This does not exist for TTimer.

The framework source shows that TAnimator.Create does exactly that:
FTimer:=TTimer.Create(nil);

Indeed the webcore.wbs code shows that there is a Create for TTimer, so I don't
know what your problem is.

/Matthew Jones/
Fri, Jun 28 2013 9:41 AMPermanent Link

Ronald

Oh, stupid me! I walked in that trap a few times before.

Your answer reminded me of the fact that indeed TTimer.Create does not
exist, but TTimer.Create(nil) does exist! This got me on the wrong foot
before. Instead of giving a syntaxerror EWB tells me the method does not
exist.

Thanks!



"Matthew Jones"  schreef in bericht
news:memo.20130628143217.9656I@nothanks.nothanks.co.uk...

> I know, but I can not create an instance of TTimer
> (aTimer:=TTimer.CreateWink
> This does not exist for TTimer.

The framework source shows that TAnimator.Create does exactly that:
FTimer:=TTimer.Create(nil);

Indeed the webcore.wbs code shows that there is a Create for TTimer, so I
don't
know what your problem is.

/Matthew Jones/
Image