MyGUI  3.0.1
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
MyGUI::MenuCtrl Class Reference

#include <MyGUI_MenuCtrl.h>

+ Inheritance diagram for MyGUI::MenuCtrl:

Data Structures

struct  ItemInfo

Public Types

enum  ItemImage { ItemImageNone, ItemImagePopup }
typedef RTTIBase Base
typedef MenuCtrl RTTIBase
typedef std::vector< ItemInfoVectorMenuItemInfo
- Public Types inherited from MyGUI::Widget
typedef Widget RTTIBase
- Public Types inherited from MyGUI::IObject
typedef IObject RTTIBase

Public Member Functions

virtual const std::string & getTypeName () const
virtual bool isType (const std::type_info &_type) const
template<typename Type >
bool isType () const
 MenuCtrl ()
virtual void setVisible (bool _value)
 
void setVisibleSmooth (bool _value)
size_t getItemCount () const
 Get number of items.
MenuIteminsertItemAt (size_t _index, const UString &_name, MenuItemType _type=MenuItemType::Normal, const std::string &_id="", Any _data=Any::Null)
 Insert an item into a array at a specified position.
MenuIteminsertItem (MenuItem *_to, const UString &_name, MenuItemType _type=MenuItemType::Normal, const std::string &_id="", Any _data=Any::Null)
 Insert an item into a array.
MenuItemaddItem (const UString &_name, MenuItemType _type=MenuItemType::Normal, const std::string &_id="", Any _data=Any::Null)
 Add an item to the end of a array.
void removeItemAt (size_t _index)
 Remove item at a specified position.
void removeItem (MenuItem *_item)
 Remove item.
void removeAllItems ()
 Remove all items.
MenuItemgetItemAt (size_t _index)
 Get item from specified position.
size_t getItemIndex (MenuItem *_item)
 Get item index.
size_t findItemIndex (MenuItem *_item)
 Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
MenuItemfindItemWith (const UString &_name)
 Search item, returns the item of the first occurrence in array or nullptr if item not found.
void setItemDataAt (size_t _index, Any _data)
 Replace an item data at a specified position.
void setItemData (MenuItem *_item, Any _data)
 Replace an item data.
void clearItemDataAt (size_t _index)
 Clear an item data at a specified position.
void clearItemData (MenuItem *_item)
 Clear an item data.
template<typename ValueType >
ValueType * getItemDataAt (size_t _index, bool _throw=true)
 Get item data from specified position.
template<typename ValueType >
ValueType * getItemData (MenuItem *_item, bool _throw=true)
 Get item data.
void setItemIdAt (size_t _index, const std::string &_id)
 Replace an item id at a specified position.
void setItemId (MenuItem *_item, const std::string &_id)
 Replace an item id.
const std::string & getItemIdAt (size_t _index)
 Get item id from specified position.
const std::string & getItemId (MenuItem *_item)
 Get item id.
MenuItemgetItemById (const std::string &_id)
size_t getItemIndexById (const std::string &_id)
void setItemNameAt (size_t _index, const UString &_name)
 Replace an item name at a specified position.
void setItemName (MenuItem *_item, const UString &_name)
 Replace an item name.
const UStringgetItemNameAt (size_t _index)
 Get item from specified position.
const UStringgetItemName (MenuItem *_item)
 Get item from specified position.
size_t findItemIndexWith (const UString &_name)
 Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
