JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::PopupMenu::Options Class Reference

Class used to create a set of options to pass to the show() method. More...

#include <juce_PopupMenu.h>

Collaboration diagram for juce::PopupMenu::Options:

Public Types

enum  PopupDirection {
  PopupDirection::upwards,
  PopupDirection::downwards
}
 

Public Member Functions

 Options ()
 
 Options (const Options &)=default
 
int getItemThatMustBeVisible () const noexcept
 
int getMaximumNumColumns () const noexcept
 
int getMinimumNumColumns () const noexcept
 
int getMinimumWidth () const noexcept
 
ComponentgetParentComponent () const noexcept
 
PopupDirection getPreferredPopupDirection () const noexcept
 
int getStandardItemHeight () const noexcept
 
ComponentgetTargetComponent () const noexcept
 
Rectangle< intgetTargetScreenArea () const noexcept
 
Optionsoperator= (const Options &)=default
 
Options withItemThatMustBeVisible (int idOfItemToBeVisible) const noexcept
 
Options withMaximumNumColumns (int maxNumColumns) const noexcept
 
Options withMinimumNumColumns (int minNumColumns) const noexcept
 
Options withMinimumWidth (int minWidth) const noexcept
 
Options withParentComponent (Component *parentComponent) const noexcept
 
Options withPreferredPopupDirection (PopupDirection direction) const noexcept
 
Options withStandardItemHeight (int standardHeight) const noexcept
 
Options withTargetComponent (Component *targetComponent) const noexcept
 
Options withTargetScreenArea (Rectangle< int > targetArea) const noexcept
 

Private Attributes

int maxColumns = 0
 
int minColumns = 1
 
int minWidth = 0
 
ComponentparentComponent = nullptr
 
PopupDirection preferredPopupDirection = PopupDirection::downwards
 
int standardHeight = 0
 
Rectangle< inttargetArea
 
ComponenttargetComponent = nullptr
 
int visibleItemID = 0
 

Detailed Description

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.

PopupMenu menu;
...
menu.showMenu (PopupMenu::Options().withMinimumWidth (100)
.withTargetComponent (myComp));

Member Enumeration Documentation

◆ PopupDirection

Enumerator
upwards 
downwards 

Constructor & Destructor Documentation

◆ Options() [1/2]

juce::PopupMenu::Options::Options ( )

◆ Options() [2/2]

juce::PopupMenu::Options::Options ( const Options )
default

Member Function Documentation

◆ getItemThatMustBeVisible()

int juce::PopupMenu::Options::getItemThatMustBeVisible ( ) const
inlinenoexcept

◆ getMaximumNumColumns()

int juce::PopupMenu::Options::getMaximumNumColumns ( ) const
inlinenoexcept

◆ getMinimumNumColumns()

int juce::PopupMenu::Options::getMinimumNumColumns ( ) const
inlinenoexcept

◆ getMinimumWidth()

int juce::PopupMenu::Options::getMinimumWidth ( ) const
inlinenoexcept

◆ getParentComponent()

Component* juce::PopupMenu::Options::getParentComponent ( ) const
inlinenoexcept

◆ getPreferredPopupDirection()

PopupDirection juce::PopupMenu::Options::getPreferredPopupDirection ( ) const
inlinenoexcept

◆ getStandardItemHeight()

int juce::PopupMenu::Options::getStandardItemHeight ( ) const
inlinenoexcept

◆ getTargetComponent()

Component* juce::PopupMenu::Options::getTargetComponent ( ) const
inlinenoexcept

◆ getTargetScreenArea()

Rectangle<int> juce::PopupMenu::Options::getTargetScreenArea ( ) const
inlinenoexcept

◆ operator=()

Options& juce::PopupMenu::Options::operator= ( const Options )
default

◆ withItemThatMustBeVisible()

Options juce::PopupMenu::Options::withItemThatMustBeVisible ( int  idOfItemToBeVisible) const
noexcept

◆ withMaximumNumColumns()

Options juce::PopupMenu::Options::withMaximumNumColumns ( int  maxNumColumns) const
noexcept

◆ withMinimumNumColumns()

Options juce::PopupMenu::Options::withMinimumNumColumns ( int  minNumColumns) const
noexcept

◆ withMinimumWidth()

Options juce::PopupMenu::Options::withMinimumWidth ( int  minWidth) const
noexcept

◆ withParentComponent()

Options juce::PopupMenu::Options::withParentComponent ( Component parentComponent) const
noexcept

◆ withPreferredPopupDirection()

Options juce::PopupMenu::Options::withPreferredPopupDirection ( PopupDirection  direction) const
noexcept

◆ withStandardItemHeight()

Options juce::PopupMenu::Options::withStandardItemHeight ( int  standardHeight) const
noexcept

◆ withTargetComponent()

Options juce::PopupMenu::Options::withTargetComponent ( Component targetComponent) const
noexcept

◆ withTargetScreenArea()

Options juce::PopupMenu::Options::withTargetScreenArea ( Rectangle< int targetArea) const
noexcept

Member Data Documentation

◆ 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

Component* juce::PopupMenu::Options::parentComponent = nullptr
private

◆ preferredPopupDirection

PopupDirection juce::PopupMenu::Options::preferredPopupDirection = PopupDirection::downwards
private

◆ standardHeight

int juce::PopupMenu::Options::standardHeight = 0
private

◆ targetArea

Rectangle<int> juce::PopupMenu::Options::targetArea
private

◆ targetComponent

Component* juce::PopupMenu::Options::targetComponent = nullptr
private

◆ visibleItemID

int juce::PopupMenu::Options::visibleItemID = 0
private

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