A menu bar component. More...
Inherits Component, MenuBarModel::Listener, and Timer.
Public Member Functions | |
| MenuBarComponent (MenuBarModel *model) | |
| Creates a menu bar. | |
| ~MenuBarComponent () | |
| Destructor. | |
| void | setModel (MenuBarModel *newModel) |
| Changes the model object to use to control the bar. | |
| MenuBarModel * | getModel () const noexcept |
| Returns the current menu bar model being used. | |
| void | showMenu (int menuIndex) |
| Pops up one of the menu items. | |
| void | paint (Graphics &g) |
| void | resized () |
| void | mouseEnter (const MouseEvent &e) |
| void | mouseExit (const MouseEvent &e) |
| void | mouseDown (const MouseEvent &e) |
| void | mouseDrag (const MouseEvent &e) |
| void | mouseUp (const MouseEvent &e) |
| void | mouseMove (const MouseEvent &e) |
| void | handleCommandMessage (int commandId) |
| bool | keyPressed (const KeyPress &key) |
| void | menuBarItemsChanged (MenuBarModel *menuBarModel) |
| void | menuCommandInvoked (MenuBarModel *menuBarModel, const ApplicationCommandTarget::InvocationInfo &info) |
A menu bar component.
| MenuBarComponent::MenuBarComponent | ( | MenuBarModel * | model | ) |
Creates a menu bar.
| model | the model object to use to control this bar. You can pass 0 into this if you like, and set the model later using the setModel() method |
Destructor.
| void MenuBarComponent::setModel | ( | MenuBarModel * | newModel | ) |
Changes the model object to use to control the bar.
This can be a null pointer, in which case the bar will be empty. Don't delete the object that is passed-in while it's still being used by this MenuBar.
| MenuBarModel* MenuBarComponent::getModel | ( | ) | const |
Returns the current menu bar model being used.
| void MenuBarComponent::showMenu | ( | int | menuIndex | ) |
Pops up one of the menu items.
This lets you manually open one of the menus - it could be triggered by a key shortcut, for example.
| void MenuBarComponent::paint | ( | Graphics & | g | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::resized | ( | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::mouseEnter | ( | const MouseEvent & | e | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::mouseExit | ( | const MouseEvent & | e | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::mouseDown | ( | const MouseEvent & | e | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::mouseDrag | ( | const MouseEvent & | e | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::mouseUp | ( | const MouseEvent & | e | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::mouseMove | ( | const MouseEvent & | e | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::handleCommandMessage | ( | int | commandId | ) | [virtual] |
Reimplemented from Component.
| bool MenuBarComponent::keyPressed | ( | const KeyPress & | key | ) | [virtual] |
Reimplemented from Component.
| void MenuBarComponent::menuBarItemsChanged | ( | MenuBarModel * | menuBarModel | ) | [virtual] |
Implements MenuBarModel::Listener.
| void MenuBarComponent::menuCommandInvoked | ( | MenuBarModel * | menuBarModel, |
| const ApplicationCommandTarget::InvocationInfo & | info | ||
| ) | [virtual] |
Implements MenuBarModel::Listener.