Exemple #1
0
void Menu::OnHoverItem( Gwen::Controls::Base* pControl )
{
	if ( !ShouldHoverOpenMenu() ) return;

	MenuItem* pItem = gwen_cast<MenuItem>(pControl);
	if (!pItem) return;
	if ( pItem->IsMenuOpen() ) return;

	CloseAll();
	pItem->OpenMenu();
}
Exemple #2
0
bool Menu::IsMenuOpen()
{
	for ( Base::List::iterator it = m_InnerPanel->Children.begin(); it != m_InnerPanel->Children.end(); ++it )
	{
		Base* pChild = *it;
		MenuItem* pItem = gwen_cast<MenuItem>(pChild);
		if ( !pItem ) continue;

		if ( pItem->IsMenuOpen() )
			return true;
	}

	return false;
}