PopupMenu (subclass?) and inspector

I would like to have a PopupMenu that takes IDs and values and would return the ID instead of the list index. I think I would have to create a subclass that would keep an array of IDs and return the ID for the selected item (instead of index) via a new method. Is this the best way or am I missing something obvious here?

If this is the only way, then I would also like to be able to declare some properties and have those properties show up in the inspector when the subclass is used in a window. Is this possible?

Thanks

[quote=46532:@John Young]I would like to have a PopupMenu that takes IDs and values and would return the ID instead of the list index. I think I would have to create a subclass that would keep an array of IDs and return the ID for the selected item (instead of index) via a new method. Is this the best way or am I missing something obvious here?
[/quote]
You can use RowTag to store the IDs.

[quote]If this is the only way, then I would also like to be able to declare some properties and have those properties show up in the inspector when the subclass is used in a window. Is this possible?
[/quote]
You can set it in the Inspector Behavior of the subclass. Check the properties you want to show in the inspector.

Thanks, they were both what I was looking for.

It seems odd though that Rowtag is a method that can be on the left side of assignment.

[quote=46651:@John Young]Thanks, they were both what I was looking for.

It seems odd though that Rowtag is a method that can be on the left side of assignment.[/quote]
Basically there are 2 versions of Rowtag
One that can be assigned to & one that returns a value

Like

RowTag(index as integer) as Variant // this one returns a row tag for a given list index
RowTag(index as integer, assigns v as Variant) // this one acts like a setter

So the first one can be used like

dim v as variant = Rowtag(i)

and the second like
dim v as variant
RowTag(i) = v

Very handy stuff