#include <juce_PopupMenu.h>
Class used to create a set of options to pass to the show() method. You can chain together a series of calls to this class's methods to create a set of whatever options you want to specify. E.g.
◆ PopupDirection
| enum class juce::PopupMenu::Options::PopupDirection |
|
strong |
| Enumerator |
|---|
| upwards | |
| downwards | |
◆ Options() [1/2]
| juce::PopupMenu::Options::Options |
( |
| ) |
|
By default, the target screen area will be the current mouse position.
◆ Options() [2/2]
| juce::PopupMenu::Options::Options |
( |
const Options & | | ) |
|
|
default |
◆ getInitiallySelectedItemId()
| int juce::PopupMenu::Options::getInitiallySelectedItemId |
( |
| ) |
const |
|
inlinenoexcept |
Gets the ID of the item that must be selected when the menu is initially shown.
- See also
- withItemThatMustBeVisible
◆ getItemThatMustBeVisible()
| int juce::PopupMenu::Options::getItemThatMustBeVisible |
( |
| ) |
const |
|
inlinenoexcept |
Gets the ID of the item that must be visible when the menu is initially shown.
- See also
- withItemThatMustBeVisible
◆ getMaximumNumColumns()
| int juce::PopupMenu::Options::getMaximumNumColumns |
( |
| ) |
const |
|
inlinenoexcept |
Gets the maximum number of columns.
- See also
- withMaximumNumColumns
◆ getMinimumNumColumns()
| int juce::PopupMenu::Options::getMinimumNumColumns |
( |
| ) |
const |
|
inlinenoexcept |
Gets the minimum number of columns.
- See also
- withMinimumNumColumns
◆ getMinimumWidth()
| int juce::PopupMenu::Options::getMinimumWidth |
( |
| ) |
const |
|
inlinenoexcept |
Gets the minimum width.
- See also
- withMinimumWidth
◆ getParentComponent()
| Component * juce::PopupMenu::Options::getParentComponent |
( |
| ) |
const |
|
inlinenoexcept |
Gets the parent component. This may be nullptr if the Component has been deleted.
- See also
- withParentComponent
◆ getPreferredPopupDirection()
| PopupDirection juce::PopupMenu::Options::getPreferredPopupDirection |
( |
| ) |
const |
|
inlinenoexcept |
Gets the preferred popup menu direction.
- See also
- withPreferredPopupDirection
◆ getStandardItemHeight()
| int juce::PopupMenu::Options::getStandardItemHeight |
( |
| ) |
const |
|
inlinenoexcept |
Gets the default height of items in the menu.
- See also
- withStandardItemHeight
◆ getTargetComponent()
| Component * juce::PopupMenu::Options::getTargetComponent |
( |
| ) |
const |
|
inlinenoexcept |
Gets the target component. This may be nullptr if the Component has been deleted.
- See also
- withTargetComponent
◆ getTargetScreenArea()
| Rectangle< int > juce::PopupMenu::Options::getTargetScreenArea |
( |
| ) |
const |
|
inlinenoexcept |
Gets the target screen area.
- See also
- withTargetScreenArea
◆ hasWatchedComponentBeenDeleted()
| bool juce::PopupMenu::Options::hasWatchedComponentBeenDeleted |
( |
| ) |
const |
|
inlinenoexcept |
Returns true if the menu was watching a component, and that component has been deleted, and false otherwise.
- See also
- withDeletionCheck
◆ operator=()
◆ withDeletionCheck()
If the passed component has been deleted when the popup menu exits, the selected item's action will not be called.
This is useful for avoiding dangling references inside the action callback, in the case that the callback needs to access a component that may be deleted.
◆ withInitiallySelectedItem()
Sets an item to select in the menu.
This is useful for controls such as combo boxes, where opening the combo box with the keyboard should ideally highlight the currently-selected item, allowing the next/previous item to be selected by pressing up/down on the keyboard, rather than needing to move the highlighted row down from the top of the menu each time it is opened.
◆ withItemThatMustBeVisible()
Sets an item which must be visible when the menu is initially drawn.
This is useful to ensure that a particular item is shown when the menu contains too many items to display on a single screen.
◆ withMaximumNumColumns()
Sets the maximum number of columns in the popup window.
◆ withMinimumNumColumns()
Sets the minimum number of columns in the popup window.
◆ withMinimumWidth()
Sets the minimum width of the popup window.
◆ withMousePosition()
Sets the target screen area to match the current mouse position.
Make sure to call this after withTargetComponent().
- See also
- withTargetScreenArea
◆ withParentComponent()
Sets a component that the popup menu will be drawn into.
Some plugin formats, such as AUv3, dislike it when the plugin editor spawns additional windows. Some AUv3 hosts display pink backgrounds underneath transparent popup windows, which is confusing and can appear as though the plugin is malfunctioning. Setting a parent component will avoid this unwanted behaviour, but with the downside that the menu size will be constrained by the size of the parent component.
◆ withPreferredPopupDirection()
Sets the direction of the popup menu relative to the target screen area.
◆ withStandardItemHeight()
Sets the default height of each item in the popup menu.
◆ withTargetComponent() [1/2]
◆ withTargetComponent() [2/2]
Sets the target component to use when displaying the menu.
This is normally the button or other control that triggered the menu.
The target component is primarily used to control the scale of the menu, so it's important to supply a target component if you'll be using your program on hi-DPI displays.
This function will also set the target screen area, so that the menu displays next to the target component. If you need to display the menu at a specific location, you should call withTargetScreenArea() after withTargetComponent.
- See also
- withTargetComponent, withTargetScreenArea
◆ withTargetScreenArea()
Sets the region of the screen next to which the menu should be displayed.
To display the menu next to the mouse cursor use withMousePosition(), which is equivalent to passing the following to this function:
static Point< int > getMousePosition()
Definition juce_Desktop.cpp:153
Definition juce_Rectangle.h:67
JUCE_NODISCARD Rectangle withPosition(ValueType newX, ValueType newY) const noexcept
Definition juce_Rectangle.h:232
withTargetComponent() will also set the target screen area. If you need a target component and a target screen area, make sure to call withTargetScreenArea() after withTargetComponent().
- See also
- withMousePosition
◆ componentToWatchForDeletion
◆ initiallySelectedItemId
| int juce::PopupMenu::Options::initiallySelectedItemId = 0 |
|
private |
◆ isWatchingForDeletion
| bool juce::PopupMenu::Options::isWatchingForDeletion = false |
|
private |
◆ maxColumns
| int juce::PopupMenu::Options::maxColumns = 0 |
|
private |
◆ minColumns
| int juce::PopupMenu::Options::minColumns = 1 |
|
private |
◆ minWidth
| int juce::PopupMenu::Options::minWidth = 0 |
|
private |
◆ parentComponent
◆ preferredPopupDirection
◆ standardHeight
| int juce::PopupMenu::Options::standardHeight = 0 |
|
private |
◆ targetArea
◆ targetComponent
◆ visibleItemID
| int juce::PopupMenu::Options::visibleItemID = 0 |
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_gui_basics/menus/juce_PopupMenu.h
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_gui_basics/menus/juce_PopupMenu.cpp