void setItemChildVisibleAt (size_t _index, bool _visible)
void setItemChildVisible (MenuItem *_item, bool _visible)
template<typename Type >
Type * createItemChildTAt (size_t _index)
template<typename Type >
Type * createItemChildT (MenuItem *_item)
MenuCtrlgetItemChildAt (size_t _index)
MenuCtrlgetItemChild (MenuItem *_item)
MenuCtrlcreateItemChildAt (size_t _index)
MenuCtrlcreateItemChild (MenuItem *_item)
void removeItemChildAt (size_t _index)
void removeItemChild (MenuItem *_item)
MenuItemType getItemTypeAt (size_t _index)
MenuItemType getItemType (MenuItem *_item)
void setItemTypeAt (size_t _index, MenuItemType _type)
void setItemType (MenuItem *_item, MenuItemType _type)
void setPopupAccept (bool _value)
bool getPopupAccept ()
MenuItemgetMenuItemParent ()
void _notifyDeleteItem (MenuItem *_item)
void _notifyUpdateName (MenuItem *_item)
void _wrapItemChild (MenuItem *_item, MenuCtrl *_widget)
virtual void _initialise (WidgetStyle _style, const IntCoord &_coord, Align _align, ResourceSkin *_info, Widget *_parent, ICroppedRectangle *_croppedParent, IWidgetCreator *_creator, const std::string &_name)
void showMenu ()
void hideMenu ()
bool isShowMenu ()
void showItemChildAt (size_t _index)
void showItemChild (MenuItem *_item)
void hideItemChildAt (size_t _index)
void hideItemChild (MenuItem *_item)
- Public Member Functions inherited from MyGUI::Widget
template<typename Type >
Type * castType (bool _throw=true)
template<typename Type >
const Type * castType (bool _throw=true) const
 Widget ()
WidgetcreateWidgetT (const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_name="")
WidgetcreateWidgetT (const std::string &_type, const std::string &_skin, int _left, int _top, int _width, int _height, Align _align, const std::string &_name="")
WidgetcreateWidgetRealT (const std::string &_type, const std::string &_skin, const FloatCoord &_coord, Align _align, const std::string &_name="")
WidgetcreateWidgetRealT (const std::string &_type, const std::string &_skin, float _left, float _top, float _width, float _height, Align _align, const std::string &_name="")
template<typename T >
T * createWidget (const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_name="")
template<typename T >
T * createWidget (const std::string &_skin, int _left, int _top, int _width, int _height, Align _align, const std::string &_name="")
template<typename T >
T * createWidgetReal (const std::string &_skin, const FloatCoord &_coord, Align _align, const std::string &_name="")
template<typename T >
T * createWidgetReal (const std::string &_skin, float _left, float _top, float _width, float _height, Align _align, const std::string &_name="")
WidgetcreateWidgetT (WidgetStyle _style, const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer="", const std::string &_name="")
template<typename T >
T * createWidget (WidgetStyle _style, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer="", const std::string &_name="")
const std::string & getName () const
 Get name of widget.
