VSTGUI  4.10
Graphical User Interface Framework not only for VST plugins
CMenuItem Class Reference

a menu item More...

+ Inheritance diagram for CMenuItem:

Public Types

enum  Flags {
  kNoFlags = 0, kDisabled = 1 << 0, kTitle = 1 << 1, kChecked = 1 << 2,
  kSeparator = 1 << 3
}
 

Public Member Functions

 CMenuItem (const UTF8String &title, const UTF8String &keycode="", int32_t keyModifiers=0, CBitmap *icon=nullptr, int32_t flags=kNoFlags)
 CMenuItem constructor. More...
 
 CMenuItem (const UTF8String &title, COptionMenu *submenu, CBitmap *icon=nullptr)
 CMenuItem constructor. More...
 
 CMenuItem (const UTF8String &title, int32_t tag)
 CMenuItem constructor. More...
 
 CMenuItem (const CMenuItem &item)
 CMenuItem copy constructor. More...
 
CMenuItem Methods
virtual void setTitle (const UTF8String &title)
 set title of menu item More...
 
virtual void setSubmenu (COptionMenu *submenu)
 set submenu of menu item More...
 
virtual void setKey (const UTF8String &keyCode, int32_t keyModifiers=0)
 set keycode and key modifiers of menu item More...
 
virtual void setVirtualKey (int32_t virtualKeyCode, int32_t keyModifiers=0)
 set virtual keycode and key modifiers of menu item More...
 
virtual void setEnabled (bool state=true)
 set menu item enabled state More...
 
virtual void setChecked (bool state=true)
 set menu item checked state More...
 
virtual void setIsTitle (bool state=true)
 set menu item title state More...
 
virtual void setIsSeparator (bool state=true)
 set menu item separator state More...
 
virtual void setIcon (CBitmap *icon)
 set menu item icon More...
 
virtual void setTag (int32_t tag)
 set menu item tag More...
 
bool isEnabled () const
 returns whether the item is enabled or not More...
 
bool isChecked () const
 returns whether the item is checked or not More...
 
bool isTitle () const
 returns whether the item is a title item or not More...
 
bool isSeparator () const
 returns whether the item is a separator or not More...
 
const UTF8StringgetTitle () const
 returns the title of the item More...
 
int32_t getKeyModifiers () const
 returns the key modifiers of the item More...
 
const UTF8StringgetKeycode () const
 returns the keycode of the item More...
 
int32_t getVirtualKeyCode () const
 returns the virtual keycode of the item More...
 
COptionMenugetSubmenu () const
 returns the submenu of the item More...
 
CBitmapgetIcon () const
 returns the icon of the item More...
 
int32_t getTag () const
 returns the tag of the item More...
 
- Public Member Functions inherited from CBaseObject
 CBaseObject ()=default
 
 ~CBaseObject () noexcept override=default
 
 CBaseObject (const CBaseObject &o)
 
CBaseObjectoperator= (const CBaseObject &obj)
 
virtual CMessageResult notify (CBaseObject *sender, IdStringPtr message)
 
- Public Member Functions inherited from ReferenceCounted< T >
 ReferenceCounted ()=default
 
virtual ~ReferenceCounted () noexcept=default
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
void forget () override
 decrease refcount and delete object if refcount == 0 More...
 
void remember () override
 increase refcount More...
 
virtual int32_t getNbReference () const
 get refcount More...
 
virtual void beforeDelete ()
 

Protected Member Functions

 ~CMenuItem () noexcept override=default
 

Protected Attributes

UTF8String title
 
UTF8String keyCode
 
SharedPointer< COptionMenusubmenu
 
SharedPointer< CBitmapicon
 
int32_t flags {0}
 
int32_t keyModifiers {0}
 
int32_t virtualKeyCode {0}
 
int32_t tag {-1}
 

Detailed Description

a menu item

Defines an item of a VSTGUI::COptionMenu

Member Enumeration Documentation

◆ Flags

enum Flags
Enumerator
kNoFlags 
kDisabled 

item is gray and not selectable

kTitle 

item indicates a title and is not selectable

