upgrade to JUCE 5.4.3. Remove (probably) unused JUCE modules. Remove VST2 target (it's been end-of-life'd by Steinberg and by JUCE)
This commit is contained in:
@ -36,14 +36,14 @@ ArrowButton::ArrowButton (const String& name, float arrowDirectionInRadians, Col
|
||||
|
||||
ArrowButton::~ArrowButton() {}
|
||||
|
||||
void ArrowButton::paintButton (Graphics& g, bool /*isMouseOverButton*/, bool isButtonDown)
|
||||
void ArrowButton::paintButton (Graphics& g, bool /*shouldDrawButtonAsHighlighted*/, bool shouldDrawButtonAsDown)
|
||||
{
|
||||
Path p (path);
|
||||
|
||||
const float offset = isButtonDown ? 1.0f : 0.0f;
|
||||
const float offset = shouldDrawButtonAsDown ? 1.0f : 0.0f;
|
||||
p.applyTransform (path.getTransformToScaleToFit (offset, offset, getWidth() - 3.0f, getHeight() - 3.0f, false));
|
||||
|
||||
DropShadow (Colours::black.withAlpha (0.3f), isButtonDown ? 2 : 4, Point<int>()).drawForPath (g, p);
|
||||
DropShadow (Colours::black.withAlpha (0.3f), shouldDrawButtonAsDown ? 2 : 4, Point<int>()).drawForPath (g, p);
|
||||
|
||||
g.setColour (colour);
|
||||
g.fillPath (p);
|
||||
|
@ -51,10 +51,10 @@ public:
|
||||
Colour arrowColour);
|
||||
|
||||
/** Destructor. */
|
||||
~ArrowButton();
|
||||
~ArrowButton() override;
|
||||
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown) override;
|
||||
void paintButton (Graphics&, bool, bool) override;
|
||||
|
||||
private:
|
||||
Colour colour;
|
||||
|
@ -54,7 +54,7 @@ protected:
|
||||
|
||||
public:
|
||||
/** Destructor. */
|
||||
virtual ~Button();
|
||||
~Button() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Changes the button's text.
|
||||
@ -166,7 +166,7 @@ public:
|
||||
{
|
||||
public:
|
||||
/** Destructor. */
|
||||
virtual ~Listener() {}
|
||||
virtual ~Listener() = default;
|
||||
|
||||
/** Called when the button is clicked. */
|
||||
virtual void buttonClicked (Button*) = 0;
|
||||
@ -367,26 +367,30 @@ public:
|
||||
*/
|
||||
struct JUCE_API LookAndFeelMethods
|
||||
{
|
||||
virtual ~LookAndFeelMethods() {}
|
||||
virtual ~LookAndFeelMethods() = default;
|
||||
|
||||
virtual void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool isMouseOverButton, bool isButtonDown) = 0;
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0;
|
||||
|
||||
virtual Font getTextButtonFont (TextButton&, int buttonHeight) = 0;
|
||||
virtual int getTextButtonWidthToFitText (TextButton&, int buttonHeight) = 0;
|
||||
|
||||
/** Draws the text for a TextButton. */
|
||||
virtual void drawButtonText (Graphics&, TextButton&, bool isMouseOverButton, bool isButtonDown) = 0;
|
||||
virtual void drawButtonText (Graphics&, TextButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0;
|
||||
|
||||
/** Draws the contents of a standard ToggleButton. */
|
||||
virtual void drawToggleButton (Graphics&, ToggleButton&, bool isMouseOverButton, bool isButtonDown) = 0;
|
||||
virtual void drawToggleButton (Graphics&, ToggleButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0;
|
||||
|
||||
virtual void changeToggleButtonWidthToFitText (ToggleButton&) = 0;
|
||||
|
||||
virtual void drawTickBox (Graphics&, Component&, float x, float y, float w, float h,
|
||||
bool ticked, bool isEnabled, bool isMouseOverButton, bool isButtonDown) = 0;
|
||||
bool ticked, bool isEnabled,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0;
|
||||
|
||||
virtual void drawDrawableButton (Graphics&, DrawableButton&, bool isMouseOverButton, bool isButtonDown) = 0;
|
||||
virtual void drawDrawableButton (Graphics&, DrawableButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0;
|
||||
|
||||
private:
|
||||
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE
|
||||
@ -424,14 +428,13 @@ protected:
|
||||
It's better to use this than the paint method, because it gives you information
|
||||
about the over/down state of the button.
|
||||
|
||||
@param g the graphics context to use
|
||||
@param isMouseOverButton true if the button is either in the 'over' or
|
||||
'down' state
|
||||
@param isButtonDown true if the button should be drawn in the 'down' position
|
||||
@param g the graphics context to use
|
||||
@param shouldDrawButtonAsHighlighted true if the button is either in the 'over' or 'down' state
|
||||
@param shouldDrawButtonAsDown true if the button should be drawn in the 'down' position
|
||||
*/
|
||||
virtual void paintButton (Graphics& g,
|
||||
bool isMouseOverButton,
|
||||
bool isButtonDown) = 0;
|
||||
bool shouldDrawButtonAsHighlighted,
|
||||
bool shouldDrawButtonAsDown) = 0;
|
||||
|
||||
/** Called when the button's up/down/over state changes.
|
||||
|
||||
@ -482,8 +485,6 @@ private:
|
||||
ListenerList<Listener> buttonListeners;
|
||||
|
||||
struct CallbackHelper;
|
||||
friend struct CallbackHelper;
|
||||
friend struct ContainerDeletePolicy<CallbackHelper>;
|
||||
std::unique_ptr<CallbackHelper> callbackHelper;
|
||||
uint32 buttonPressTime = 0, lastRepeatTime = 0;
|
||||
ApplicationCommandManager* commandManagerToUse = nullptr;
|
||||
|
@ -176,8 +176,8 @@ void DrawableButton::colourChanged()
|
||||
}
|
||||
|
||||
void DrawableButton::paintButton (Graphics& g,
|
||||
const bool isMouseOverButton,
|
||||
const bool isButtonDown)
|
||||
const bool shouldDrawButtonAsHighlighted,
|
||||
const bool shouldDrawButtonAsDown)
|
||||
{
|
||||
auto& lf = getLookAndFeel();
|
||||
|
||||
@ -185,9 +185,9 @@ void DrawableButton::paintButton (Graphics& g,
|
||||
lf.drawButtonBackground (g, *this,
|
||||
findColour (getToggleState() ? TextButton::buttonOnColourId
|
||||
: TextButton::buttonColourId),
|
||||
isMouseOverButton, isButtonDown);
|
||||
shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
|
||||
else
|
||||
lf.drawDrawableButton (g, *this, isMouseOverButton, isButtonDown);
|
||||
lf.drawDrawableButton (g, *this, shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
ButtonStyle buttonStyle);
|
||||
|
||||
/** Destructor. */
|
||||
~DrawableButton();
|
||||
~DrawableButton() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Sets up the images to draw for the various button states.
|
||||
@ -169,7 +169,7 @@ public:
|
||||
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown) override;
|
||||
void paintButton (Graphics&, bool, bool) override;
|
||||
/** @internal */
|
||||
void buttonStateChanged() override;
|
||||
/** @internal */
|
||||
|
@ -104,13 +104,13 @@ void HyperlinkButton::clicked()
|
||||
}
|
||||
|
||||
void HyperlinkButton::paintButton (Graphics& g,
|
||||
bool isMouseOverButton,
|
||||
bool isButtonDown)
|
||||
bool shouldDrawButtonAsHighlighted,
|
||||
bool shouldDrawButtonAsDown)
|
||||
{
|
||||
const Colour textColour (findColour (textColourId));
|
||||
|
||||
if (isEnabled())
|
||||
g.setColour ((isMouseOverButton) ? textColour.darker ((isButtonDown) ? 1.3f : 0.4f)
|
||||
g.setColour ((shouldDrawButtonAsHighlighted) ? textColour.darker ((shouldDrawButtonAsDown) ? 1.3f : 0.4f)
|
||||
: textColour);
|
||||
else
|
||||
g.setColour (textColour.withMultipliedAlpha (0.4f));
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
|
||||
@param linkText the text that will be displayed in the button - this is
|
||||
also set as the Component's name, but the text can be
|
||||
changed later with the Button::getButtonText() method
|
||||
changed later with the Button::setButtonText() method
|
||||
@param linkURL the URL to launch when the user clicks the button
|
||||
*/
|
||||
HyperlinkButton (const String& linkText,
|
||||
@ -54,7 +54,7 @@ public:
|
||||
HyperlinkButton();
|
||||
|
||||
/** Destructor. */
|
||||
~HyperlinkButton();
|
||||
~HyperlinkButton() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Changes the font to use for the text.
|
||||
@ -109,7 +109,7 @@ protected:
|
||||
/** @internal */
|
||||
void colourChanged() override;
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOver, bool isButtonDown) override;
|
||||
void paintButton (Graphics&, bool, bool) override;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
|
@ -109,13 +109,13 @@ Image ImageButton::getDownImage() const
|
||||
}
|
||||
|
||||
void ImageButton::paintButton (Graphics& g,
|
||||
bool isMouseOverButton,
|
||||
bool isButtonDown)
|
||||
bool shouldDrawButtonAsHighlighted,
|
||||
bool shouldDrawButtonAsDown)
|
||||
{
|
||||
if (! isEnabled())
|
||||
{
|
||||
isMouseOverButton = false;
|
||||
isButtonDown = false;
|
||||
shouldDrawButtonAsHighlighted = false;
|
||||
shouldDrawButtonAsDown = false;
|
||||
}
|
||||
|
||||
Image im (getCurrentImage());
|
||||
@ -168,14 +168,14 @@ void ImageButton::paintButton (Graphics& g,
|
||||
|
||||
imageBounds.setBounds (x, y, w, h);
|
||||
|
||||
const bool useDownImage = isButtonDown || getToggleState();
|
||||
const bool useDownImage = shouldDrawButtonAsDown || getToggleState();
|
||||
|
||||
getLookAndFeel().drawImageButton (g, &im, x, y, w, h,
|
||||
useDownImage ? downOverlay
|
||||
: (isMouseOverButton ? overOverlay
|
||||
: (shouldDrawButtonAsHighlighted ? overOverlay
|
||||
: normalOverlay),
|
||||
useDownImage ? downOpacity
|
||||
: (isMouseOverButton ? overOpacity
|
||||
: (shouldDrawButtonAsHighlighted ? overOpacity
|
||||
: normalOpacity),
|
||||
*this);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
explicit ImageButton (const String& name = String());
|
||||
|
||||
/** Destructor. */
|
||||
~ImageButton();
|
||||
~ImageButton() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Sets up the images to draw in various states.
|
||||
@ -131,7 +131,7 @@ public:
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API LookAndFeelMethods
|
||||
{
|
||||
virtual ~LookAndFeelMethods() {}
|
||||
virtual ~LookAndFeelMethods() = default;
|
||||
|
||||
virtual void drawImageButton (Graphics&, Image*,
|
||||
int imageX, int imageY, int imageW, int imageH,
|
||||
@ -143,7 +143,7 @@ protected:
|
||||
/** @internal */
|
||||
bool hitTest (int x, int y) override;
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOver, bool isButtonDown) override;
|
||||
void paintButton (Graphics&, bool, bool) override;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
|
@ -82,7 +82,7 @@ void ShapeButton::setShape (const Path& newShape,
|
||||
|
||||
if (resizeNowToFitThisShape)
|
||||
{
|
||||
Rectangle<float> newBounds (shape.getBounds());
|
||||
auto newBounds = shape.getBounds();
|
||||
|
||||
if (hasShadow)
|
||||
newBounds = newBounds.expanded (4.0f);
|
||||
@ -97,20 +97,22 @@ void ShapeButton::setShape (const Path& newShape,
|
||||
repaint();
|
||||
}
|
||||
|
||||
void ShapeButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)
|
||||
void ShapeButton::paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)
|
||||
{
|
||||
if (! isEnabled())
|
||||
{
|
||||
isMouseOverButton = false;
|
||||
isButtonDown = false;
|
||||
shouldDrawButtonAsHighlighted = false;
|
||||
shouldDrawButtonAsDown = false;
|
||||
}
|
||||
|
||||
Rectangle<float> r (border.subtractedFrom (getLocalBounds()).toFloat().reduced (outlineWidth * 0.5f));
|
||||
auto r = border.subtractedFrom (getLocalBounds())
|
||||
.toFloat()
|
||||
.reduced (outlineWidth * 0.5f);
|
||||
|
||||
if (getComponentEffect() != nullptr)
|
||||
r = r.reduced (2.0f);
|
||||
|
||||
if (isButtonDown)
|
||||
if (shouldDrawButtonAsDown)
|
||||
{
|
||||
const float sizeReductionWhenPressed = 0.04f;
|
||||
|
||||
@ -118,11 +120,11 @@ void ShapeButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButto
|
||||
sizeReductionWhenPressed * r.getHeight());
|
||||
}
|
||||
|
||||
const AffineTransform trans (shape.getTransformToScaleToFit (r, maintainShapeProportions));
|
||||
auto trans = shape.getTransformToScaleToFit (r, maintainShapeProportions);
|
||||
|
||||
if (isButtonDown) g.setColour (getToggleState() && useOnColours ? downColourOn : downColour);
|
||||
else if (isMouseOverButton) g.setColour (getToggleState() && useOnColours ? overColourOn : overColour);
|
||||
else g.setColour (getToggleState() && useOnColours ? normalColourOn : normalColour);
|
||||
if (shouldDrawButtonAsDown) g.setColour (getToggleState() && useOnColours ? downColourOn : downColour);
|
||||
else if (shouldDrawButtonAsHighlighted) g.setColour (getToggleState() && useOnColours ? overColourOn : overColour);
|
||||
else g.setColour (getToggleState() && useOnColours ? normalColourOn : normalColour);
|
||||
|
||||
g.fillPath (shape, trans);
|
||||
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
Colour downColour);
|
||||
|
||||
/** Destructor. */
|
||||
~ShapeButton();
|
||||
~ShapeButton() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Sets the shape to use.
|
||||
@ -108,7 +108,7 @@ public:
|
||||
void setBorderSize (BorderSize<int> border);
|
||||
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown) override;
|
||||
void paintButton (Graphics&, bool, bool) override;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
|
@ -44,15 +44,15 @@ TextButton::~TextButton()
|
||||
{
|
||||
}
|
||||
|
||||
void TextButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)
|
||||
void TextButton::paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)
|
||||
{
|
||||
LookAndFeel& lf = getLookAndFeel();
|
||||
auto& lf = getLookAndFeel();
|
||||
|
||||
lf.drawButtonBackground (g, *this,
|
||||
findColour (getToggleState() ? buttonOnColourId : buttonColourId),
|
||||
isMouseOverButton, isButtonDown);
|
||||
shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
|
||||
|
||||
lf.drawButtonText (g, *this, isMouseOverButton, isButtonDown);
|
||||
lf.drawButtonText (g, *this, shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
|
||||
}
|
||||
|
||||
void TextButton::colourChanged()
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
TextButton (const String& buttonName, const String& toolTip);
|
||||
|
||||
/** Destructor. */
|
||||
~TextButton();
|
||||
~TextButton() override;
|
||||
|
||||
//==============================================================================
|
||||
/** A set of colour IDs to use to change the colour of various aspects of the button.
|
||||
@ -99,7 +99,7 @@ public:
|
||||
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown) override;
|
||||
void paintButton (Graphics&, bool, bool) override;
|
||||
/** @internal */
|
||||
void colourChanged() override;
|
||||
|
||||
|
@ -43,9 +43,9 @@ ToggleButton::~ToggleButton()
|
||||
{
|
||||
}
|
||||
|
||||
void ToggleButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)
|
||||
void ToggleButton::paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)
|
||||
{
|
||||
getLookAndFeel().drawToggleButton (g, *this, isMouseOverButton, isButtonDown);
|
||||
getLookAndFeel().drawToggleButton (g, *this, shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown);
|
||||
}
|
||||
|
||||
void ToggleButton::changeWidthToFitText()
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
explicit ToggleButton (const String& buttonText);
|
||||
|
||||
/** Destructor. */
|
||||
~ToggleButton();
|
||||
~ToggleButton() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Resizes the button to fit neatly around its current text.
|
||||
@ -74,13 +74,13 @@ public:
|
||||
{
|
||||
textColourId = 0x1006501, /**< The colour to use for the button's text. */
|
||||
tickColourId = 0x1006502, /**< The colour to use for the tick mark. */
|
||||
tickDisabledColourId = 0x1006503 /**< The colour to use for the disabled tick mark. */
|
||||
tickDisabledColourId = 0x1006503 /**< The colour to use for the disabled tick mark and/or outline. */
|
||||
};
|
||||
|
||||
protected:
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown) override;
|
||||
void paintButton (Graphics&, bool, bool) override;
|
||||
/** @internal */
|
||||
void colourChanged() override;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public:
|
||||
Drawable* toggledOnImage);
|
||||
|
||||
/** Destructor. */
|
||||
~ToolbarButton();
|
||||
~ToolbarButton() override;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
Reference in New Issue
Block a user