virtual void setPosition (const IntPoint &_value)
virtual void setSize (const IntSize &_value)
virtual void setCoord (const IntCoord &_value)
void setPosition (int _left, int _top)
void setSize (int _width, int _height)
void setCoord (int _left, int _top, int _width, int _height)
void setRealPosition (const FloatPoint &_value)
void setRealSize (const FloatSize &_value)
void setRealCoord (const FloatCoord &_value)
void setRealPosition (float _left, float _top)
void setRealSize (float _width, float _height)
void setRealCoord (float _left, float _top, float _width, float _height)
virtual void setAlign (Align _value)
virtual void setCaption (const UString &_value)
virtual const UStringgetCaption ()
void setAlpha (float _value)
float getAlpha ()
void setInheritsAlpha (bool _value)
bool isInheritsAlpha ()
bool setState (const std::string &_value)
void setColour (const Colour &_value)
bool isRootWidget ()
WidgetgetParent ()
EnumeratorWidgetPtr getEnumerator ()
size_t getChildCount ()
WidgetgetChildAt (size_t _index)
WidgetfindWidget (const std::string &_name)
void setNeedKeyFocus (bool _value)
bool isNeedKeyFocus ()
void setNeedMouseFocus (bool _value)
bool isNeedMouseFocus ()
void setInheritsPick (bool _value)
bool isInheritsPick ()
void setMaskPick (const std::string &_filename)
virtual void setEnabled (bool _value)
void setEnabledSilent (bool _value)
bool isEnabled ()
void setPointer (const std::string &_value)
const std::string & getPointer ()
const std::string & getLayerName ()
IntCoord getClientCoord ()
WidgetgetClientWidget ()
ISubWidgetTextgetSubWidgetText ()
ISubWidgetRectgetSubWidgetMain ()
void setNeedToolTip (bool _value)
bool getNeedToolTip ()
void setEnableToolTip (bool _value)
bool getEnableToolTip ()
void detachFromWidget (const std::string &_layer="")
void attachToWidget (Widget *_parent, WidgetStyle _style=WidgetStyle::Child, const std::string &_layer="")
void changeWidgetSkin (const std::string &_skinname)
void setWidgetStyle (WidgetStyle _style, const std::string &_layer="")
WidgetStyle getWidgetStyle ()
virtual void setProperty (const std::string &_key, const std::string &_value)
virtual void _getContainer (Widget *&_container, size_t &_index)
void _forcePeek (Widget *_widget)
void _setUVSet (const FloatRect &_rect)
virtual void _setTextureName (const std::string &_texture)
virtual const std::string & _getTextureName ()
IWidgetCreator_getIWidgetCreator ()
IntCoord _getTextRegion ()
IntSize _getTextSize ()
void _setFontName (const std::string &_font)
const std::string & _getFontName ()
void _setFontHeight (int _height)
int _getFontHeight ()
void _setTextAlign (Align _align)
Align _getTextAlign ()
void _setTextColour (const Colour &_colour)
const Colour_getTextColour ()
void setCaptionWithNewLine (const std::string &_value)
void setPosition (const IntCoord &_coord)
void setPosition (int _left, int _top, int _width, int _height)
void enableToolTip (bool _enable)
void setInheritsPeek (bool _inherits)
bool isInheritsPeek ()
void setMaskPeek (const std::string &_filename)
IntCoord getTextCoord ()
IntSize getTextSize ()
void setFontName (const std::string &_font)
const std::string & getFontName ()
void setFontHeight (int _height)
int getFontHeight ()
void setTextAlign (Align _align)
Align getTextAlign ()
void setTextColour (const Colour &_colour)
const ColourgetTextColour ()
- Public Member Functions inherited from MyGUI::IObject
virtual ~IObject ()
- Public Member Functions inherited from MyGUI::ICroppedRectangle
 ICroppedRectangle ()
virtual ~ICroppedRectangle ()
ICroppedRectanglegetCroppedParent ()
const IntCoordgetCoord () const
IntPoint getPosition () const
IntSize getSize () const
bool isVisible () const
const IntPointgetAbsolutePosition () const
IntRect getAbsoluteRect () const
IntCoord getAbsoluteCoord () const
int getAbsoluteLeft () const
int getAbsoluteTop () const
Align getAlign () const
int getLeft () const
int getRight () const
int getTop () const
int getBottom () const
int getWidth () const
int getHeight () const
bool _isMargin () const
int _getViewLeft () const
int _getViewRight () const
int _getViewTop () const
int _getViewBottom () const
int _getViewWidth () const
int _getViewHeight () const
virtual void _correctView ()
void _setCroppedParent (ICroppedRectangle *_parent)
const IntRect_getMargin () const
int _getMarginLeft () const
int _getMarginRight () const
int _getMarginTop () const
int _getMarginBottom () const
void show ()
void hide ()
bool isShow ()
- Public Member Functions inherited from MyGUI::LayerItem
 LayerItem ()
virtual ~LayerItem ()
ILayergetLayer ()
virtual void attachItemToNode (ILayer *_layer, ILayerNode *_node)
virtual void detachFromLayer ()
virtual void upLayerItem ()
void setRenderItemTexture (ITexture *_texture)
void addChildItem (LayerItem *_item)
void removeChildItem (LayerItem *_item)
void addChildNode (LayerItem *_item)
void removeChildNode (LayerItem *_item)
void addRenderItem (ISubWidget *_item)
void removeAllRenderItems ()
void saveLayerItem ()
void restoreLayerItem ()
- Public Member Functions inherited from MyGUI::ILayerItem
virtual ~ILayerItem ()
- Public Member Functions inherited from MyGUI::UserData
 UserData ()