kChecked 

item has a checkmark

kSeparator 

item is a separator

Constructor & Destructor Documentation

◆ CMenuItem() [1/4]

CMenuItem ( const UTF8String inTitle,
const UTF8String inKeycode = "",
int32_t  inKeyModifiers = 0,
CBitmap inIcon = nullptr,
int32_t  inFlags = kNoFlags 
)

CMenuItem constructor.

Parameters
inTitletitle of item
inFlagsCMenuItem::Flags of item
inKeycodekeycode of item
inKeyModifierskeymodifiers of item
inIconicon of item

◆ CMenuItem() [2/4]

CMenuItem ( const UTF8String inTitle,
COptionMenu inSubmenu,
CBitmap inIcon = nullptr 
)

CMenuItem constructor.

Parameters
inTitletitle of item
inSubmenusubmenu of item
inIconicon of item

◆ CMenuItem() [3/4]

CMenuItem ( const UTF8String inTitle,
int32_t  inTag 
)

CMenuItem constructor.

Parameters
inTitletitle of item
inTagtag of item

◆ CMenuItem() [4/4]

CMenuItem ( const CMenuItem item)

CMenuItem copy constructor.

Parameters
itemitem to copy

◆ ~CMenuItem()

~CMenuItem ( )
overrideprotecteddefaultnoexcept

Member Function Documentation

◆ getIcon()

CBitmap* getIcon ( ) const
inline

returns the icon of the item

◆ getKeycode()

const UTF8String& getKeycode ( ) const
inline

returns the keycode of the item

◆ getKeyModifiers()

int32_t getKeyModifiers ( ) const
inline

returns the key modifiers of the item

◆ getSubmenu()

COptionMenu* getSubmenu ( ) const
inline

returns the submenu of the item

◆ getTag()

int32_t getTag ( ) const
inline

returns the tag of the item

◆ getTitle()

const UTF8String& getTitle ( ) const
inline

returns the title of the item

◆ getVirtualKeyCode()

int32_t getVirtualKeyCode ( ) const
inline

returns the virtual keycode of the item

◆ isChecked()

bool isChecked ( ) const
inline

returns whether the item is checked or not

◆ isEnabled()

bool isEnabled ( ) const
inline

returns whether the item is enabled or not

◆ isSeparator()

bool isSeparator ( ) const
inline

returns whether the item is a separator or not

◆ isTitle()

bool isTitle ( ) const
inline

returns whether the item is a title item or not

◆ setChecked()

void setChecked ( bool  state = true)
virtual

set menu item checked state

◆ setEnabled()

void setEnabled ( bool  state = true)
virtual

set menu item enabled state

◆ setIcon()

void setIcon ( CBitmap icon)
virtual

set menu item icon

◆ setIsSeparator()

void setIsSeparator ( bool  state = true)
virtual

set menu item separator state

◆ setIsTitle()

void setIsTitle ( bool  state = true)
virtual

set menu item title state

◆ setKey()

void setKey ( const UTF8String keyCode,
int32_t  keyModifiers = 0 
)
virtual

set keycode and key modifiers of menu item

◆ setSubmenu()

void setSubmenu ( COptionMenu submenu)
virtual

set submenu of menu item

◆ setTag()

void setTag ( int32_t  tag)
virtual

set menu item tag

◆ setTitle()

void setTitle ( const UTF8String title)
virtual

set title of menu item

◆ setVirtualKey()

void setVirtualKey ( int32_t  virtualKeyCode,
int32_t  keyModifiers = 0 
)
virtual

set virtual keycode and key modifiers of menu item

Member Data Documentation

◆ flags

int32_t flags {0}
protected

◆ icon

SharedPointer<CBitmap> icon
protected

◆ keyCode

UTF8String keyCode
protected

◆ keyModifiers

int32_t keyModifiers {0}
protected

◆ submenu

SharedPointer<COptionMenu> submenu
protected

◆ tag

int32_t tag {-1}
protected

◆ title

UTF8String title
protected

◆ virtualKeyCode

int32_t virtualKeyCode {0}
protected

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