示例#1
0
文件: menu.cpp 项目: mariuz/haiku
MenuItem*
Menu::FindItemByShortcut(char key)
{
	if (key == 0)
		return NULL;

	MenuItemList::Iterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item->Shortcut() == key)
			return item;
	}

	return NULL;
}
示例#2
0
MenuItem*
Menu::FindItemByShortcut(char key)
{
	if (key == 0)
		return NULL;

	MenuItemList::Iterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item->Shortcut() == key)
			return item;
	}

	Menu *superMenu = Supermenu();

	if (superMenu != NULL)
		return superMenu->FindItemByShortcut(key);

	return NULL;
}