virtual ~UserData ()
void setUserString (const std::string &_key, const std::string &_value)
const std::string & getUserString (const std::string &_key)
bool clearUserString (const std::string &_key)
bool isUserString (const std::string &_key)
void clearUserStrings ()
void setUserData (Any _data)
template<typename ValueType >
ValueType * getUserData (bool _throw=true)
void _setInternalData (Any _data)
template<typename ValueType >
ValueType * _getInternalData (bool _throw=true)
void * getUserData ()
- Public Member Functions inherited from MyGUI::WidgetEvent
virtual ~WidgetEvent ()
- Public Member Functions inherited from MyGUI::IWidgetCreator
virtual ~IWidgetCreator ()
virtual void _linkChildWidget (Widget *_widget)
virtual void _unlinkChildWidget (Widget *_widget)

Static Public Member Functions

static const std::string & getClassTypeName ()

Data Fields

EventHandle_MenuCtrlPtrMenuItemPtr eventMenuCtrlAccept
EventHandle_MenuCtrlPtr eventMenuCtrlClose

Protected Member Functions

virtual ~MenuCtrl ()
void baseChangeWidgetSkin (ResourceSkin *_info)
virtual WidgetbaseCreateWidget (WidgetStyle _style, const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer, const std::string &_name)
virtual void onKeyChangeRootFocus (bool _focus)
- Protected Member Functions inherited from MyGUI::Widget
 Widget (WidgetStyle _style, const IntCoord &_coord, Align _align, ResourceSkin *_info, Widget *_parent, ICroppedRectangle *_croppedParent, IWidgetCreator *_creator, const std::string &_name)
virtual ~Widget ()
void _updateView ()
void _setAlign (const IntSize &_oldsize, bool _update)
void _setAlign (const IntCoord &_oldcoord, bool _update)
virtual void _destroyChildWidget (Widget *_widget)
virtual void _destroyAllChildWidget ()
virtual size_t _getContainerIndex (const IntPoint &_point)
virtual void _resetContainer (bool _update)
virtual void baseUpdateEnable ()
virtual ILayerItemgetLayerItemByPoint (int _left, int _top)
virtual const IntCoordgetLayerItemCoord ()
- Protected Member Functions inherited from MyGUI::ICroppedRectangle
bool _checkPoint (int _left, int _top)
bool _checkMargin ()
bool _checkOutside ()
- Protected Member Functions inherited from MyGUI::LayerItem
void attachToLayerItemNode (ILayerNode *_node, bool _deep)
void detachFromLayerItemNode (bool _deep)
- Protected Member Functions inherited from MyGUI::WidgetEvent
 WidgetEvent ()
virtual void onMouseLostFocus (Widget *_new)
virtual void onMouseSetFocus (Widget *_old)
virtual void onMouseDrag (int _left, int _top)
virtual void onMouseMove (int _left, int _top)
virtual void onMouseWheel (int _rel)
virtual void onMouseButtonPressed (int _left, int _top, MouseButton _id)
virtual void onMouseButtonReleased (int _left, int _top, MouseButton _id)
virtual void onMouseButtonClick ()
virtual void onMouseButtonDoubleClick ()
virtual void onKeyLostFocus (Widget *_new)
virtual void onKeySetFocus (Widget *_old)
virtual void onKeyButtonPressed (KeyCode _key, Char _char)
virtual void onKeyButtonReleased (KeyCode _key)
virtual void onMouseChangeRootFocus (bool _focus)
- Protected Member Functions inherited from MyGUI::IWidgetCreator
void _deleteWidget (Widget *_widget)

