There's always another solution :)
One easy way would be to inherit TBitmap and add a property to it,
something similar to Tag or an Index...
So in your imagelist you have 4 images (one for each line) or 11?
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Friday, July 15, 2005 10:15 AM
To: [email protected]
Subject: RE: [delphi-en] How to identified the SENDER
Hi,
It works, but not in my program. I hav only 4 Bitmap picture, goalkeeper use
Bitmap1, defender use Bitmap2, midfielder use Bitmap3, and striker use
Bitmap4 with the assumption that the team playin 4-4-2 formation.
Your suggestion can only works for keeper, but not for midfielder, striker
and defenders (which is share the same Bitmap picture) .
I know it can easily solved by getting 11 different types of Bitmap picture.
But for certain reason, only 4 types will be used base on their position at
the moment . Any idea?
Thanks again.
Vahan Yoghoudjian <[EMAIL PROTECTED]> wrote:
Then I would suggest you to use the Sender.
My aim was at first to directly refer to the necessary item in the list
using indexes without having to scan the List, but now on your mouse click
event you can hold the sender and scan the list from its first item to the
last and for every item check if the sender is equal to the TBitmap in your
TPlayer record....
Hope this helps
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Friday, July 15, 2005 9:28 AM
To: [email protected]
Subject: RE: [delphi-en] How to identified the SENDER
The reason I'm using TBitmap is because i have already set all my player's
picture in a TImageList. And i can easily get the player picture base on
their number. For example:
ImageList1.Get(0, FPlayer1Pic). TImage can't do this. So is there any way
for me to do so ?
Oh by the way, no more Figo next season. Raul, Owen in doubt.. and there's
only one Fernando Torress :) :), which is not for sale :0
Vahan Yoghoudjian <[EMAIL PROTECTED]> wrote:
Why don't you use TImage?
If you want to have something fancy, you can even draw the jersey
numbers on the canvas of the TImage... that's of course something extra...
I see we are rivals here in terms of football... Real Madrid fan :)
Good luck (both in your project and next season) ;)
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Friday, July 15, 2005 9:01 AM
To: [email protected]
Subject: RE: [delphi-en] How to identified the SENDER
Hi,
I'm using TBitmap component, instead of Picture . And there's no TBitmap.TAG
property for me to set. Any idea ?
By the way, Manchester United & Athetlic Madrid are the club i support
Vahan Yoghoudjian <[EMAIL PROTECTED]> wrote:
There might be many ways to refer to a player but I think the easiest
way will be to use the TAG property of the Picture. Once right clicked on
it, you will use TImage(Sender).Tag to use as the index in your list.
For example the goalkeeper will have index of 1. you might want to add
in your codes
aPlayer.Picture.Tag := 1 (I do not suggest you use the jersey number for the
tag because you might have random numbers for jerseys)
N.B.- Which team do you support? :)
Hope it helps
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Friday, July 15, 2005 8:05 AM
To: [email protected]
Subject: [delphi-en] How to identified the SENDER
Hi,
var FDoorList: TList;
begin
FDoorList:= TList.Create;
for i := 1 to 11 do
begin
aPlayer := TPlayer.Create
aPlayer.Picture.Bitmap:= myPlayerBitMap; // player picture
aPlayer.PopupMenu:= PlayerPopupMenu;
aPlayer.Top:= myvalue; // myvalue is assigned base on the position
aPlayer.Left:= myvalue2; // myvalue2 is assigned base on the position
aPlayer.JerseyNumb := i // player jersey numb
FPlayer.Add(aPlayer)
end;
The statement above use to create the player list, then position them on the
form base on the position they play (example: defender player has different
position as the attacker player).
Now when the users right click at any player, the system will pop up the
PlayerPopupMenu (P/S: PlayerPopupMenu has the 'GET JERSEY NUMBER' Item) .
When the user click at the Get Jersey Number item, i want the system to show
that particular player's jersey number. How am i going to do so ?? I mean
how the PlayerPopupMenu identified which player i'm currently click at, cos
all players are actually link to the same PopupMenu. Thanks in advance.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Start your day with Yahoo! - make it your home page
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Start your day with Yahoo! - make it your home page
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/