
May 11th, 2012, 01:36 PM
|
|
Contributing User
|
|
Join Date: Jun 2008
Posts: 257
 
Time spent in forums: 3 Days 9 m 16 sec
Reputation Power: 6
|
|
Quote: | Originally Posted by dlumley Hi, I'm busy learning Delphi and using the ImageEn component...
I've noticed in the source code in their examples the call to a function like this:
TMainForm.ImageEnMView1ImageAtPos
Where: ImageEnMview is the object with ImageAtPos being a function...
My question is why is there no period separating the function and the object? I would have thought this to be needed?
i.e. TMainForm.ImageEnMView1.ImageAtPos (which throws an error) this is probably fundamental but your answer will help me to further my Delphi :-)
Thank you in advance.
Greg.  |
I don't use ImageEn, so my answer will not be specific to that component, but in context here, the "Object" is the form which is referred to by TMainForm and the Method is ImageEnMView1ImageAtPos
If you look within the type declaration at the top of your source code, you should see something like this:
Code:
TMainForm = class(TForm)
...
Imageen1: TImageeN;
procedure ImageEnMView1ImageAtPos(<params if any>);
private
...
public
end;
then the procedure body would be defined in the implementation section
Code:
procedure TMainForm.ImageEnMView1ImageAtPos(...
If you add a BitBtn to your form, and add a OnClick handler, the method added to your form class would be:
procedure BitBtn1Click(Sender: TObject);
and in the implementation would be
procedure TMainForm.BitBtn1Click(Sender:TObject);
|