Protected Attributes

bool mHideByAccept
bool mMenuDropMode
bool mIsMenuDrop
bool mHideByLostKey
- Protected Attributes inherited from MyGUI::Widget
MapWidgetStateInfo mStateInfo
MaskPickInfo const * mMaskPickInfo
MaskPickInfo mOwnMaskPickInfo
VectorWidgetPtr mWidgetChild
VectorWidgetPtr mWidgetChildSkin
VectorSubWidget mSubSkinChild
ISubWidgetTextmText
ISubWidgetRectmMainSkin
bool mEnabled
bool mInheritsEnabled
bool mSubSkinsVisible
bool mInheritsVisible
float mAlpha
float mRealAlpha
bool mInheritsAlpha
std::string mName
std::string mPointer
std::string mTextureName
ITexturemTexture
WidgetmParent
IWidgetCreatormIWidgetCreator
bool mNeedKeyFocus
bool mNeedMouseFocus
bool mInheritsPick
WidgetmWidgetClient
bool mNeedToolTip
bool mEnableToolTip
bool mToolTipVisible
float mToolTipCurrentTime
IntPoint mToolTipOldPoint
size_t mToolTipOldIndex
IntPoint m_oldMousePoint
WidgetStyle mWidgetStyle
FloatCoord mRelativeCoord
bool mDisableUpdateRelative
- Protected Attributes inherited from MyGUI::ICroppedRectangle
bool mIsMargin
IntRect mMargin
IntCoord mCoord
IntPoint mAbsolutePosition
ICroppedRectanglemCroppedParent
bool mVisible
Align mAlign
- Protected Attributes inherited from MyGUI::WidgetEvent
WidgetmWidgetEventSender

Detailed Description

Definition at line 41 of file MyGUI_MenuCtrl.h.

Member Typedef Documentation

Definition at line 44 of file MyGUI_MenuCtrl.h.

Definition at line 44 of file MyGUI_MenuCtrl.h.

Definition at line 84 of file MyGUI_MenuCtrl.h.

Member Enumeration Documentation

Enumerator:
ItemImageNone 
ItemImagePopup 

Definition at line 49 of file MyGUI_MenuCtrl.h.

Constructor & Destructor Documentation

MyGUI::MenuCtrl::MenuCtrl ( )

Definition at line 40 of file MyGUI_MenuCtrl.cpp.

MyGUI::MenuCtrl::~MenuCtrl ( )
protectedvirtual

Definition at line 80 of file MyGUI_MenuCtrl.cpp.

Member Function Documentation

void MyGUI::MenuCtrl::_initialise ( WidgetStyle  _style,
const IntCoord _coord,
Align  _align,
ResourceSkin _info,
Widget _parent,
ICroppedRectangle _croppedParent,
IWidgetCreator _creator,
const std::string &  _name 
)
virtual

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::MenuBar, and MyGUI::PopupMenu.

Definition at line 57 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::_notifyDeleteItem ( MenuItem _item)

Definition at line 304 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::_notifyUpdateName ( MenuItem _item)

Definition at line 314 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::_wrapItemChild ( MenuItem _item,
MenuCtrl _widget 
)

Definition at line 510 of file MyGUI_MenuCtrl.cpp.

MenuItem * MyGUI::MenuCtrl::addItem ( const UString _name,
MenuItemType  _type = MenuItemType::Normal,
const std::string &  _id = "",
Any  _data = Any::Null 
)

Add an item to the end of a array.

Definition at line 614 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::baseChangeWidgetSkin ( ResourceSkin _info)
protectedvirtual

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::MenuBar, and MyGUI::PopupMenu.

Definition at line 86 of file MyGUI_MenuCtrl.cpp.

Widget * MyGUI::MenuCtrl::baseCreateWidget ( WidgetStyle  _style,
const std::string &  _type,
const std::string &  _skin,
const IntCoord _coord,
Align  _align,
const std::string &  _layer,
const std::string &  _name 
)
protectedvirtual

