MenuItem Popup

Greetings all,

Looking forward to XDC and my first visit to the USA.

Is it possible to subclass the MenuItem class and then use the popup method to select an item? The return selected item is a MenuItem class and not a subclassed MyMenuItem class. I want to add another property to the MenuItem class.

Cheers
Grant

Not at the computer at the moment so I can’t test. You should be able to cast your menuitem to the subclass.

Each row of a menuItem also has a RowTag which takes a variant. So what I do is set the RowTag to the item in question. Bingo.

Already using the tag to store the object in question. I want a second tag variant.

My test in casting my subclassed menu item back to a normal MenuItem has yielded the expected result of the extra property in my subclass being nil.

I’l have to go down another path.

Cheers
Grant

Use a Pair to store two values in the rowTag property or even a dictionary or object.

As Sam says use a pair, or make another class that holds references to as many items as you like, eg

Class Holder
Property a as appointment
Property c as color
Property p as person
Etc etc