25 #ifndef JUCE_MODALCOMPONENTMANAGER_H_INCLUDED
26 #define JUCE_MODALCOMPONENTMANAGER_H_INCLUDED
72 virtual void modalStateFinished (
int returnValue) = 0;
87 Component* getModalComponent (
int index) const;
90 bool isModal (
Component* component) const;
93 bool isFrontModalComponent (
Component* component) const;
108 void attachCallback (
Component* component, Callback* callback);
111 void bringModalComponentsToFront (
bool topOneShouldGrabFocus =
true);
116 bool cancelAllModalComponents();
118 #if JUCE_MODAL_LOOPS_PERMITTED
122 int runEventLoopForCurrentComponent();
140 class ReturnValueRetriever;
146 void startModal (
Component*,
bool autoDelete);
147 void endModal (
Component*,
int returnValue);
183 template <
typename ParamType>
185 ParamType parameterValue)
187 return new FunctionCaller1 <ParamType> (functionToCall, parameterValue);
212 template <
typename ParamType1,
typename ParamType2>
214 ParamType1 parameterValue1,
215 ParamType2 parameterValue2)
217 return new FunctionCaller2 <ParamType1, ParamType2> (functionToCall, parameterValue1, parameterValue2);
243 template <
class ComponentType>
245 ComponentType* component)
247 return new ComponentCaller1 <ComponentType> (functionToCall, component);
273 template <
class ComponentType,
typename ParamType>
275 ComponentType* component,
278 return new ComponentCaller2 <ComponentType, ParamType> (functionToCall, component, param);
283 template <
typename ParamType>
287 typedef void (*FunctionType) (
int, ParamType);
289 FunctionCaller1 (FunctionType& f, ParamType& p1)
290 : function (f), param (p1) {}
292 void modalStateFinished (
int returnValue) {
function (returnValue, param); }
295 const FunctionType
function;
301 template <
typename ParamType1,
typename ParamType2>
305 typedef void (*FunctionType) (
int, ParamType1, ParamType2);
307 FunctionCaller2 (FunctionType& f, ParamType1& p1, ParamType2& p2)
308 : function (f), param1 (p1), param2 (p2) {}
310 void modalStateFinished (
int returnValue) {
function (returnValue, param1, param2); }
313 const FunctionType
function;
320 template <
typename ComponentType>
324 typedef void (*FunctionType) (
int, ComponentType*);
326 ComponentCaller1 (FunctionType& f, ComponentType* c)
327 : function (f), comp (c) {}
329 void modalStateFinished (
int returnValue)
331 function (returnValue, static_cast <ComponentType*> (comp.get()));
335 const FunctionType
function;
341 template <
typename ComponentType,
typename ParamType1>
345 typedef void (*FunctionType) (
int, ComponentType*, ParamType1);
347 ComponentCaller2 (FunctionType& f, ComponentType* c, ParamType1 p1)
348 : function (f), comp (c), param1 (p1) {}
350 void modalStateFinished (
int returnValue)
352 function (returnValue, static_cast <ComponentType*> (comp.get()), param1);
356 const FunctionType
function;
369 #endif // JUCE_MODALCOMPONENTMANAGER_H_INCLUDED
static ModalComponentManager::Callback * forComponent(void(*functionToCall)(int, ComponentType *, ParamType), ComponentType *component, ParamType param)
Definition: juce_ModalComponentManager.h:274
static ModalComponentManager::Callback * create(void(*functionToCall)(int, ParamType), ParamType parameterValue)
Definition: juce_ModalComponentManager.h:184
virtual ~Callback()
Definition: juce_ModalComponentManager.h:60
Callback()
Definition: juce_ModalComponentManager.h:57
#define true
Definition: ordinals.h:82
Definition: juce_DeletedAtShutdown.h:40
TOUCHINPUT int
Definition: juce_win32_Windowing.cpp:123
virtual void handleAsyncUpdate()=0
Definition: juce_ModalComponentManager.h:53
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_AsyncUpdater.h:39
Definition: juce_Component.h:33
Definition: juce_ModalComponentManager.h:158
Definition: juce_ContainerDeletePolicy.h:44
static ModalComponentManager::Callback * forComponent(void(*functionToCall)(int, ComponentType *), ComponentType *component)
Definition: juce_ModalComponentManager.h:244
void
Definition: juce_PNGLoader.cpp:1173
Definition: juce_OwnedArray.h:55
Definition: juce_ModalComponentManager.cpp:25
#define juce_DeclareSingleton_SingleThreaded_Minimal(classname)
static ModalComponentManager::Callback * withParam(void(*functionToCall)(int, ParamType1, ParamType2), ParamType1 parameterValue1, ParamType2 parameterValue2)
Definition: juce_ModalComponentManager.h:213
Definition: juce_ModalComponentManager.h:40