Reimplemented from MyGUI::Widget.

Definition at line 151 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::clearItemData ( MenuItem _item)
inline

Clear an item data.

Definition at line 139 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::clearItemDataAt ( size_t  _index)
inline

Clear an item data at a specified position.

Definition at line 137 of file MyGUI_MenuCtrl.h.

MenuCtrl* MyGUI::MenuCtrl::createItemChild ( MenuItem _item)
inline

Create child item (submenu) for item

Definition at line 215 of file MyGUI_MenuCtrl.h.

MenuCtrl* MyGUI::MenuCtrl::createItemChildAt ( size_t  _index)
inline

Create child item (submenu) for item by index

Definition at line 212 of file MyGUI_MenuCtrl.h.

template<typename Type >
Type* MyGUI::MenuCtrl::createItemChildT ( MenuItem _item)
inline

Create specific type child item (submenu) for item

Definition at line 203 of file MyGUI_MenuCtrl.h.

template<typename Type >
Type* MyGUI::MenuCtrl::createItemChildTAt ( size_t  _index)
inline

Create specific type child item (submenu) for item by index

Definition at line 196 of file MyGUI_MenuCtrl.h.

size_t MyGUI::MenuCtrl::findItemIndex ( MenuItem _item)

Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.

Definition at line 675 of file MyGUI_MenuCtrl.cpp.

size_t MyGUI::MenuCtrl::findItemIndexWith ( const UString _name)

Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.

Definition at line 666 of file MyGUI_MenuCtrl.cpp.

MenuItem * MyGUI::MenuCtrl::findItemWith ( const UString _name)

Search item, returns the item of the first occurrence in array or nullptr if item not found.

Definition at line 639 of file MyGUI_MenuCtrl.cpp.

static const std::string& MyGUI::MenuCtrl::getClassTypeName ( )
inlinestatic

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::MenuBar, and MyGUI::PopupMenu.

Definition at line 44 of file MyGUI_MenuCtrl.h.

MenuItem * MyGUI::MenuCtrl::getItemAt ( size_t  _index)

Get item from specified position.

Definition at line 624 of file MyGUI_MenuCtrl.cpp.

MenuItem * MyGUI::MenuCtrl::getItemById ( const std::string &  _id)

Get item by id

Definition at line 648 of file MyGUI_MenuCtrl.cpp.

MenuCtrl* MyGUI::MenuCtrl::getItemChild ( MenuItem _item)
inline

Get child item (submenu) from item

Definition at line 209 of file MyGUI_MenuCtrl.h.

MenuCtrl * MyGUI::MenuCtrl::getItemChildAt ( size_t  _index)

Get child item (submenu) from item by index

Definition at line 262 of file MyGUI_MenuCtrl.cpp.

size_t MyGUI::MenuCtrl::getItemCount ( ) const
inline

Get number of items.

Definition at line 97 of file MyGUI_MenuCtrl.h.

template<typename ValueType >
ValueType* MyGUI::MenuCtrl::getItemData ( MenuItem _item,
bool  _throw = true 
)
inline

Get item data.

Definition at line 150 of file MyGUI_MenuCtrl.h.

template<typename ValueType >
ValueType* MyGUI::MenuCtrl::getItemDataAt ( size_t  _index,
bool  _throw = true 
)
inline

Get item data from specified position.

Definition at line 143 of file MyGUI_MenuCtrl.h.

const std::string& MyGUI::MenuCtrl::getItemId ( MenuItem _item)
inline

Get item id.

Definition at line 163 of file MyGUI_MenuCtrl.h.

const std::string & MyGUI::MenuCtrl::getItemIdAt ( size_t  _index)

Get item id from specified position.

Definition at line 298 of file MyGUI_MenuCtrl.cpp.

size_t MyGUI::MenuCtrl::getItemIndex ( MenuItem _item)

Get item index.

