MCPcopy Create free account
hub / github.com/MyGUI/mygui / _wrapItem

Method _wrapItem

MyGUIEngine/src/MyGUI_MenuControl.cpp:496–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494 }
495
496 void MenuControl::_wrapItem(
497 MenuItem* _item,
498 size_t _index,
499 const UString& _name,
500 MenuItemType _type,
501 std::string_view _id,
502 Any _data)
503 {
504 _item->setAlign(mVerticalAlignment ? Align::Top | Align::HStretch : Align::Default);
505 _item->eventRootKeyChangeFocus += newDelegate(this, &MenuControl::notifyRootKeyChangeFocus);
506 _item->eventMouseButtonClick += newDelegate(this, &MenuControl::notifyMouseButtonClick);
507 _item->eventMouseSetFocus += newDelegate(this, &MenuControl::notifyMouseSetFocus);
508
509 _item->setImageName(getIconIndexByType(_type));
510
511 MenuControl* submenu = nullptr;
512
513 ItemInfo info = ItemInfo(_item, _name, _type, submenu, _id, _data);
514
515 mItemsInfo.insert(mItemsInfo.begin() + _index, std::move(info));
516
517 mChangeChildSkin = true;
518 _item->changeWidgetSkin(getSkinByType(_type));
519 mChangeChildSkin = false;
520
521 // его сет капшен, обновит размер
522 _item->setCaption(_name);
523
524 update();
525 }
526
527 void MenuControl::setVisible(bool _visible)
528 {

Callers

nothing calls this directly

Calls 8

newDelegateFunction · 0.85
ItemInfoClass · 0.85
setImageNameMethod · 0.80
changeWidgetSkinMethod · 0.80
setAlignMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
setCaptionMethod · 0.45

Tested by

no test coverage detected