JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
juce::ModalComponentManager Class Reference

Manages the system's stack of modal components. More...

#include "juce_ModalComponentManager.h"

Inheritance diagram for juce::ModalComponentManager:
juce::AsyncUpdater juce::DeletedAtShutdown

Classes

class  Callback
 Receives callbacks when a modal component is dismissed. More...
 
struct  ModalItem
 

Public Member Functions

int getNumModalComponents () const
 Returns the number of components currently being shown modally.
 
ComponentgetModalComponent (int index) const
 Returns one of the components being shown modally.
 
bool isModal (const Component *component) const
 Returns true if the specified component is in a modal state.
 
bool isFrontModalComponent (const Component *component) const
 Returns true if the specified component is currently the topmost modal component.
 
void attachCallback (Component *component, Callback *callback)
 Adds a new callback that will be called when the specified modal component is dismissed.
 
void bringModalComponentsToFront (bool topOneShouldGrabFocus=true)
 Brings any modal components to the front.
 
bool cancelAllModalComponents ()
 Calls exitModalState (0) on any components that are currently modal.
 

Protected Member Functions

 ModalComponentManager ()
 Creates a ModalComponentManager.
 
 ~ModalComponentManager () override
 Destructor.
 
void handleAsyncUpdate () override
 Called back to do whatever your class needs to do.
 

Friends

class Component
 

Detailed Description

Manages the system's stack of modal components.

Normally you'll just use the Component methods to invoke modal states in components, and won't have to deal with this class directly, but this is the singleton object that's used internally to manage the stack.

See also
Component::enterModalState, Component::exitModalState, Component::isCurrentlyModal, Component::getCurrentlyModalComponent, Component::isCurrentlyBlockedByAnotherModalComponent

@tags{GUI}

Definition at line 42 of file juce_ModalComponentManager.h.

Constructor & Destructor Documentation

◆ ModalComponentManager()

juce::ModalComponentManager::ModalComponentManager ( )
protected

Creates a ModalComponentManager.

You shouldn't ever call the constructor - it's a singleton, so use ModalComponentManager::getInstance()

Definition at line 92 of file juce_ModalComponentManager.cpp.

◆ ~ModalComponentManager()

juce::ModalComponentManager::~ModalComponentManager ( )
overrideprotected

Destructor.

Definition at line 96 of file juce_ModalComponentManager.cpp.

Member Function Documentation

◆ attachCallback()

void juce::ModalComponentManager::attachCallback ( Component component,
Callback callback 
)

Adds a new callback that will be called when the specified modal component is dismissed.

If the component is modal, then when it is dismissed, either by being hidden, or by calling Component::exitModalState(), then the Callback::modalStateFinished() method will be called.

Each component can have any number of callbacks associated with it, and this one is added to that list.

The object that is passed in will be deleted by the manager when it's no longer needed. If the given component is not currently modal, the callback object is deleted immediately and no action is taken.

Definition at line 115 of file juce_ModalComponentManager.cpp.

◆ bringModalComponentsToFront()

void juce::ModalComponentManager::bringModalComponentsToFront ( bool  topOneShouldGrabFocus = true)

Brings any modal components to the front.

Definition at line 222 of file juce_ModalComponentManager.cpp.

◆ cancelAllModalComponents()

bool juce::ModalComponentManager::cancelAllModalComponents ( )

Calls exitModalState (0) on any components that are currently modal.

Returns
true if any components were modal; false if nothing needed cancelling

Definition at line 255 of file juce_ModalComponentManager.cpp.

◆ getModalComponent()

Component * juce::ModalComponentManager::getModalComponent ( int  index) const

Returns one of the components being shown modally.

An index of 0 is the most recently-shown, topmost component.

Definition at line 171 of file juce_ModalComponentManager.cpp.

◆ getNumModalComponents()

int juce::ModalComponentManager::getNumModalComponents ( ) const

Returns the number of components currently being shown modally.

See also
getModalComponent

Definition at line 160 of file juce_ModalComponentManager.cpp.

◆ handleAsyncUpdate()

void juce::ModalComponentManager::handleAsyncUpdate ( )
overrideprotectedvirtual

Called back to do whatever your class needs to do.

This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.

Implements juce::AsyncUpdater.

Definition at line 201 of file juce_ModalComponentManager.cpp.

◆ isFrontModalComponent()

bool juce::ModalComponentManager::isFrontModalComponent ( const Component component) const

Returns true if the specified component is currently the topmost modal component.

Definition at line 196 of file juce_ModalComponentManager.cpp.

◆ isModal()

bool juce::ModalComponentManager::isModal ( const Component component) const

Returns true if the specified component is in a modal state.

Definition at line 187 of file juce_ModalComponentManager.cpp.

Friends And Related Symbol Documentation

◆ Component

friend class Component
friend

Definition at line 143 of file juce_ModalComponentManager.h.


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