Definition at line 630 of file MyGUI_MenuCtrl.cpp.

size_t MyGUI::MenuCtrl::getItemIndexById ( const std::string &  _id)

Get item index by id

Definition at line 657 of file MyGUI_MenuCtrl.cpp.

const UString& MyGUI::MenuCtrl::getItemName ( MenuItem _item)
inline

Get item from specified position.

Definition at line 181 of file MyGUI_MenuCtrl.h.

const UString & MyGUI::MenuCtrl::getItemNameAt ( size_t  _index)

Get item from specified position.

Definition at line 201 of file MyGUI_MenuCtrl.cpp.

MenuItemType MyGUI::MenuCtrl::getItemType ( MenuItem _item)
inline

Get item type (see MenuItemType) from item

Definition at line 228 of file MyGUI_MenuCtrl.h.

MenuItemType MyGUI::MenuCtrl::getItemTypeAt ( size_t  _index)

Get item type (see MenuItemType) from item by index

Definition at line 324 of file MyGUI_MenuCtrl.cpp.

MenuItem* MyGUI::MenuCtrl::getMenuItemParent ( )
inline

Get parent menu item or nullptr if no item

Definition at line 241 of file MyGUI_MenuCtrl.h.

bool MyGUI::MenuCtrl::getPopupAccept ( )
inline

Get mode when clicking on item with submenu generate eventMenuCtrlAccept and closes menu

Definition at line 238 of file MyGUI_MenuCtrl.h.

virtual const std::string& MyGUI::MenuCtrl::getTypeName ( ) const
inlinevirtual

Get type name as string

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::MenuBar, and MyGUI::PopupMenu.

Definition at line 44 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::hideItemChild ( MenuItem _item)
inline
Deprecated:
"use : void setItemChildVisible(MenuItem* _item, bool _visible)"

Definition at line 283 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::hideItemChildAt ( size_t  _index)
inline
Deprecated:
"use : void setItemChildVisibleAt(size_t _index, bool _visible)"

Definition at line 281 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::hideMenu ( )
inline
Deprecated:
"use : void Widget::setVisible(bool _value)"

Definition at line 272 of file MyGUI_MenuCtrl.h.

MenuItem * MyGUI::MenuCtrl::insertItem ( MenuItem _to,
const UString _name,
MenuItemType  _type = MenuItemType::Normal,
const std::string &  _id = "",
Any  _data = Any::Null 
)

Insert an item into a array.

Definition at line 609 of file MyGUI_MenuCtrl.cpp.

MenuItem * MyGUI::MenuCtrl::insertItemAt ( size_t  _index,
const UString _name,
MenuItemType  _type = MenuItemType::Normal,
const std::string &  _id = "",
Any  _data = Any::Null 
)

Insert an item into a array at a specified position.

Definition at line 167 of file MyGUI_MenuCtrl.cpp.

bool MyGUI::MenuCtrl::isShowMenu ( )
inline
Deprecated:
"use : bool Widget::isVisible()"

Definition at line 274 of file MyGUI_MenuCtrl.h.

template<typename Type >
bool MyGUI::MenuCtrl::isType ( ) const
inline

Compare with selected type

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::MenuBar, and MyGUI::PopupMenu.

Definition at line 44 of file MyGUI_MenuCtrl.h.

virtual bool MyGUI::MenuCtrl::isType ( const std::type_info &  _type) const
inlinevirtual

Compare with selected type

Reimplemented from MyGUI::Widget.

Reimplemented in MyGUI::MenuBar, and MyGUI::PopupMenu.

Definition at line 44 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::onKeyChangeRootFocus ( bool  _focus)
protectedvirtual

Reimplemented from MyGUI::WidgetEvent.

Definition at line 491 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::removeAllItems ( )

Remove all items.

Definition at line 189 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::removeItem ( MenuItem _item)

Remove item.

Definition at line 619 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::removeItemAt ( size_t  _index)

Remove item at a specified position.

