JUCE: PopupMenu::MenuItemIterator Class Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | List of all members
PopupMenu::MenuItemIterator Class Reference
juce_gui_basics » menus

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

`#include <juce_PopupMenu.h>`

## Public Member Functions
| MenuItemIterator (const PopupMenu &menu, bool searchRecursively=false)
| Creates an iterator that will scan through the items in the specified menu.
| ~MenuItemIterator ()
| Destructor.
bool | next ()
| Returns true if there is another item, and sets up all this object's member variables to reflect that item's properties.
Item & | getItem () const
| Returns a reference to the description of the current item.

## 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()

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

  menu | the menu that needs to be scanned
  searchRecursively | if true, all submenus will be recursed into to do an exhaustive search

## ◆ ~MenuItemIterator()

PopupMenu::MenuItemIterator::~MenuItemIterator | ( |  | ) |

Destructor.

## Member Function Documentation

## ◆ next()

bool 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.

## ◆ getItem()

Item & 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!

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

- juce_PopupMenu.h