VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Protected Attributes | List of all members
CCommandMenuItem Class Reference
Version 4.1

a command menu item More...

Inheritance diagram for CCommandMenuItem:

## Classes
struct | Desc

## Public Member Functions
| CCommandMenuItem (Desc &&args)
| CCommandMenuItem (const Desc &args)
| CCommandMenuItem (const CCommandMenuItem &item)
| ~CCommandMenuItem () noexceptoverride=default
void | execute ()
void | validate ()
Public Member Functions inherited from CMenuItem
| CMenuItem (const UTF8String &title, const UTF8String &keycode="", int32_t keyModifiers=0, CBitmap *icon=nullptr, int32_t flags=kNoFlags)
| CMenuItem constructor.
| CMenuItem (const UTF8String &title, COptionMenu *submenu, CBitmap *icon=nullptr)
| CMenuItem constructor.
| CMenuItem (const UTF8String &title, int32_t tag)
| CMenuItem constructor.
| CMenuItem (const CMenuItem &item)
| CMenuItem copy constructor.
int32_t | getVirtualKeyCode () const
virtual void | setVirtualKey (int32_t virtualKeyCode, int32_t keyModifiers=0)
virtual void | setTitle (const UTF8String &title)
| set title of menu item
virtual void | setSubmenu (COptionMenu *submenu)
| set submenu of menu item
virtual void | setKey (const UTF8String &keyCode, int32_t keyModifiers=0)
| set keycode and key modifiers of menu item
virtual void | setVirtualKey (VirtualKey virtualKey, int32_t keyModifiers=0)
| set virtual key 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
const UTF8String & | getTitle () const
| returns the title of the item
int32_t | getKeyModifiers () const
| returns the key modifiers of the item
const UTF8String & | getKeycode () const
| returns the keycode of the item
VirtualKey | getVirtualKey () const
| returns the virtual key of the item
COptionMenu * | getSubmenu () const
| returns the submenu of the item
CBitmap * | getIcon () const
| returns the icon of the item
int32_t | getTag () const
| returns the tag of the item
Public Member Functions inherited from CBaseObject
| CBaseObject ()=default
| ~CBaseObject () noexceptoverride=default
| CBaseObject (const CBaseObject &)
CBaseObject & | operator= (const CBaseObject &)
virtual CMessageResult | notify ([[maybe_unused]] CBaseObject *sender,[[maybe_unused]] IdStringPtr message)
Public Member Functions inherited from ReferenceCounted< T >
| ReferenceCounted ()=default
virtual | ~ReferenceCounted () noexcept=default
| ReferenceCounted (const ReferenceCounted &)
ReferenceCounted & | operator= (const ReferenceCounted &)
void | forget () override
| decrease refcount and delete object if refcount == 0
void | remember () override
| increase refcount
virtual int32_t | getNbReference () const
| get refcount

## Protected Attributes
ValidateCallbackFunction | validateFunc
SelectedCallbackFunction | selectedFunc
UTF8String | commandCategory
UTF8String | commandName
SharedPointer < ICommandMenuItemTarget > | itemTarget
Protected Attributes inherited from CMenuItem
std::unique_ptr< Impl > | impl

## CCommandMenuItem Methods
using | ValidateCallbackFunction = std::function< void(CCommandMenuItem *item)>
using | SelectedCallbackFunction = std::function< void(CCommandMenuItem *item)>
void | setCommandCategory (const UTF8String &category)
const UTF8String & | getCommandCategory () const
bool | isCommandCategory (const UTF8String &category) const
void | setCommandName (const UTF8String &name)
const UTF8String & | getCommandName () const
bool | isCommandName (const UTF8String &name) const
void | setItemTarget (ICommandMenuItemTarget *target)
ICommandMenuItemTarget * | getItemTarget () const
void | setActions (SelectedCallbackFunction &&selected, ValidateCallbackFunction &&validate=[](CCommandMenuItem *){})

## Additional Inherited Members
Public Types inherited from CMenuItem
enum | Flags { kNoFlags = 0, kDisabled = 1 << 0, kTitle = 1 << 1, kChecked = 1 << 2, kSeparator = 1 << 3 }
Protected Member Functions inherited from CMenuItem
| CMenuItem ()
| ~CMenuItem () noexceptoverride

## Detailed Description

a command menu item

The CCommandMenuItem supports setting a category, name and a target. The target will get a notify() call before the item is displayed and after it was selected.

See Also
  CCommandMenuItem::kMsgMenuItemValidate and
  CCommandMenuItem::kMsgMenuItemSelected

## Member Typedef Documentation

using SelectedCallbackFunction = std::function<void(CCommandMenuItem* item)>

using ValidateCallbackFunction = std::function<void(CCommandMenuItem* item)>

## Constructor & Destructor Documentation

CCommandMenuItem | ( | Desc && | args | ) |

CCommandMenuItem | ( | const Desc & | args | ) |

CCommandMenuItem | ( | const CCommandMenuItem & | item | ) |

~CCommandMenuItem | ( |  | ) |
| override default noexcept

## Member Function Documentation

void execute | ( |  | ) |

const UTF8String& getCommandCategory | ( |  | ) | const
| inline

const UTF8String& getCommandName | ( |  | ) | const
| inline

ICommandMenuItemTarget* getItemTarget | ( |  | ) | const
| inline

bool isCommandCategory | ( | const UTF8String & | category | ) | const

bool isCommandName | ( | const UTF8String & | name | ) | const

void setActions | ( | SelectedCallbackFunction && | selected,
|  | ValidateCallbackFunction && | validate = `[](CCommandMenuItem*){}`
| ) |  |

void setCommandCategory | ( | const UTF8String & | category | ) |

void setCommandName | ( | const UTF8String & | name | ) |

void setItemTarget | ( | ICommandMenuItemTarget * | target | ) |

void validate | ( |  | ) |

## Member Data Documentation

UTF8String commandCategory
| protected

UTF8String commandName
| protected

SharedPointer<ICommandMenuItemTarget> itemTarget
| protected

SelectedCallbackFunction selectedFunc
| protected

ValidateCallbackFunction validateFunc
| protected

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

- coptionmenu.h
- coptionmenu.cpp