| 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 | { |
nothing calls this directly
no test coverage detected