JUCE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Public Member Functions | Protected Member Functions | List of all members
ModalComponentManager Class Reference

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

Inherits AsyncUpdater, and DeletedAtShutdown.

Classes

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

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 (Component *component) const
 Returns true if the specified component is in a modal state.
 
bool isFrontModalComponent (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.
 
 juce_DeclareSingleton_SingleThreaded_Minimal (ModalComponentManager)
 

Protected Member Functions

 ModalComponentManager ()
 Creates a ModalComponentManager.
 
 ~ModalComponentManager ()
 Destructor.
 
void handleAsyncUpdate () override
 

Additional Inherited Members

- Private Member Functions inherited from AsyncUpdater
 AsyncUpdater ()
 Creates an AsyncUpdater object.
 
virtual ~AsyncUpdater ()
 Destructor.
 
void triggerAsyncUpdate ()
 Causes the callback to be triggered at a later time.
 
void cancelPendingUpdate () noexcept
 This will stop any pending updates from happening.
 
void handleUpdateNowIfNeeded ()
 If an update has been triggered and is pending, this will invoke it synchronously.
 
bool isUpdatePending () const noexcept
 Returns true if there's an update callback in the pipeline.
 
- Static Private Member Functions inherited from DeletedAtShutdown
static void deleteAll ()
 Deletes all extant objects.
 

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

Constructor & Destructor Documentation

ModalComponentManager::ModalComponentManager ( )
protected

Creates a ModalComponentManager.

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

ModalComponentManager::~ModalComponentManager ( )
protected

Destructor.

Member Function Documentation

int ModalComponentManager::getNumModalComponents ( ) const

Returns the number of components currently being shown modally.

See Also
getModalComponent
Component* ModalComponentManager::getModalComponent ( int  index) const

Returns one of the components being shown modally.

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

bool ModalComponentManager::isModal ( Component component) const

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

bool ModalComponentManager::isFrontModalComponent ( Component component) const

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

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

void ModalComponentManager::bringModalComponentsToFront ( bool  topOneShouldGrabFocus = true)

Brings any modal components to the front.

ModalComponentManager::juce_DeclareSingleton_SingleThreaded_Minimal ( ModalComponentManager  )
void ModalComponentManager::handleAsyncUpdate ( )
overrideprotectedvirtual

Implements AsyncUpdater.


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