86 int getNumModalComponents()
const;
91 Component* getModalComponent (
int index)
const;
94 bool isModal (
const Component* component)
const;
97 bool isFrontModalComponent (
const Component* component)
const;
115 void bringModalComponentsToFront (
bool topOneShouldGrabFocus =
true);
120 bool cancelAllModalComponents();
122 #if JUCE_MODAL_LOOPS_PERMITTED
126 int runEventLoopForCurrentComponent();
139 void handleAsyncUpdate()
override;
148 void startModal (
Component*,
bool autoDelete);
149 void endModal (
Component*,
int returnValue);
173 template <
typename CallbackFn>
178 explicit Callable (CallbackFn&& f) : fn (std::forward<CallbackFn> (f)) {}
179 void modalStateFinished (
int result)
override { NullCheckedInvocation::invoke (std::move (fn), result); }
184 return new Callable (std::forward<CallbackFn> (fn));
209 template <
typename ParamType>
211 ParamType parameterValue)
213 return create ([functionToCall, parameterValue] (
int r)
215 functionToCall (r, parameterValue);
241 template <
typename ParamType1,
typename ParamType2>
243 ParamType1 parameterValue1,
244 ParamType2 parameterValue2)
246 return create ([functionToCall, parameterValue1, parameterValue2] (
int r)
248 functionToCall (r, parameterValue1, parameterValue2);
275 template <
class ComponentType>
277 ComponentType* component)
281 functionToCall (r,
static_cast<ComponentType*
> (comp.get()));
308 template <
class ComponentType,
typename ParamType>
310 ComponentType* component,
315 functionToCall (r,
static_cast<ComponentType*
> (comp.get()), param);
Has a callback method that is triggered asynchronously.
The base class for all JUCE user-interface objects.
Classes derived from this will be automatically deleted when the application exits.
This class provides some handy utility methods for creating ModalComponentManager::Callback objects t...
static ModalComponentManager::Callback * forComponent(void(*functionToCall)(int, ComponentType *, ParamType), ComponentType *component, ParamType param)
Creates a ModalComponentManager::Callback that will call a static function with a component.
static ModalComponentManager::Callback * create(CallbackFn &&fn)
This is a utility function to create a ModalComponentManager::Callback that will call a callable obje...
static ModalComponentManager::Callback * forComponent(void(*functionToCall)(int, ComponentType *), ComponentType *component)
This is a utility function to create a ModalComponentManager::Callback that will call a static functi...
static ModalComponentManager::Callback * withParam(void(*functionToCall)(int, ParamType1, ParamType2), ParamType1 parameterValue1, ParamType2 parameterValue2)
This is a utility function to create a ModalComponentManager::Callback that will call a static functi...
static ModalComponentManager::Callback * create(void(*functionToCall)(int, ParamType), ParamType parameterValue)
This is a utility function to create a ModalComponentManager::Callback that will call a static functi...
Receives callbacks when a modal component is dismissed.
virtual void modalStateFinished(int returnValue)=0
Called to indicate that a modal component has been dismissed.
virtual ~Callback()=default
Destructor.
Manages the system's stack of modal components.
An array designed for holding objects.
This class acts as a pointer which will automatically become null if the object to which it points is...
#define JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL(Classname)
Macro to declare member variables and methods for a singleton class.