88 std::string_view _id = {},
95 std::string_view _id = {},
96 Any _data = Any::Null);
100 const UString& _name,
101 MenuItemType _type = MenuItemType::Normal,
102 std::string_view _id = {},
103 Any _data = Any::Null);
106 void removeItemAt(
size_t _index);
108 void removeItem(MenuItem* _item);
111 void removeAllItems();
115 MenuItem* getItemAt(
size_t _index)
const;
118 size_t getItemIndex(
const MenuItem* _item)
const;
121 size_t findItemIndex(MenuItem* _item);
124 MenuItem* findItemWith(
const UString& _name);
130 void setItemDataAt(
size_t _index, Any _data);
132 void setItemData(MenuItem* _item, Any _data);
135 void clearItemDataAt(
size_t _index);
137 void clearItemData(MenuItem* _item);
140 template<
typename ValueType>
144 return mItemsInfo[_index].data.castType<ValueType>(_throw);
147 template<
typename ValueType>
154 void setItemIdAt(
size_t _index, std::string_view _id);
156 void setItemId(
MenuItem* _item, std::string_view _id);
159 const std::string& getItemIdAt(
size_t _index)
const;
161 const std::string& getItemId(
const MenuItem* _item)
const;
164 MenuItem* getItemById(std::string_view _id)
const;
167 MenuItem* findItemById(std::string_view _id,
bool _recursive =
false);
170 size_t getItemIndexById(std::string_view _id)
const;
175 void setItemNameAt(
size_t _index,
const UString& _name);
180 const UString& getItemNameAt(
size_t _index)
const;
185 size_t findItemIndexWith(
const UString& _name);
188 void setItemChildVisibleAt(
size_t _index,
bool _visible);
190 void setItemChildVisible(
MenuItem* _item,
bool _visible);
196 template<
typename Type>
199 return static_cast<Type*
>(createItemChildByType(_index, Type::getClassTypeName()));
203 template<
typename Type>
222 void removeItemChildAt(
size_t _index);
225 void removeItemChild(
MenuItem* _item);
240 void setPopupAccept(
bool _value);
242 bool getPopupAccept()
const;
245 MenuItem* getMenuItemParent()
const;
248 void setVerticalAlignment(
bool _value);
250 bool getVerticalAlignment()
const;
297 void notifyRootKeyChangeFocus(
Widget* _sender,
bool _focus)
const;
298 void notifyMouseButtonClick(
Widget* _sender);
299 void notifyMouseSetFocus(
Widget* _sender,
Widget* _new);
301 const std::string& getSkinByType(
MenuItemType _type)
const;
302 std::string_view getIconIndexByType(
MenuItemType _type)
const;
308 void notifyMenuCtrlAccept(
MenuItem* _item);
310 Widget* createItemChildByType(
size_t _index, std::string_view _type);
317 std::string_view _id,
322 void _setItemChildVisibleAt(
size_t _index,
bool _visible,
bool _smooth);
333 VectorMenuItemInfo mItemsInfo;
335 std::string mItemNormalSkin;
336 std::string mItemPopupSkin;
337 std::string mItemSeparatorSkin;
339 std::string mSubMenuSkin;
340 std::string mSubMenuLayer;
343 bool mShutdown{
false};
345 bool mVerticalAlignment{
true};
346 int mDistanceButton{0};
347 bool mPopupAccept{
false};
348 MenuItem* mOwner{
nullptr};
349 bool mAnimateSmooth{
false};
351 bool mChangeChildSkin{
false};
352 bool mInternalCreateChild{
false};