Browse Source

Added some missing 'override's

tags/2021-05-28
jules 9 years ago
parent
commit
12eeadec8b
3 changed files with 14 additions and 18 deletions
  1. +1
    -1
      modules/juce_gui_basics/components/juce_ModalComponentManager.cpp
  2. +12
    -16
      modules/juce_gui_basics/components/juce_ModalComponentManager.h
  3. +1
    -1
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp

+ 1
- 1
modules/juce_gui_basics/components/juce_ModalComponentManager.cpp View File

@@ -251,7 +251,7 @@ class ModalComponentManager::ReturnValueRetriever : public ModalComponentMan
public:
ReturnValueRetriever (int& v, bool& done) : value (v), finished (done) {}
void modalStateFinished (int returnValue)
void modalStateFinished (int returnValue) override
{
finished = true;
value = returnValue;


+ 12
- 16
modules/juce_gui_basics/components/juce_ModalComponentManager.h View File

@@ -184,7 +184,7 @@ public:
static ModalComponentManager::Callback* create (void (*functionToCall) (int, ParamType),
ParamType parameterValue)
{
return new FunctionCaller1 <ParamType> (functionToCall, parameterValue);
return new FunctionCaller1<ParamType> (functionToCall, parameterValue);
}
//==============================================================================
@@ -214,7 +214,7 @@ public:
ParamType1 parameterValue1,
ParamType2 parameterValue2)
{
return new FunctionCaller2 <ParamType1, ParamType2> (functionToCall, parameterValue1, parameterValue2);
return new FunctionCaller2<ParamType1, ParamType2> (functionToCall, parameterValue1, parameterValue2);
}
//==============================================================================
@@ -244,7 +244,7 @@ public:
static ModalComponentManager::Callback* forComponent (void (*functionToCall) (int, ComponentType*),
ComponentType* component)
{
return new ComponentCaller1 <ComponentType> (functionToCall, component);
return new ComponentCaller1<ComponentType> (functionToCall, component);
}
//==============================================================================
@@ -275,21 +275,20 @@ public:
ComponentType* component,
ParamType param)
{
return new ComponentCaller2 <ComponentType, ParamType> (functionToCall, component, param);
return new ComponentCaller2<ComponentType, ParamType> (functionToCall, component, param);
}
private:
//==============================================================================
template <typename ParamType>
class FunctionCaller1 : public ModalComponentManager::Callback
struct FunctionCaller1 : public ModalComponentManager::Callback
{
public:
typedef void (*FunctionType) (int, ParamType);
FunctionCaller1 (FunctionType& f, ParamType& p1)
: function (f), param (p1) {}
void modalStateFinished (int returnValue) { function (returnValue, param); }
void modalStateFinished (int returnValue) override { function (returnValue, param); }
private:
const FunctionType function;
@@ -299,15 +298,14 @@ private:
};
template <typename ParamType1, typename ParamType2>
class FunctionCaller2 : public ModalComponentManager::Callback
struct FunctionCaller2 : public ModalComponentManager::Callback
{
public:
typedef void (*FunctionType) (int, ParamType1, ParamType2);
FunctionCaller2 (FunctionType& f, ParamType1& p1, ParamType2& p2)
: function (f), param1 (p1), param2 (p2) {}
void modalStateFinished (int returnValue) { function (returnValue, param1, param2); }
void modalStateFinished (int returnValue) override { function (returnValue, param1, param2); }
private:
const FunctionType function;
@@ -318,15 +316,14 @@ private:
};
template <typename ComponentType>
class ComponentCaller1 : public ModalComponentManager::Callback
struct ComponentCaller1 : public ModalComponentManager::Callback
{
public:
typedef void (*FunctionType) (int, ComponentType*);
ComponentCaller1 (FunctionType& f, ComponentType* c)
: function (f), comp (c) {}
void modalStateFinished (int returnValue)
void modalStateFinished (int returnValue) override
{
function (returnValue, static_cast<ComponentType*> (comp.get()));
}
@@ -339,15 +336,14 @@ private:
};
template <typename ComponentType, typename ParamType1>
class ComponentCaller2 : public ModalComponentManager::Callback
struct ComponentCaller2 : public ModalComponentManager::Callback
{
public:
typedef void (*FunctionType) (int, ComponentType*, ParamType1);
ComponentCaller2 (FunctionType& f, ComponentType* c, ParamType1 p1)
: function (f), comp (c), param1 (p1) {}
void modalStateFinished (int returnValue)
void modalStateFinished (int returnValue) override
{
function (returnValue, static_cast<ComponentType*> (comp.get()), param1);
}


+ 1
- 1
modules/juce_gui_basics/menus/juce_PopupMenu.cpp View File

@@ -1506,7 +1506,7 @@ struct PopupMenuCompletionCallback : public ModalComponentManager::Callback
PopupMenuSettings::menuWasHiddenBecauseOfAppChange = false;
}
void modalStateFinished (int result)
void modalStateFinished (int result) override
{
if (managerOfChosenCommand != nullptr && result != 0)
{


Loading…
Cancel
Save