| 89 | } |
| 90 | |
| 91 | void UIMenuSubMenu::showSubMenu() { |
| 92 | sendCommonEvent( Event::OnMenuShow ); |
| 93 | UIMenu* menu = getParent()->asType<UIMenu>(); |
| 94 | mSubMenu->setParent( menu->getParent() ); |
| 95 | Vector2f pos = getPixelsPosition(); |
| 96 | nodeToWorldTranslation( pos ); |
| 97 | pos.x += mSize.getWidth() + menu->getPadding().Right; |
| 98 | UIMenu::findBestMenuPos( pos, mSubMenu, menu, this ); |
| 99 | mSubMenu->getParent()->worldToNode( pos ); |
| 100 | mSubMenu->setPosition( pos ); |
| 101 | if ( !mSubMenu->isVisible() ) { |
| 102 | if ( menu->mCurrentSubMenu != nullptr && menu->mCurrentSubMenu != mSubMenu ) |
| 103 | menu->mCurrentSubMenu->hide(); |
| 104 | mSubMenu->show(); |
| 105 | menu->mCurrentSubMenu = mSubMenu; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | Uint32 UIMenuSubMenu::onMouseOver( const Vector2i& pos, const Uint32& flags ) { |
| 110 | if ( nullptr == mCurWait ) { |
no test coverage detected