#include <juce_gui_basics.h>
A class for controlling MenuBar components.
This class is used to tell a MenuBar what menus to show, and to respond to a menu being selected.
- See Also
- MenuBarModel::Listener, MenuBarComponent, PopupMenu
MenuBarModel::MenuBarModel |
( |
| ) |
|
|
noexcept |
MenuBarModel::~MenuBarModel |
( |
| ) |
|
|
virtual |
void MenuBarModel::addListener |
( |
Listener * |
listenerToAdd | ) |
|
|
noexcept |
Registers a listener for callbacks when the menu items in this model change.
The listener object will get callbacks when this object's menuItemsChanged() method is called.
- See Also
- removeListener
void MenuBarModel::applicationCommandListChanged |
( |
| ) |
|
|
overridevirtual |
virtual StringArray juce::MenuBarModel::getMenuBarNames |
( |
| ) |
|
|
pure virtual |
This method must return a list of the names of the menus.
This should return the popup menu to display for a given top-level menu.
- Parameters
-
topLevelMenuIndex | the index of the top-level menu to show |
menuName | the name of the top-level menu item to show |
void MenuBarModel::handleAsyncUpdate |
( |
| ) |
|
|
overridevirtual |
Called back to do whatever your class needs to do.
This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.
Implements juce::AsyncUpdater.
void MenuBarModel::menuItemsChanged |
( |
| ) |
|
virtual void juce::MenuBarModel::menuItemSelected |
( |
int |
menuItemID, |
|
|
int |
topLevelMenuIndex |
|
) |
| |
|
pure virtual |
This is called when a menu item has been clicked on.
- Parameters
-
menuItemID | the item ID of the PopupMenu item that was selected |
topLevelMenuIndex | the index of the top-level menu from which the item was chosen (just in case you've used duplicate ID numbers on more than one of the popup menus) |
void MenuBarModel::removeListener |
( |
Listener * |
listenerToRemove | ) |
|
|
noexcept |
Tells the menu bar to listen to the specified command manager, and to update itself when the commands change.
This will also allow it to flash a menu name when a command from that menu is invoked using a keystroke.
The documentation for this class was generated from the following files: