void LLMenuButton::hideMenu()
{
	if(mMenuHandle.isDead()) return;

	LLToggleableMenu* menu = dynamic_cast<LLToggleableMenu*>(mMenuHandle.get());
	if (menu)
	{
		menu->setVisible(FALSE);
	}
}
BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask )
{
	if (mMenuHandle.isDead()) return FALSE;

	if( KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key))
	{
		// *HACK: We emit the mouse down signal to fire the callback bound to the
		// menu emerging event before actually displaying the menu. See STORM-263.
		LLUICtrl::handleMouseDown(-1, -1, MASK_NONE);

		toggleMenu();
		return TRUE;
	}

	LLToggleableMenu* menu = dynamic_cast<LLToggleableMenu*>(mMenuHandle.get());
	if (menu && menu->getVisible() && key == KEY_ESCAPE && mask == MASK_NONE)
	{
		menu->setVisible(FALSE);
		return TRUE;
	}
	
	return FALSE;
}