Definition at line 178 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::removeItemChild ( MenuItem _item)
inline

Remove child item (submenu) for item

Definition at line 221 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::removeItemChildAt ( size_t  _index)

Remove child item (submenu) for item by index

Definition at line 268 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::setItemChildVisible ( MenuItem _item,
bool  _visible 
)
inline

Show or hide item (submenu)

Definition at line 189 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::setItemChildVisibleAt ( size_t  _index,
bool  _visible 
)

Show or hide item (submenu) at a specified position

Definition at line 384 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::setItemData ( MenuItem _item,
Any  _data 
)
inline

Replace an item data.

Definition at line 134 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::setItemDataAt ( size_t  _index,
Any  _data 
)

Replace an item data at a specified position.

Definition at line 256 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::setItemId ( MenuItem _item,
const std::string &  _id 
)
inline

Replace an item id.

Definition at line 158 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::setItemIdAt ( size_t  _index,
const std::string &  _id 
)

Replace an item id at a specified position.

Definition at line 292 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::setItemName ( MenuItem _item,
const UString _name 
)
inline

Replace an item name.

Definition at line 176 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::setItemNameAt ( size_t  _index,
const UString _name 
)

Replace an item name at a specified position.

Definition at line 281 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::setItemType ( MenuItem _item,
MenuItemType  _type 
)
inline

Set item type (see MenuItemType) from item

Definition at line 233 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::setItemTypeAt ( size_t  _index,
MenuItemType  _type 
)

Set item type (see MenuItemType) from item by index

Definition at line 330 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::setPopupAccept ( bool  _value)
inline

Set mode when clicking on item with submenu generate eventMenuCtrlAccept and closes menu

Definition at line 236 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::setVisible ( bool  _value)
virtual

Hide or show widget

Reimplemented from MyGUI::Widget.

Definition at line 547 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::setVisibleSmooth ( bool  _value)

Hide or show Menu smooth

Definition at line 569 of file MyGUI_MenuCtrl.cpp.

void MyGUI::MenuCtrl::showItemChild ( MenuItem _item)
inline
Deprecated:
"use : void setItemChildVisible(MenuItem* _item, bool _visible)"

Definition at line 279 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::showItemChildAt ( size_t  _index)
inline
Deprecated:
"use : void setItemChildVisibleAt(size_t _index, bool _visible)"

Definition at line 277 of file MyGUI_MenuCtrl.h.

void MyGUI::MenuCtrl::showMenu ( )
inline
Deprecated:
"use : void Widget::setVisible(bool _value)"

Definition at line 270 of file MyGUI_MenuCtrl.h.

Field Documentation

EventHandle_MenuCtrlPtrMenuItemPtr MyGUI::MenuCtrl::eventMenuCtrlAccept

Event : Enter pressed or mouse clicked.
signature : void method(MyGUI::MenuCtrl* _sender, MyGUI::MenuItem* _item)

Parameters
_senderwidget that called this event
_itemSelected item

Definition at line 250 of file MyGUI_MenuCtrl.h.

EventHandle_MenuCtrlPtr MyGUI::MenuCtrl::eventMenuCtrlClose

Event : Menu was closed by select or focus change.
signature : void method(MyGUI::MenuCtrl* _sender)

Parameters
_senderwidget that called this event

Definition at line 256 of file MyGUI_MenuCtrl.h.

bool MyGUI::MenuCtrl::mHideByAccept
protected

Definition at line 338 of file MyGUI_MenuCtrl.h.

bool MyGUI::MenuCtrl::mHideByLostKey
protected

Definition at line 342 of file MyGUI_MenuCtrl.h.

bool MyGUI::MenuCtrl::mIsMenuDrop
protected

Definition at line 341 of file MyGUI_MenuCtrl.h.

bool MyGUI::MenuCtrl::mMenuDropMode
protected

Definition at line 340 of file MyGUI_MenuCtrl.h.


The documentation for this class was generated from the following files: