LMMS
Loading...
Searching...
No Matches
juce::PopupMenu::MenuItemIterator Class Reference

#include <juce_PopupMenu.h>

Public Member Functions

 MenuItemIterator (const PopupMenu &menu, bool searchRecursively=false)
 ~MenuItemIterator ()
bool next ()
ItemgetItem () const

Private Member Functions

MenuItemIteratoroperator= (const MenuItemIterator &)

Private Attributes

bool searchRecursively
Array< intindex
Array< const PopupMenu * > menus
PopupMenu::ItemcurrentItem = nullptr

Detailed Description

Allows you to iterate through the items in a pop-up menu, and examine their properties.

To use this, just create one and repeatedly call its next() method. When this returns true, all the member variables of the iterator are filled-out with information describing the menu item. When it returns false, the end of the list has been reached.

Constructor & Destructor Documentation

◆ MenuItemIterator()

juce::PopupMenu::MenuItemIterator::MenuItemIterator ( const PopupMenu & menu,
bool searchRecursively = false )

Creates an iterator that will scan through the items in the specified menu.

Be careful not to add any items to a menu while it is being iterated, or things could get out of step.

Parameters
menuthe menu that needs to be scanned
searchRecursivelyif true, all submenus will be recursed into to do an exhaustive search

◆ ~MenuItemIterator()

juce::PopupMenu::MenuItemIterator::~MenuItemIterator ( )
default

Destructor.

Member Function Documentation

◆ getItem()

PopupMenu::Item & juce::PopupMenu::MenuItemIterator::getItem ( ) const

Returns a reference to the description of the current item. It is only valid to call this after next() has returned true!

◆ next()

bool juce::PopupMenu::MenuItemIterator::next ( )

Returns true if there is another item, and sets up all this object's member variables to reflect that item's properties.

◆ operator=()

MenuItemIterator & juce::PopupMenu::MenuItemIterator::operator= ( const MenuItemIterator & )
private

Member Data Documentation

◆ currentItem

PopupMenu::Item* juce::PopupMenu::MenuItemIterator::currentItem = nullptr
private

◆ index

Array<int> juce::PopupMenu::MenuItemIterator::index
private

◆ menus

Array<const PopupMenu*> juce::PopupMenu::MenuItemIterator::menus
private

◆ searchRecursively

bool juce::PopupMenu::MenuItemIterator::searchRecursively
private

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