72 void setVisible(
bool _visible)
override;
75 void setVisibleSmooth(
bool _visible);
81 size_t getItemCount()
const;
88 std::string_view _id = {},
89 Any _data = Any::Null);
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>
150 return getItemDataAt<ValueType>(getItemIndex(_item), _throw);
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>
206 return createItemChildTAt<Type>(getItemIndex(_item));
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;
269 void _notifyDeleteItem(
MenuItem* _item);
270 void _notifyDeletePopup(
MenuItem* _item);
271 void _notifyUpdateName(
MenuItem* _item);
275 size_t _getItemCount()
const override;
277 void _removeItemAt(
size_t _index)
override;
278 Widget* _getItemAt(
size_t _index)
const override;
279 void _setItemNameAt(
size_t _index,
const UString& _name)
override;
280 const UString& _getItemNameAt(
size_t _index)
const override;
281 void _setItemSelected(
IItem* _item)
override;
283 void _updateItems(
size_t _index);
284 void _updateSizeForEmpty();
287 void initialiseOverride()
override;
288 void shutdownOverride()
override;
290 void onKeyChangeRootFocus(
bool _focus)
override;
292 void onWidgetCreated(
Widget* _widget)
override;
294 void setPropertyOverride(std::string_view _key, std::string_view _value)
override;
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;
306 MenuItemType getItemType(
bool _submenu,
bool _separator)
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);
325 bool mHideByAccept{
true};
327 bool mMenuDropMode{
false};
328 bool mIsMenuDrop{
true};
329 bool mHideByLostKey{
false};
330 bool mResizeToContent{
true};
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};