The Menuitem Class

The Menuitem class is the template for creating menu items. Its hierarchy is depicted in Figure 9.1.

Figure 9.1. The Menuitem class hierarchy


The attribute of the Baselistitem class is given in Table 9.2, those of the Textlistitem class in Table 9.3, and that of the Menuitem class in Table 9.4. The Listitem class does not add new attributes. The Basecomponent and Basevaluecomponent classes are discussed in Chapter 2.

Table 9.2. The attribute of the Baselistitem class
NameUsageTypeDefaultAccessibility
onselectedTag and JSexpressionnullread-write
 Description. The event that is raised when this item is selected.

Table 9.3. The attributes of the Textlistitem class
NameUsageTypeDefaultAccessibility
text_xTag and JSnumber4read-write
 Description. The x position of the displayed text.
text_yTag and JSnumber read-write
 Description. The y position of the text label.

Table 9.4. The attribute of the Menuitem class
NameUsageTypeDefaultAccessibility
commandTag and JSexpressionnullread-write
 Description. The command object to be executed when this menuitem is selected.

You usually add an event handler to the selected event. This event handler is executed when the menu item is selected. You’ll see how to achieve this in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset