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

Describes a popup menu item. More...

#include <juce_PopupMenu.h>

Collaboration diagram for juce::PopupMenu::Item:

Public Member Functions

 Item () noexcept
 Creates a null item. More...
 
 Item (const Item &)
 Creates a copy of an item. More...
 
Itemoperator= (const Item &)
 Creates a copy of an item. More...
 

Public Attributes

Colour colour
 A colour to use to draw the menu text. More...
 
ApplicationCommandManagercommandManager = nullptr
 A command manager to use to automatically invoke the command, or nullptr if none is specified. More...
 
ReferenceCountedObjectPtr< CustomCallbackcustomCallback
 A custom callback for the item to use, or nullptr if there isn't one. More...
 
ReferenceCountedObjectPtr< CustomComponentcustomComponent
 A custom component for the item to display, or nullptr if there isn't one. More...
 
std::unique_ptr< Drawableimage
 A drawable to use as an icon, or nullptr if there isn't one. More...
 
bool isEnabled = true
 True if this menu item is enabled. More...
 
bool isSectionHeader = false
 True if this menu item is a section header. More...
 
bool isSeparator = false
 True if this menu item is a separator line. More...
 
bool isTicked = false
 True if this menu item should have a tick mark next to it. More...
 
int itemID = 0
 The menu item's ID. More...
 
String shortcutKeyDescription
 An optional string describing the shortcut key for this item. More...
 
std::unique_ptr< PopupMenusubMenu
 A sub-menu, or nullptr if there isn't one. More...
 
String text
 The menu item's name. More...
 

Detailed Description

Describes a popup menu item.

Constructor & Destructor Documentation

◆ Item() [1/2]

juce::PopupMenu::Item::Item ( )
noexcept

Creates a null item.

You'll need to set some fields after creating an Item before you can add it to a PopupMenu

◆ Item() [2/2]

juce::PopupMenu::Item::Item ( const Item )

Creates a copy of an item.

Member Function Documentation

◆ operator=()

Item& juce::PopupMenu::Item::operator= ( const Item )

Creates a copy of an item.

Member Data Documentation

◆ colour

Colour juce::PopupMenu::Item::colour

A colour to use to draw the menu text.

By default this is transparent black, which means that the LookAndFeel should choose the colour.

◆ commandManager

ApplicationCommandManager* juce::PopupMenu::Item::commandManager = nullptr

A command manager to use to automatically invoke the command, or nullptr if none is specified.

◆ customCallback

ReferenceCountedObjectPtr<CustomCallback> juce::PopupMenu::Item::customCallback

A custom callback for the item to use, or nullptr if there isn't one.

◆ customComponent

ReferenceCountedObjectPtr<CustomComponent> juce::PopupMenu::Item::customComponent

A custom component for the item to display, or nullptr if there isn't one.

◆ image

std::unique_ptr<Drawable> juce::PopupMenu::Item::image

A drawable to use as an icon, or nullptr if there isn't one.

◆ isEnabled

bool juce::PopupMenu::Item::isEnabled = true

True if this menu item is enabled.

◆ isSectionHeader

bool juce::PopupMenu::Item::isSectionHeader = false

True if this menu item is a section header.

◆ isSeparator

bool juce::PopupMenu::Item::isSeparator = false

True if this menu item is a separator line.

◆ isTicked

bool juce::PopupMenu::Item::isTicked = false

True if this menu item should have a tick mark next to it.

◆ itemID

int juce::PopupMenu::Item::itemID = 0

The menu item's ID.

This must not be 0 if you want the item to be triggerable!

◆ shortcutKeyDescription

String juce::PopupMenu::Item::shortcutKeyDescription

An optional string describing the shortcut key for this item.

This is only used for displaying at the right-hand edge of a menu item - the menu won't attempt to actually catch or process the key. If you supply a commandManager parameter then the menu will attempt to fill-in this field automatically.

◆ subMenu

std::unique_ptr<PopupMenu> juce::PopupMenu::Item::subMenu

A sub-menu, or nullptr if there isn't one.

◆ text

String juce::PopupMenu::Item::text

The menu item's name.


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