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:
@ -108,7 +108,7 @@ void AlertWindow::addButton (const String& name,
|
||||
|
||||
b->setWantsKeyboardFocus (true);
|
||||
b->setMouseClickGrabsKeyboardFocus (false);
|
||||
b->setCommandToTrigger (0, returnValue, false);
|
||||
b->setCommandToTrigger (nullptr, returnValue, false);
|
||||
b->addShortcut (shortcutKey1);
|
||||
b->addShortcut (shortcutKey2);
|
||||
b->onClick = [this, b] { exitAlert (b); };
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
Component* associatedComponent = nullptr);
|
||||
|
||||
/** Destroys the AlertWindow */
|
||||
~AlertWindow();
|
||||
~AlertWindow() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the type of alert icon that was specified when the window
|
||||
@ -423,7 +423,7 @@ public:
|
||||
*/
|
||||
struct JUCE_API LookAndFeelMethods
|
||||
{
|
||||
virtual ~LookAndFeelMethods() {}
|
||||
virtual ~LookAndFeelMethods() = default;
|
||||
|
||||
virtual AlertWindow* createAlertWindow (const String& title, const String& message,
|
||||
const String& button1,
|
||||
|
@ -42,8 +42,7 @@ CallOutBox::CallOutBox (Component& c, Rectangle<int> area, Component* const pare
|
||||
{
|
||||
setAlwaysOnTop (juce_areThereAnyAlwaysOnTopWindows());
|
||||
|
||||
updatePosition (area, Desktop::getInstance().getDisplays()
|
||||
.getDisplayContaining (area.getCentre()).userArea);
|
||||
updatePosition (area, Desktop::getInstance().getDisplays().findDisplayForRect (area).userArea);
|
||||
|
||||
addToDesktop (ComponentPeer::windowIsTemporary);
|
||||
|
||||
|
@ -79,10 +79,10 @@ public:
|
||||
Component* parentComponent);
|
||||
|
||||
/** Destructor. */
|
||||
~CallOutBox();
|
||||
~CallOutBox() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Changes the length of the arrow. */
|
||||
/** Changes the base width of the arrow. */
|
||||
void setArrowSize (float newSize);
|
||||
|
||||
/** Updates the position and size of the box.
|
||||
@ -141,7 +141,7 @@ public:
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API LookAndFeelMethods
|
||||
{
|
||||
virtual ~LookAndFeelMethods() {}
|
||||
virtual ~LookAndFeelMethods() = default;
|
||||
|
||||
virtual void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) = 0;
|
||||
virtual int getCallOutBoxBorderSize (const CallOutBox&) = 0;
|
||||
|
@ -109,11 +109,15 @@ void ComponentPeer::handlePaint (LowLevelGraphicsContext& contextToPaintTo)
|
||||
g.addTransform (component.getTransform());
|
||||
|
||||
auto peerBounds = getBounds();
|
||||
auto componentBounds = component.getLocalBounds();
|
||||
|
||||
if (peerBounds.getWidth() != component.getWidth() || peerBounds.getHeight() != component.getHeight())
|
||||
if (component.isTransformed())
|
||||
componentBounds = componentBounds.transformedBy (component.getTransform());
|
||||
|
||||
if (peerBounds.getWidth() != componentBounds.getWidth() || peerBounds.getHeight() != componentBounds.getHeight())
|
||||
// Tweak the scaling so that the component's integer size exactly aligns with the peer's scaled size
|
||||
g.addTransform (AffineTransform::scale (peerBounds.getWidth() / (float) component.getWidth(),
|
||||
peerBounds.getHeight() / (float) component.getHeight()));
|
||||
g.addTransform (AffineTransform::scale (peerBounds.getWidth() / (float) componentBounds.getWidth(),
|
||||
peerBounds.getHeight() / (float) componentBounds.getHeight()));
|
||||
|
||||
#if JUCE_ENABLE_REPAINT_DEBUGGING
|
||||
#ifdef JUCE_IS_REPAINT_DEBUGGING_ACTIVE
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
windowIgnoresKeyPresses = (1 << 10), /**< Tells the window not to catch any keypresses. This can
|
||||
be used for things like plugin windows, to stop them interfering
|
||||
with the host's shortcut keys */
|
||||
windowIsSemiTransparent = (1 << 31) /**< Not intended for public use - makes a window transparent. */
|
||||
windowIsSemiTransparent = (1 << 30) /**< Not intended for public use - makes a window transparent. */
|
||||
|
||||
};
|
||||
|
||||
@ -377,6 +377,36 @@ public:
|
||||
*/
|
||||
static ModifierKeys getCurrentModifiersRealtime() noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/** Used to receive callbacks when the OS scale factor of this ComponentPeer changes.
|
||||
|
||||
This is used internally by some native JUCE windows on Windows and Linux and you
|
||||
shouldn't need to worry about it in your own code unless you are dealing directly
|
||||
with native windows.
|
||||
*/
|
||||
struct JUCE_API ScaleFactorListener
|
||||
{
|
||||
/** Destructor. */
|
||||
virtual ~ScaleFactorListener() = default;
|
||||
|
||||
/** Called when the scale factor changes. */
|
||||
virtual void nativeScaleFactorChanged (double newScaleFactor) = 0;
|
||||
};
|
||||
|
||||
/** Adds a scale factor listener. */
|
||||
void addScaleFactorListener (ScaleFactorListener* listenerToAdd) { scaleFactorListeners.add (listenerToAdd); }
|
||||
|
||||
/** Removes a scale factor listener. */
|
||||
void removeScaleFactorListener (ScaleFactorListener* listenerToRemove) { scaleFactorListeners.remove (listenerToRemove); }
|
||||
|
||||
//==============================================================================
|
||||
/** On Windows and Linux this will return the OS scaling factor currently being applied
|
||||
to the native window. This is used to convert between physical and logical pixels
|
||||
at the OS API level and you shouldn't need to use it in your own code unless you
|
||||
are dealing directly with the native window.
|
||||
*/
|
||||
virtual double getPlatformScaleFactor() const noexcept { return 1.0; }
|
||||
|
||||
protected:
|
||||
//==============================================================================
|
||||
Component& component;
|
||||
@ -384,6 +414,7 @@ protected:
|
||||
Rectangle<int> lastNonFullscreenBounds;
|
||||
ComponentBoundsConstrainer* constrainer = nullptr;
|
||||
static std::function<ModifierKeys()> getNativeRealtimeModifiers;
|
||||
ListenerList<ScaleFactorListener> scaleFactorListeners;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
/** Destructor.
|
||||
If a content component has been set with setContentOwned(), it will be deleted.
|
||||
*/
|
||||
~DialogWindow();
|
||||
~DialogWindow() override;
|
||||
|
||||
//==============================================================================
|
||||
/** This class defines a collection of settings to be used to open a DialogWindow.
|
||||
@ -153,7 +153,7 @@ public:
|
||||
//==============================================================================
|
||||
/** Easy way of quickly showing a dialog box containing a given component.
|
||||
|
||||
Note: this method has been superceded by the DialogWindow::LaunchOptions structure,
|
||||
Note: This method has been superceded by the DialogWindow::LaunchOptions structure,
|
||||
which does the same job with some extra flexibility. The showDialog method is here
|
||||
for backwards compatibility, but please use DialogWindow::LaunchOptions in new code.
|
||||
|
||||
@ -199,7 +199,7 @@ public:
|
||||
#if JUCE_MODAL_LOOPS_PERMITTED || DOXYGEN
|
||||
/** Easy way of quickly showing a dialog box containing a given component.
|
||||
|
||||
Note: this method has been superceded by the DialogWindow::LaunchOptions structure,
|
||||
Note: This method has been superceded by the DialogWindow::LaunchOptions structure,
|
||||
which does the same job with some extra flexibility. The showDialog method is here
|
||||
for backwards compatibility, but please use DialogWindow::LaunchOptions in new code.
|
||||
|
||||
|
@ -212,7 +212,7 @@ void DocumentWindow::paint (Graphics& g)
|
||||
titleBarArea.getHeight(),
|
||||
titleSpaceX1,
|
||||
jmax (1, titleSpaceX2 - titleSpaceX1),
|
||||
titleBarIcon.isValid() ? &titleBarIcon : 0,
|
||||
titleBarIcon.isValid() ? &titleBarIcon : nullptr,
|
||||
! drawTitleTextCentred);
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
/** Destructor.
|
||||
If a content component has been set with setContentOwned(), it will be deleted.
|
||||
*/
|
||||
~DocumentWindow();
|
||||
~DocumentWindow() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Changes the component's name.
|
||||
@ -232,7 +232,7 @@ public:
|
||||
*/
|
||||
struct JUCE_API LookAndFeelMethods
|
||||
{
|
||||
virtual ~LookAndFeelMethods() {}
|
||||
virtual ~LookAndFeelMethods() = default;
|
||||
|
||||
virtual void drawDocumentWindowTitleBar (DocumentWindow&,
|
||||
Graphics&, int w, int h,
|
||||
@ -286,7 +286,6 @@ private:
|
||||
MenuBarModel* menuBarModel = nullptr;
|
||||
|
||||
class ButtonListenerProxy;
|
||||
friend struct ContainerDeletePolicy<ButtonListenerProxy>;
|
||||
std::unique_ptr<ButtonListenerProxy> buttonListener;
|
||||
|
||||
void repaintTitleBar();
|
||||
|
@ -565,7 +565,7 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s)
|
||||
|
||||
if (onScreenArea.getWidth() * onScreenArea.getHeight() < 32 * 32)
|
||||
{
|
||||
auto screen = desktop.getDisplays().getDisplayContaining (newPos.getCentre()).userArea;
|
||||
auto screen = desktop.getDisplays().findDisplayForRect (newPos).userArea;
|
||||
|
||||
newPos.setSize (jmin (newPos.getWidth(), screen.getWidth()),
|
||||
jmin (newPos.getHeight(), screen.getHeight()));
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
/** Destructor.
|
||||
If a content component has been set with setContentOwned(), it will be deleted.
|
||||
*/
|
||||
~ResizableWindow();
|
||||
~ResizableWindow() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the colour currently being used for the window's background.
|
||||
@ -326,7 +326,7 @@ public:
|
||||
*/
|
||||
struct JUCE_API LookAndFeelMethods
|
||||
{
|
||||
virtual ~LookAndFeelMethods() {}
|
||||
virtual ~LookAndFeelMethods() = default;
|
||||
|
||||
//==============================================================================
|
||||
virtual void drawCornerResizer (Graphics&, int w, int h, bool isMouseOver, bool isMouseDragging) = 0;
|
||||
|
@ -59,7 +59,7 @@ ThreadWithProgressWindow::~ThreadWithProgressWindow()
|
||||
|
||||
void ThreadWithProgressWindow::launchThread (int priority)
|
||||
{
|
||||
jassert (MessageManager::getInstance()->isThisTheMessageThread());
|
||||
JUCE_ASSERT_MESSAGE_THREAD
|
||||
|
||||
startThread (priority);
|
||||
startTimer (100);
|
||||
@ -87,7 +87,7 @@ void ThreadWithProgressWindow::timerCallback()
|
||||
{
|
||||
bool threadStillRunning = isThreadRunning();
|
||||
|
||||
if (! (threadStillRunning && alertWindow->isCurrentlyModal()))
|
||||
if (! (threadStillRunning && alertWindow->isCurrentlyModal (false)))
|
||||
{
|
||||
stopTimer();
|
||||
stopThread (timeOutMsWhenCancelling);
|
||||
|
@ -111,7 +111,7 @@ public:
|
||||
Component* componentToCentreAround = nullptr);
|
||||
|
||||
/** Destructor. */
|
||||
~ThreadWithProgressWindow();
|
||||
~ThreadWithProgressWindow() override;
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_MODAL_LOOPS_PERMITTED
|
||||
|
@ -92,8 +92,7 @@ void TooltipWindow::displayTip (Point<int> screenPos, const String& tip)
|
||||
}
|
||||
else
|
||||
{
|
||||
updatePosition (tip, screenPos, Desktop::getInstance().getDisplays()
|
||||
.getDisplayContaining (screenPos).userArea);
|
||||
updatePosition (tip, screenPos, Desktop::getInstance().getDisplays().findDisplayForPoint (screenPos).userArea);
|
||||
|
||||
addToDesktop (ComponentPeer::windowHasDropShadow
|
||||
| ComponentPeer::windowIsTemporary
|
||||
@ -104,12 +103,15 @@ void TooltipWindow::displayTip (Point<int> screenPos, const String& tip)
|
||||
#if JUCE_DEBUG
|
||||
activeTooltipWindows.addIfNotAlreadyThere (this);
|
||||
|
||||
auto* parent = getParentComponent();
|
||||
|
||||
for (auto* w : activeTooltipWindows)
|
||||
{
|
||||
if (w != this && w->tipShowing == tipShowing)
|
||||
if (w != this && w->tipShowing == tipShowing && w->getParentComponent() == parent)
|
||||
{
|
||||
// Looks like you have more than one TooltipWindow showing the same tip..
|
||||
// Be careful not to create more than one instance of this class!
|
||||
// Be careful not to create more than one instance of this class with the
|
||||
// same parent component!
|
||||
jassertfalse;
|
||||
}
|
||||
}
|
||||
@ -153,6 +155,7 @@ void TooltipWindow::timerCallback()
|
||||
auto now = Time::getApproximateMillisecondCounter();
|
||||
|
||||
auto* newComp = mouseSource.isTouch() ? nullptr : mouseSource.getComponentUnderMouse();
|
||||
|
||||
auto newTip = newComp != nullptr ? getTipFor (*newComp) : String();
|
||||
bool tipChanged = (newTip != lastTipUnderMouse || newComp != lastComponentUnderMouse);
|
||||
lastComponentUnderMouse = newComp;
|
||||
|
@ -32,11 +32,15 @@ namespace juce
|
||||
A window that displays a pop-up tooltip when the mouse hovers over another component.
|
||||
|
||||
To enable tooltips in your app, just create a single instance of a TooltipWindow
|
||||
object. Note that if you instantiate more than one instance of this class, you'll
|
||||
end up with multiple tooltips being shown! This is a common problem when compiling
|
||||
audio plug-ins with JUCE: depending on the way you instantiate TooltipWindow,
|
||||
you may end up with a TooltipWindow for each plug-in instance. To avoid this use a
|
||||
SharedResourcePointer to instantiate the TooltipWindow only once.
|
||||
object. Note that if you instantiate more than one instance of this class with the
|
||||
same parentComponent (even if both TooltipWindow's parentComponent is nil), you'll
|
||||
end up with multiple tooltips being shown! To avoid this use a SharedResourcePointer
|
||||
to instantiate the TooltipWindow only once.
|
||||
|
||||
For audio plug-ins (which should not be opening native windows) it is better
|
||||
to add a TooltipWindow as a member variable to the editor and ensure that the
|
||||
editor is the parentComponent of your TooltipWindow. This will ensure that your
|
||||
TooltipWindow is scaled according to your editor and the DAWs scaling setting.
|
||||
|
||||
The TooltipWindow object will then stay invisible, waiting until the mouse
|
||||
hovers for the specified length of time - it will then see if it's currently
|
||||
@ -61,7 +65,7 @@ public:
|
||||
To change the style of tooltips, see the LookAndFeel class for its tooltip
|
||||
methods.
|
||||
|
||||
@param parentComponent if set to 0, the TooltipWindow will appear on the desktop,
|
||||
@param parentComponent if set to nullptr, the TooltipWindow will appear on the desktop,
|
||||
otherwise the tooltip will be added to the given parent
|
||||
component.
|
||||
@param millisecondsBeforeTipAppears the time for which the mouse has to stay still
|
||||
@ -73,7 +77,7 @@ public:
|
||||
int millisecondsBeforeTipAppears = 700);
|
||||
|
||||
/** Destructor. */
|
||||
~TooltipWindow();
|
||||
~TooltipWindow() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Changes the time before the tip appears.
|
||||
@ -113,7 +117,7 @@ public:
|
||||
*/
|
||||
struct JUCE_API LookAndFeelMethods
|
||||
{
|
||||
virtual ~LookAndFeelMethods() {}
|
||||
virtual ~LookAndFeelMethods() = default;
|
||||
|
||||
/** returns the bounds for a tooltip at the given screen coordinate, constrained within the given desktop area. */
|
||||
virtual Rectangle<int> getTooltipBounds (const String& tipText, Point<int> screenPos, Rectangle<int> parentArea) = 0;
|
||||
|
@ -32,8 +32,8 @@ class TopLevelWindowManager : private Timer,
|
||||
private DeletedAtShutdown
|
||||
{
|
||||
public:
|
||||
TopLevelWindowManager() {}
|
||||
~TopLevelWindowManager() { clearSingletonInstance(); }
|
||||
TopLevelWindowManager() {}
|
||||
~TopLevelWindowManager() override { clearSingletonInstance(); }
|
||||
|
||||
JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL (TopLevelWindowManager)
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
TopLevelWindow (const String& name, bool addToDesktop);
|
||||
|
||||
/** Destructor. */
|
||||
~TopLevelWindow();
|
||||
~TopLevelWindow() override;
|
||||
|
||||
//==============================================================================
|
||||
/** True if this is currently the TopLevelWindow that is actively being used.
|
||||
|
Reference in New Issue
Block a user