<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<br>
<blockquote
cite="mid:AANLkTi=U3h-Cw2Jfm=5zpCkUDm4h-v7Ya7o5+sbGiMEy@mail.gmail.com"
type="cite"><br>
<div class="gmail_quote">On Tue, Nov 23, 2010 at 11:32 PM, Andrew
Brunner <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:andrew.t.brunner@gmail.com">andrew.t.brunner@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div class="gmail_quote">
<div class="im">On Tue, Nov 23, 2010 at 1:59 PM, Max Vlasov
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:max.vlasov@gmail.com" target="_blank">max.vlasov@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Andrew,<br>
<div class="gmail_quote">
<div>Creating TList as a field for storing extra
structures and objects and supporting extra data
reference using Tag as an index never was a problem
for me. Can you tell a single reason not to
implement this approach by yourself? Moreover
managing the destruction of objects in this case is
much easier and straightforward. <br>
Other consideration, if something starts to depend
on future decisions of other developers, isn't it
easy to create a simple (very simple) workaround :)<br>
<br>
Max Vlasov<br>
</div>
</div>
<br>
<br>
</blockquote>
</div>
<div><br>
In the specific problem I have, it is corellating
TMenuItem with a particular data pointer object of TForm.
Forms can close out of order and re-Index the List I have
(as you stated). But there is no clean way for me to
reference what was clicked on Sender... Tag or Data is
the only clean solution here. Out of order, happening on
application thread... Oh, and TMenuItems being created at
runtime. This is about productivity. What must I create
an additional list when I have Tag or Data. <br>
</div>
</div>
<br>
<br>
</blockquote>
<div><br>
</div>
</div>
</blockquote>
If you create the menuItem at runtime, you can always use a
sub-class, create your own class TMyMenuItem, with a property and
field to store the data..<br>
<br>
That is what OO is for....<br>
</body>
</html>