|
VSTGUI
4.7
Graphical User Interface Framework not only for VST plugins
|
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 | |
| CCommandMenuItem (const UTF8String &title, const UTF8String &keycode, int32_t keyModifiers=0, CBitmap *icon=nullptr, int32_t flags=kNoFlags, CBaseObject *target=nullptr, const UTF8String &commandCategory=nullptr, const UTF8String &commandName=nullptr) | |
| CCommandMenuItem (const UTF8String &title, COptionMenu *submenu, CBitmap *icon=nullptr, CBaseObject *target=nullptr, const UTF8String &commandCategory=nullptr, const UTF8String &commandName=nullptr) | |
| CCommandMenuItem (const UTF8String &title, int32_t tag, CBaseObject *target=nullptr, const UTF8String &commandCategory=nullptr, const UTF8String &commandName=nullptr) | |
| CCommandMenuItem (const UTF8String &title, CBaseObject *target, const UTF8String &commandCategory=nullptr, const UTF8String &commandName=nullptr) | |
| 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. 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... | |
| 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 UTF8String & | getTitle () const |
| returns the title of the item More... | |
| int32_t | getKeyModifiers () const |
| returns the key modifiers of the item More... | |
| const UTF8String & | getKeycode () const |
| returns the keycode of the item More... | |
| int32_t | getVirtualKeyCode () const |
| returns the virtual keycode of the item More... | |
| COptionMenu * | getSubmenu () const |
| returns the submenu of the item More... | |
| CBitmap * | getIcon () 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 () noexceptoverride=default | |
| CBaseObject (const CBaseObject &o) | |
| CBaseObject & | operator= (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 &) | |
| ReferenceCounted & | operator= (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 () |
Static Public Attributes | |
| static IdStringPtr | kMsgMenuItemValidate = "kMsgMenuItemValidate" |
| message send to the target before the item is shown More... | |
| static IdStringPtr | kMsgMenuItemSelected = "kMsgMenuItemSelected" |
| message send to the target when this item was selected More... | |
Protected Attributes | |
| ValidateCallbackFunction | validateFunc |
| SelectedCallbackFunction | selectedFunc |
| UTF8String | commandCategory |
| UTF8String | commandName |
| SharedPointer< CBaseObject > | target |
| SharedPointer < ICommandMenuItemTarget > | itemTarget |
Protected Attributes inherited from CMenuItem | |
| UTF8String | title |
| UTF8String | keyCode |
| SharedPointer< COptionMenu > | submenu |
| SharedPointer< CBitmap > | icon |
| int32_t | flags {0} |
| int32_t | keyModifiers {0} |
| int32_t | virtualKeyCode {0} |
| int32_t | tag {-1} |
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 | setTarget (CBaseObject *target) |
| CBaseObject * | getTarget () 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 () noexceptoverride=default | |
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.
| using SelectedCallbackFunction = std::function<void(CCommandMenuItem* item)> |
| using ValidateCallbackFunction = std::function<void(CCommandMenuItem* item)> |
| CCommandMenuItem | ( | Desc && | args | ) |
| CCommandMenuItem | ( | const Desc & | args | ) |
| CCommandMenuItem | ( | const CCommandMenuItem & | item | ) |
|
overridedefaultnoexcept |
| CCommandMenuItem | ( | const UTF8String & | title, |
| const UTF8String & | keycode, | ||
| int32_t | keyModifiers = 0, |
||
| CBitmap * | icon = nullptr, |
||
| int32_t | flags = kNoFlags, |
||
| CBaseObject * | target = nullptr, |
||
| const UTF8String & | commandCategory = nullptr, |
||
| const UTF8String & | commandName = nullptr |
||
| ) |
| CCommandMenuItem | ( | const UTF8String & | title, |
| COptionMenu * | submenu, | ||
| CBitmap * | icon = nullptr, |
||
| CBaseObject * | target = nullptr, |
||
| const UTF8String & | commandCategory = nullptr, |
||
| const UTF8String & | commandName = nullptr |
||
| ) |
| CCommandMenuItem | ( | const UTF8String & | title, |
| int32_t | tag, | ||
| CBaseObject * | target = nullptr, |
||
| const UTF8String & | commandCategory = nullptr, |
||
| const UTF8String & | commandName = nullptr |
||
| ) |
| CCommandMenuItem | ( | const UTF8String & | title, |
| CBaseObject * | target, | ||
| const UTF8String & | commandCategory = nullptr, |
||
| const UTF8String & | commandName = nullptr |
||
| ) |
| void execute | ( | ) |
|
inline |
|
inline |
|
inline |
|
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 setTarget | ( | CBaseObject * | target | ) |
| void validate | ( | ) |
|
protected |
|
protected |
|
protected |
|
static |
message send to the target when this item was selected
|
static |
message send to the target before the item is shown
|
protected |
|
protected |
|
protected |