MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onCellHighlighted

Method onCellHighlighted

Engine/source/gui/editor/guiPopupMenuCtrl.cpp:239–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239void GuiPopupMenuTextListCtrl::onCellHighlighted(Point2I cell)
240{
241 // If this text list control is part of a submenu, then don't worry about
242 // passing this along
243 if (!isSubMenu)
244 {
245 RectI globalbounds(getBounds());
246 Point2I globalpoint = localToGlobalCoord(globalbounds.point);
247 globalbounds.point = globalpoint;
248 }
249
250 S32 selectionIndex = cell.y;
251
252 if (selectionIndex != -1 && mLastHighlightedMenuIdx != selectionIndex)
253 {
254 mLastHighlightedMenuIdx = selectionIndex;
255
256 mPopup->hidePopupSubmenus();
257 }
258
259 if (selectionIndex != -1)
260 {
261 MenuItem *list = &mPopup->mMenuItems[selectionIndex];
262
263 if (list->mIsSubmenu && list->mSubMenu != nullptr)
264 {
265 list->mSubMenu->showPopup(getRoot(), getPosition().x + mCellSize.x, getPosition().y + (selectionIndex * mCellSize.y));
266 }
267 }
268}

Callers

nothing calls this directly

Calls 4

getBoundsFunction · 0.85
getPositionFunction · 0.85
hidePopupSubmenusMethod · 0.80
showPopupMethod · 0.80

Tested by

no test coverage detected