CMenuItem Class Reference

a menu item More...

Inheritance diagram for CMenuItem:
Inheritance graph
[legend]
Collaboration diagram for CMenuItem:
Collaboration graph
[legend]

List of all members.

Public Types

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

Public Member Functions

 CMenuItem (UTF8StringPtr title, UTF8StringPtr keycode=0, int32_t keyModifiers=0, CBitmap *icon=0, int32_t flags=kNoFlags)
 CMenuItem (UTF8StringPtr title, COptionMenu *submenu, CBitmap *icon=0)
 CMenuItem (UTF8StringPtr title, int32_t tag)
 CMenuItem (const CMenuItem &item)
CMenuItem Methods



virtual void setTitle (UTF8StringPtr title)
 set title of menu item
virtual void setSubmenu (COptionMenu *submenu)
 set submenu of menu item
virtual void setKey (UTF8StringPtr keyCode, int32_t keyModifiers=0)
 set keycode and key modifiers of menu item
virtual void setEnabled (bool state=true)
 set menu item enabled state
virtual void setChecked (bool state=true)
 set menu item checked state
virtual void setIsTitle (bool state=true)
 set menu item title state
virtual void setIsSeparator (bool state=true)
 set menu item separator state
virtual void setIcon (CBitmap *icon)
 set menu item icon
virtual void setTag (int32_t tag)
 set menu item tag
bool isEnabled () const
 returns whether the item is enabled or not
bool isChecked () const
 returns whether the item is checked or not
bool isTitle () const
 returns whether the item is a title item or not
bool isSeparator () const
 returns whether the item is a separator or not
UTF8StringPtr getTitle () const
 returns the title of the item
int32_t getKeyModifiers () const
 returns the key modifiers of the item
UTF8StringPtr getKeycode () const
 returns the keycode of the item
COptionMenugetSubmenu () const
 returns the submenu of the item
CBitmapgetIcon () const
 returns the icon of the item
int32_t getTag () const
 returns the tag of the item
Reference Counting Methods



virtual void forget ()
 decrease refcount and delete object if refcount == 0
virtual void remember ()
 increase refcount
virtual int32_t getNbReference () const
 get refcount
Message Methods



virtual CMessageResult notify (CBaseObject *sender, IdStringPtr message)

Protected Member Functions

 ~CMenuItem ()

Protected Attributes

UTF8StringBuffer title
UTF8StringBuffer keycode
COptionMenusubmenu
CBitmapicon
int32_t flags
int32_t keyModifiers
int32_t tag

Detailed Description

a menu item

Defines an item of a VSTGUI::COptionMenu


Member Enumeration Documentation

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 ( UTF8StringPtr  inTitle,
UTF8StringPtr  inKeycode = 0,
int32_t  inKeyModifiers = 0,
CBitmap inIcon = 0,
int32_t  inFlags = kNoFlags 
)

CMenuItem constructor.

Parameters:
inTitle title of item
inFlags CMenuItem::Flags of item
inKeycode keycode of item
inKeyModifiers keymodifiers of item
inIcon icon of item
CMenuItem ( UTF8StringPtr  inTitle,
COptionMenu inSubmenu,
CBitmap inIcon = 0 
)

CMenuItem constructor.

Parameters:
inTitle title of item
inSubmenu submenu of item
inIcon icon of item
CMenuItem ( UTF8StringPtr  inTitle,
int32_t  inTag 
)

CMenuItem constructor.

Parameters:
inTitle title of item
inTag tag of item
CMenuItem ( const CMenuItem item  ) 

CMenuItem copy constructor.

Parameters:
item item to copy
~CMenuItem (  )  [protected]

Member Function Documentation

virtual void forget (  )  [inline, virtual, inherited]

decrease refcount and delete object if refcount == 0

CBitmap* getIcon (  )  const [inline]

returns the icon of the item

UTF8StringPtr getKeycode (  )  const [inline]

returns the keycode of the item

int32_t getKeyModifiers (  )  const [inline]

returns the key modifiers of the item

virtual int32_t getNbReference (  )  const [inline, virtual, inherited]

get refcount

COptionMenu* getSubmenu (  )  const [inline]

returns the submenu of the item

int32_t getTag (  )  const [inline]

returns the tag of the item

UTF8StringPtr getTitle (  )  const [inline]

returns the title of the item

bool isChecked (  )  const [inline]

returns whether the item is checked or not

bool isEnabled (  )  const [inline]

returns whether the item is enabled or not

bool isSeparator (  )  const [inline]

returns whether the item is a separator or not

bool isTitle (  )  const [inline]

returns whether the item is a title item or not

virtual CMessageResult notify ( CBaseObject sender,
IdStringPtr  message 
) [inline, virtual, inherited]
virtual void remember (  )  [inline, virtual, inherited]

increase refcount

void setChecked ( bool  state = true  )  [virtual]

set menu item checked state

void setEnabled ( bool  state = true  )  [virtual]

set menu item enabled state

void setIcon ( CBitmap icon  )  [virtual]

set menu item icon

void setIsSeparator ( bool  state = true  )  [virtual]

set menu item separator state

void setIsTitle ( bool  state = true  )  [virtual]

set menu item title state

void setKey ( UTF8StringPtr  keyCode,
int32_t  keyModifiers = 0 
) [virtual]

set keycode and key modifiers of menu item

void setSubmenu ( COptionMenu submenu  )  [virtual]

set submenu of menu item

void setTag ( int32_t  tag  )  [virtual]

set menu item tag

void setTitle ( UTF8StringPtr  title  )  [virtual]

set title of menu item


Member Data Documentation

int32_t flags [protected]
CBitmap* icon [protected]
int32_t keyModifiers [protected]
COptionMenu* submenu [protected]
int32_t tag [protected]
UTF8StringBuffer title [protected]

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

Generated on Fri Nov 22 11:09:43 2013 for VSTGUI by  doxygen 1.6.1