hiCreateMenuItem
hiCreateMenuItem(?names_itemHandle?itemTextt_menuItemText[?itemIcong_menuIcon] [?callbackt_itemCallback] [?disableg_disabled] [?statusTipt_statusTip] [?fontt_font] ) =>r_hiMenuItem
Description
Creates a menu item that can be used in any type of menu, except two-dimensional menus and simple menus.
The menu item should contain text t_menuItemText and optionally an icon g_menuIcon to be displayed adjacent to the text. Also, the menu item can have a SKILL callback procedure associated with its selection (t_itemCallback).
If an action was created with a callback of the same name as the callback for this function, and if an icon was specified for the action, then that icon is used for this menu item. Otherwise, the icon you specify is used. The menu item can also have an access key or shortcut. Pressing this key selects the menu item.
You can use the same menu item in multiple menus.
The menu item created with this function is a non-slider entry, that is, it cannot display a submenu. Use hiCreateSliderMenuItem to create slider items and use hiCreateSeparatorMenuItem to create separators.
Arguments
Value Returned
|
The SKILL structure representing the menu item. The item handle and text menu item can be referenced by menuItem-> |
Examples
Creates two menu items as One and Two.
trMenuItemOne = hiCreateMenuItem(
?name ’trMenuItemOne
?itemText "One"
?callback "println( \"One\" )"
)
trMenuItemTwo = hiCreateMenuItem(
?name ’trMenuItemTwo
?itemText "Two"
?callback "println ( \"Two\" )"
)
Adds a new entry, Library Browser, to the CIW. It looks for the Library Manager entry in all the menus of the CIW, and adds an entry for the Library Browser immediately after it.
let( ((ciwBannerMenus hiGetBannerMenus(window(1))) toolMenu
pdItem menuList found libBrowser)
while(ciwBannerMenus
pdItem = eval(car(ciwBannerMenus))
ciwBannerMenus = cdr(ciwBannerMenus)
menuList = pdItem ->_menuItemList
while(menuList
menuItem = car(menuList)
menuList = cdr(menuList)
when(menuItem == ’LibMan
found = t
menuList = nil
ciwBannerMenus = nil
)
)
)
when( found
libBrowser = hiCreateMenuItem(
?name ’LibBrowser
?itemText "Library Browser..."
?callback "dmbOpenLibDAGBrowser()"
)
hiInsertMenuItem(pdItem libBrowser ’LibMan)
)
)
Related Topics
Return to top