©2009 Google -
Code Home -
Terms of Service -
Privacy Policy -
Site Directory
Google Code offered in:
English -
Español -
日本語 -
한국어 -
Português -
Pусский -
中文(简体) -
中文(繁體)
An interface to a menu.
The add_item menu item is used to add a menu item to the specified menu.
This method takes a block that defines the action to perform when the menu
item is selected.
The item id that is returned can be used when adding an optional
validation procedure for the menu item.
Arguments:
Returns:
plugins_menu = UI.menu("Plugins")
item = plugins_menu.add_item("Test") { test }
if (item)
UI.messagebox item
else
UI.messagebox "Failure"
endThe add_separator method is used to add a menu separator to a menu.
Returns:
plugins_menu = UI.menu("Plugins")
plugins_menu.add_separatorThe add_submenu method is used to add a sub-menu to a menu.
Returns:
plugins_menu = UI.menu("Plugins")
submenu = plugins_menu.add_submenu("Test")
if (submenu)
UI.messagebox submenu
else
UI.messagebox "Failure"
endThe set_validation_proc method is used to identify the menu validation procedure. Your procedure should return either MF_ENABLED, MF_DISABLED, MF_CHECKED, MF_UNCHECKED, or MF_GRAYED.
Arguments:
Returns:
plugins_menu = UI.menu("Plugins")
item = plugins_menu.add_item("Test") {
return MF_GRAYEDTEST
}
UI.messagebox item
begin
status = plugins_menu.set_validation_proc(item) { testProc }
rescue
UI.messagebox $!.message
end