MCPcopy Create free account
hub / github.com/SpartanJ/eepp / showSubMenu

Method showSubMenu

src/eepp/ui/uimenusubmenu.cpp:91–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void 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
109Uint32 UIMenuSubMenu::onMouseOver( const Vector2i& pos, const Uint32& flags ) {
110 if ( nullptr == mCurWait ) {

Callers 1

onKeyDownMethod · 0.80

Calls 9

getParentFunction · 0.85
setParentMethod · 0.80
getParentMethod · 0.45
getWidthMethod · 0.45
worldToNodeMethod · 0.45
setPositionMethod · 0.45
isVisibleMethod · 0.45
hideMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected