migrating to the latest JUCE version
This commit is contained in:
@ -1,192 +1,192 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
static Typeface::Ptr getTypefaceForFontFromLookAndFeel (const Font& font)
|
||||
{
|
||||
return LookAndFeel::getDefaultLookAndFeel().getTypefaceForFont (font);
|
||||
}
|
||||
|
||||
using GetTypefaceForFont = Typeface::Ptr (*)(const Font&);
|
||||
extern GetTypefaceForFont juce_getTypefaceForFont;
|
||||
|
||||
//==============================================================================
|
||||
LookAndFeel::LookAndFeel()
|
||||
{
|
||||
/* if this fails it means you're trying to create a LookAndFeel object before
|
||||
the static Colours have been initialised. That ain't gonna work. It probably
|
||||
means that you're using a static LookAndFeel object and that your compiler has
|
||||
decided to initialise it before the Colours class.
|
||||
*/
|
||||
jassert (Colours::white == Colour (0xffffffff));
|
||||
|
||||
juce_getTypefaceForFont = getTypefaceForFontFromLookAndFeel;
|
||||
}
|
||||
|
||||
LookAndFeel::~LookAndFeel()
|
||||
{
|
||||
/* This assertion is triggered if you try to delete a LookAndFeel object while something
|
||||
is still using it!
|
||||
|
||||
Reasons may be:
|
||||
- it's still being used as the default LookAndFeel; or
|
||||
- it's set as a Component's current lookandfeel; or
|
||||
- there's a WeakReference to it somewhere else in your code
|
||||
|
||||
Generally the fix for this will be to make sure you call
|
||||
Component::setLookandFeel (nullptr) on any components that were still using
|
||||
it before you delete it, or call LookAndFeel::setDefaultLookAndFeel (nullptr)
|
||||
if you had set it up to be the default one. This assertion can also be avoided by
|
||||
declaring your LookAndFeel object before any of the Components that use it as
|
||||
the Components will be destroyed before the LookAndFeel.
|
||||
|
||||
Deleting a LookAndFeel is unlikely to cause a crash since most things will use a
|
||||
safe WeakReference to it, but it could cause some unexpected graphical behaviour,
|
||||
so it's advisable to clear up any references before destroying them!
|
||||
*/
|
||||
jassert (masterReference.getNumActiveWeakReferences() == 0
|
||||
|| (masterReference.getNumActiveWeakReferences() == 1
|
||||
&& this == &getDefaultLookAndFeel()));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Colour LookAndFeel::findColour (int colourID) const noexcept
|
||||
{
|
||||
const ColourSetting c = { colourID, Colour() };
|
||||
auto index = colours.indexOf (c);
|
||||
|
||||
if (index >= 0)
|
||||
return colours[index].colour;
|
||||
|
||||
jassertfalse;
|
||||
return Colours::black;
|
||||
}
|
||||
|
||||
void LookAndFeel::setColour (int colourID, Colour newColour) noexcept
|
||||
{
|
||||
const ColourSetting c = { colourID, newColour };
|
||||
auto index = colours.indexOf (c);
|
||||
|
||||
if (index >= 0)
|
||||
colours.getReference (index).colour = newColour;
|
||||
else
|
||||
colours.add (c);
|
||||
}
|
||||
|
||||
bool LookAndFeel::isColourSpecified (const int colourID) const noexcept
|
||||
{
|
||||
const ColourSetting c = { colourID, Colour() };
|
||||
return colours.contains (c);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
LookAndFeel& LookAndFeel::getDefaultLookAndFeel() noexcept
|
||||
{
|
||||
return Desktop::getInstance().getDefaultLookAndFeel();
|
||||
}
|
||||
|
||||
void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) noexcept
|
||||
{
|
||||
Desktop::getInstance().setDefaultLookAndFeel (newDefaultLookAndFeel);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Typeface::Ptr LookAndFeel::getTypefaceForFont (const Font& font)
|
||||
{
|
||||
if (font.getTypefaceName() == Font::getDefaultSansSerifFontName())
|
||||
{
|
||||
if (defaultTypeface != nullptr)
|
||||
return defaultTypeface;
|
||||
|
||||
if (defaultSans.isNotEmpty())
|
||||
{
|
||||
Font f (font);
|
||||
f.setTypefaceName (defaultSans);
|
||||
return Typeface::createSystemTypefaceFor (f);
|
||||
}
|
||||
}
|
||||
|
||||
return Font::getDefaultTypefaceForFont (font);
|
||||
}
|
||||
|
||||
void LookAndFeel::setDefaultSansSerifTypeface (Typeface::Ptr newDefaultTypeface)
|
||||
{
|
||||
if (defaultTypeface != newDefaultTypeface)
|
||||
{
|
||||
defaultTypeface = newDefaultTypeface;
|
||||
Typeface::clearTypefaceCache();
|
||||
}
|
||||
}
|
||||
|
||||
void LookAndFeel::setDefaultSansSerifTypefaceName (const String& newName)
|
||||
{
|
||||
if (defaultSans != newName)
|
||||
{
|
||||
defaultTypeface.reset();
|
||||
Typeface::clearTypefaceCache();
|
||||
defaultSans = newName;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
MouseCursor LookAndFeel::getMouseCursorFor (Component& component)
|
||||
{
|
||||
auto cursor = component.getMouseCursor();
|
||||
|
||||
for (auto* parent = component.getParentComponent();
|
||||
parent != nullptr && cursor == MouseCursor::ParentCursor;
|
||||
parent = parent->getParentComponent())
|
||||
{
|
||||
cursor = parent->getMouseCursor();
|
||||
}
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
std::unique_ptr<LowLevelGraphicsContext> LookAndFeel::createGraphicsContext (const Image& imageToRenderOn,
|
||||
Point<int> origin,
|
||||
const RectangleList<int>& initialClip)
|
||||
{
|
||||
return std::make_unique<LowLevelGraphicsSoftwareRenderer> (imageToRenderOn, origin, initialClip);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void LookAndFeel::setUsingNativeAlertWindows (bool shouldUseNativeAlerts)
|
||||
{
|
||||
useNativeAlertWindows = shouldUseNativeAlerts;
|
||||
}
|
||||
|
||||
bool LookAndFeel::isUsingNativeAlertWindows()
|
||||
{
|
||||
#if JUCE_LINUX || JUCE_BSD
|
||||
return false; // not available currently..
|
||||
#else
|
||||
return useNativeAlertWindows;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace juce
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2022 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
|
||||
Agreement and JUCE Privacy Policy.
|
||||
|
||||
End User License Agreement: www.juce.com/juce-7-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
static Typeface::Ptr getTypefaceForFontFromLookAndFeel (const Font& font)
|
||||
{
|
||||
return LookAndFeel::getDefaultLookAndFeel().getTypefaceForFont (font);
|
||||
}
|
||||
|
||||
using GetTypefaceForFont = Typeface::Ptr (*)(const Font&);
|
||||
extern GetTypefaceForFont juce_getTypefaceForFont;
|
||||
|
||||
//==============================================================================
|
||||
LookAndFeel::LookAndFeel()
|
||||
{
|
||||
/* if this fails it means you're trying to create a LookAndFeel object before
|
||||
the static Colours have been initialised. That ain't gonna work. It probably
|
||||
means that you're using a static LookAndFeel object and that your compiler has
|
||||
decided to initialise it before the Colours class.
|
||||
*/
|
||||
jassert (Colours::white == Colour (0xffffffff));
|
||||
|
||||
juce_getTypefaceForFont = getTypefaceForFontFromLookAndFeel;
|
||||
}
|
||||
|
||||
LookAndFeel::~LookAndFeel()
|
||||
{
|
||||
/* This assertion is triggered if you try to delete a LookAndFeel object while something
|
||||
is still using it!
|
||||
|
||||
Reasons may be:
|
||||
- it's still being used as the default LookAndFeel; or
|
||||
- it's set as a Component's current lookandfeel; or
|
||||
- there's a WeakReference to it somewhere else in your code
|
||||
|
||||
Generally the fix for this will be to make sure you call
|
||||
Component::setLookandFeel (nullptr) on any components that were still using
|
||||
it before you delete it, or call LookAndFeel::setDefaultLookAndFeel (nullptr)
|
||||
if you had set it up to be the default one. This assertion can also be avoided by
|
||||
declaring your LookAndFeel object before any of the Components that use it as
|
||||
the Components will be destroyed before the LookAndFeel.
|
||||
|
||||
Deleting a LookAndFeel is unlikely to cause a crash since most things will use a
|
||||
safe WeakReference to it, but it could cause some unexpected graphical behaviour,
|
||||
so it's advisable to clear up any references before destroying them!
|
||||
*/
|
||||
jassert (masterReference.getNumActiveWeakReferences() == 0
|
||||
|| (masterReference.getNumActiveWeakReferences() == 1
|
||||
&& this == &getDefaultLookAndFeel()));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Colour LookAndFeel::findColour (int colourID) const noexcept
|
||||
{
|
||||
const ColourSetting c = { colourID, Colour() };
|
||||
auto index = colours.indexOf (c);
|
||||
|
||||
if (index >= 0)
|
||||
return colours[index].colour;
|
||||
|
||||
jassertfalse;
|
||||
return Colours::black;
|
||||
}
|
||||
|
||||
void LookAndFeel::setColour (int colourID, Colour newColour) noexcept
|
||||
{
|
||||
const ColourSetting c = { colourID, newColour };
|
||||
auto index = colours.indexOf (c);
|
||||
|
||||
if (index >= 0)
|
||||
colours.getReference (index).colour = newColour;
|
||||
else
|
||||
colours.add (c);
|
||||
}
|
||||
|
||||
bool LookAndFeel::isColourSpecified (const int colourID) const noexcept
|
||||
{
|
||||
const ColourSetting c = { colourID, Colour() };
|
||||
return colours.contains (c);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
LookAndFeel& LookAndFeel::getDefaultLookAndFeel() noexcept
|
||||
{
|
||||
return Desktop::getInstance().getDefaultLookAndFeel();
|
||||
}
|
||||
|
||||
void LookAndFeel::setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) noexcept
|
||||
{
|
||||
Desktop::getInstance().setDefaultLookAndFeel (newDefaultLookAndFeel);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
Typeface::Ptr LookAndFeel::getTypefaceForFont (const Font& font)
|
||||
{
|
||||
if (font.getTypefaceName() == Font::getDefaultSansSerifFontName())
|
||||
{
|
||||
if (defaultTypeface != nullptr)
|
||||
return defaultTypeface;
|
||||
|
||||
if (defaultSans.isNotEmpty())
|
||||
{
|
||||
Font f (font);
|
||||
f.setTypefaceName (defaultSans);
|
||||
return Typeface::createSystemTypefaceFor (f);
|
||||
}
|
||||
}
|
||||
|
||||
return Font::getDefaultTypefaceForFont (font);
|
||||
}
|
||||
|
||||
void LookAndFeel::setDefaultSansSerifTypeface (Typeface::Ptr newDefaultTypeface)
|
||||
{
|
||||
if (defaultTypeface != newDefaultTypeface)
|
||||
{
|
||||
defaultTypeface = newDefaultTypeface;
|
||||
Typeface::clearTypefaceCache();
|
||||
}
|
||||
}
|
||||
|
||||
void LookAndFeel::setDefaultSansSerifTypefaceName (const String& newName)
|
||||
{
|
||||
if (defaultSans != newName)
|
||||
{
|
||||
defaultTypeface.reset();
|
||||
Typeface::clearTypefaceCache();
|
||||
defaultSans = newName;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
MouseCursor LookAndFeel::getMouseCursorFor (Component& component)
|
||||
{
|
||||
auto cursor = component.getMouseCursor();
|
||||
|
||||
for (auto* parent = component.getParentComponent();
|
||||
parent != nullptr && cursor == MouseCursor::ParentCursor;
|
||||
parent = parent->getParentComponent())
|
||||
{
|
||||
cursor = parent->getMouseCursor();
|
||||
}
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
std::unique_ptr<LowLevelGraphicsContext> LookAndFeel::createGraphicsContext (const Image& imageToRenderOn,
|
||||
Point<int> origin,
|
||||
const RectangleList<int>& initialClip)
|
||||
{
|
||||
return std::make_unique<LowLevelGraphicsSoftwareRenderer> (imageToRenderOn, origin, initialClip);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void LookAndFeel::setUsingNativeAlertWindows (bool shouldUseNativeAlerts)
|
||||
{
|
||||
useNativeAlertWindows = shouldUseNativeAlerts;
|
||||
}
|
||||
|
||||
bool LookAndFeel::isUsingNativeAlertWindows()
|
||||
{
|
||||
#if JUCE_LINUX || JUCE_BSD
|
||||
return false; // not available currently..
|
||||
#else
|
||||
return useNativeAlertWindows;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace juce
|
||||
|
@ -1,246 +1,278 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/** This class is used to hold a few look and feel base classes which are associated
|
||||
with classes that may not be present because they're from modules other than
|
||||
juce_gui_basics.
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
struct JUCE_API ExtraLookAndFeelBaseClasses
|
||||
{
|
||||
//==============================================================================
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API LassoComponentMethods
|
||||
{
|
||||
virtual ~LassoComponentMethods() = default;
|
||||
|
||||
virtual void drawLasso (Graphics&, Component& lassoComp) = 0;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API KeyMappingEditorComponentMethods
|
||||
{
|
||||
virtual ~KeyMappingEditorComponentMethods() = default;
|
||||
|
||||
virtual void drawKeymapChangeButton (Graphics&, int width, int height, Button&, const String& keyDescription) = 0;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API AudioDeviceSelectorComponentMethods
|
||||
{
|
||||
virtual ~AudioDeviceSelectorComponentMethods() = default;
|
||||
|
||||
virtual void drawLevelMeter (Graphics&, int width, int height, float level) = 0;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
LookAndFeel objects define the appearance of all the JUCE widgets, and subclasses
|
||||
can be used to apply different 'skins' to the application.
|
||||
|
||||
This class is an abstract base-class - for actual look-and-feels that you can
|
||||
instantiate, see LookAndFeel_V1, LookAndFeel_V2 and LookAndFeel_V3.
|
||||
|
||||
@see LookAndFeel_V1, LookAndFeel_V2, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel : public ScrollBar::LookAndFeelMethods,
|
||||
public Button::LookAndFeelMethods,
|
||||
public ImageButton::LookAndFeelMethods,
|
||||
public TextEditor::LookAndFeelMethods,
|
||||
public FileBrowserComponent::LookAndFeelMethods,
|
||||
public TreeView::LookAndFeelMethods,
|
||||
public BubbleComponent::LookAndFeelMethods,
|
||||
public AlertWindow::LookAndFeelMethods,
|
||||
public PopupMenu::LookAndFeelMethods,
|
||||
public ComboBox::LookAndFeelMethods,
|
||||
public Label::LookAndFeelMethods,
|
||||
public Slider::LookAndFeelMethods,
|
||||
public ResizableWindow::LookAndFeelMethods,
|
||||
public DocumentWindow::LookAndFeelMethods,
|
||||
public TooltipWindow::LookAndFeelMethods,
|
||||
public TabbedButtonBar::LookAndFeelMethods,
|
||||
public PropertyComponent::LookAndFeelMethods,
|
||||
public FilenameComponent::LookAndFeelMethods,
|
||||
public GroupComponent::LookAndFeelMethods,
|
||||
public TableHeaderComponent::LookAndFeelMethods,
|
||||
public CallOutBox::LookAndFeelMethods,
|
||||
public Toolbar::LookAndFeelMethods,
|
||||
public ConcertinaPanel::LookAndFeelMethods,
|
||||
public ProgressBar::LookAndFeelMethods,
|
||||
public StretchableLayoutResizerBar::LookAndFeelMethods,
|
||||
public ExtraLookAndFeelBaseClasses::KeyMappingEditorComponentMethods,
|
||||
public ExtraLookAndFeelBaseClasses::AudioDeviceSelectorComponentMethods,
|
||||
public ExtraLookAndFeelBaseClasses::LassoComponentMethods,
|
||||
public SidePanel::LookAndFeelMethods
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
/** Creates the default JUCE look and feel. */
|
||||
LookAndFeel();
|
||||
|
||||
/** Destructor. */
|
||||
~LookAndFeel() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the current default look-and-feel for a component to use when it
|
||||
hasn't got one explicitly set.
|
||||
|
||||
@see setDefaultLookAndFeel
|
||||
*/
|
||||
static LookAndFeel& getDefaultLookAndFeel() noexcept;
|
||||
|
||||
/** Changes the default look-and-feel.
|
||||
|
||||
@param newDefaultLookAndFeel the new look-and-feel object to use - if this is
|
||||
set to null, it will revert to using the default one. The
|
||||
object passed-in must be deleted by the caller when
|
||||
it's no longer needed.
|
||||
@see getDefaultLookAndFeel
|
||||
*/
|
||||
static void setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/** Looks for a colour that has been registered with the given colour ID number.
|
||||
|
||||
If a colour has been set for this ID number using setColour(), then it is
|
||||
returned. If none has been set, it will just return Colours::black.
|
||||
|
||||
The colour IDs for various purposes are stored as enums in the components that
|
||||
they are relevant to - for an example, see Slider::ColourIds,
|
||||
Label::ColourIds, TextEditor::ColourIds, TreeView::ColourIds, etc.
|
||||
|
||||
If you're looking up a colour for use in drawing a component, it's usually
|
||||
best not to call this directly, but to use the Component::findColour() method
|
||||
instead. That will first check whether a suitable colour has been registered
|
||||
directly with the component, and will fall-back on calling the component's
|
||||
LookAndFeel's findColour() method if none is found.
|
||||
|
||||
@see setColour, Component::findColour, Component::setColour
|
||||
*/
|
||||
Colour findColour (int colourId) const noexcept;
|
||||
|
||||
/** Registers a colour to be used for a particular purpose.
|
||||
For more details, see the comments for findColour().
|
||||
@see findColour, Component::findColour, Component::setColour
|
||||
*/
|
||||
void setColour (int colourId, Colour colour) noexcept;
|
||||
|
||||
/** Returns true if the specified colour ID has been explicitly set using the
|
||||
setColour() method.
|
||||
*/
|
||||
bool isColourSpecified (int colourId) const noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the typeface that should be used for a given font.
|
||||
The default implementation just does what you'd expect it to, but you can override
|
||||
this if you want to intercept fonts and use your own custom typeface object.
|
||||
@see setDefaultTypeface
|
||||
*/
|
||||
virtual Typeface::Ptr getTypefaceForFont (const Font&);
|
||||
|
||||
/** Allows you to supply a default typeface that will be returned as the default
|
||||
sans-serif font.
|
||||
Instead of a typeface object, you can specify a typeface by name using the
|
||||
setDefaultSansSerifTypefaceName() method.
|
||||
You can perform more complex typeface substitutions by overloading
|
||||
getTypefaceForFont() but this lets you easily set a global typeface.
|
||||
*/
|
||||
void setDefaultSansSerifTypeface (Typeface::Ptr newDefaultTypeface);
|
||||
|
||||
/** Allows you to change the default sans-serif font.
|
||||
If you need to supply your own Typeface object for any of the default fonts, rather
|
||||
than just supplying the name (e.g. if you want to use an embedded font), then
|
||||
you can instead call setDefaultSansSerifTypeface() with an object to use.
|
||||
*/
|
||||
void setDefaultSansSerifTypefaceName (const String& newName);
|
||||
|
||||
//==============================================================================
|
||||
/** Override this to get the chance to swap a component's mouse cursor for a
|
||||
customised one.
|
||||
*/
|
||||
virtual MouseCursor getMouseCursorFor (Component&);
|
||||
|
||||
//==============================================================================
|
||||
/** Creates a new graphics context object. */
|
||||
virtual std::unique_ptr<LowLevelGraphicsContext> createGraphicsContext (const Image& imageToRenderOn,
|
||||
Point<int> origin,
|
||||
const RectangleList<int>& initialClip);
|
||||
|
||||
void setUsingNativeAlertWindows (bool shouldUseNativeAlerts);
|
||||
bool isUsingNativeAlertWindows();
|
||||
|
||||
//==============================================================================
|
||||
/** Draws a small image that spins to indicate that something's happening.
|
||||
This method should use the current time to animate itself, so just keep
|
||||
repainting it every so often.
|
||||
*/
|
||||
virtual void drawSpinningWaitAnimation (Graphics&, const Colour& colour,
|
||||
int x, int y, int w, int h) = 0;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns a tick shape for use in yes/no boxes, etc. */
|
||||
virtual Path getTickShape (float height) = 0;
|
||||
/** Returns a cross shape for use in yes/no boxes, etc. */
|
||||
virtual Path getCrossShape (float height) = 0;
|
||||
|
||||
//==============================================================================
|
||||
virtual DropShadower* createDropShadowerForComponent (Component*) = 0;
|
||||
|
||||
//==============================================================================
|
||||
/** Plays the system's default 'beep' noise, to alert the user about something very important. */
|
||||
virtual void playAlertSound();
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
struct ColourSetting
|
||||
{
|
||||
int colourID;
|
||||
Colour colour;
|
||||
|
||||
bool operator< (const ColourSetting& other) const noexcept { return colourID < other.colourID; }
|
||||
bool operator== (const ColourSetting& other) const noexcept { return colourID == other.colourID; }
|
||||
};
|
||||
|
||||
SortedSet<ColourSetting> colours;
|
||||
String defaultSans, defaultSerif, defaultFixed;
|
||||
Typeface::Ptr defaultTypeface;
|
||||
bool useNativeAlertWindows = false;
|
||||
|
||||
JUCE_DECLARE_WEAK_REFERENCEABLE (LookAndFeel)
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2022 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
|
||||
Agreement and JUCE Privacy Policy.
|
||||
|
||||
End User License Agreement: www.juce.com/juce-7-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/** This class is used to hold a few look and feel base classes which are associated
|
||||
with classes that may not be present because they're from modules other than
|
||||
juce_gui_basics.
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
struct JUCE_API ExtraLookAndFeelBaseClasses
|
||||
{
|
||||
//==============================================================================
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API LassoComponentMethods
|
||||
{
|
||||
virtual ~LassoComponentMethods() = default;
|
||||
|
||||
virtual void drawLasso (Graphics&, Component& lassoComp) = 0;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API KeyMappingEditorComponentMethods
|
||||
{
|
||||
virtual ~KeyMappingEditorComponentMethods() = default;
|
||||
|
||||
virtual void drawKeymapChangeButton (Graphics&, int width, int height, Button&, const String& keyDescription) = 0;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** This abstract base class is implemented by LookAndFeel classes. */
|
||||
struct JUCE_API AudioDeviceSelectorComponentMethods
|
||||
{
|
||||
virtual ~AudioDeviceSelectorComponentMethods() = default;
|
||||
|
||||
virtual void drawLevelMeter (Graphics&, int width, int height, float level) = 0;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
LookAndFeel objects define the appearance of all the JUCE widgets, and subclasses
|
||||
can be used to apply different 'skins' to the application.
|
||||
|
||||
This class is an abstract base-class - for actual look-and-feels that you can
|
||||
instantiate, see LookAndFeel_V1, LookAndFeel_V2 and LookAndFeel_V3.
|
||||
|
||||
@see LookAndFeel_V1, LookAndFeel_V2, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel : public ScrollBar::LookAndFeelMethods,
|
||||
public Button::LookAndFeelMethods,
|
||||
public ImageButton::LookAndFeelMethods,
|
||||
public TextEditor::LookAndFeelMethods,
|
||||
public FileBrowserComponent::LookAndFeelMethods,
|
||||
public TreeView::LookAndFeelMethods,
|
||||
public BubbleComponent::LookAndFeelMethods,
|
||||
public AlertWindow::LookAndFeelMethods,
|
||||
public PopupMenu::LookAndFeelMethods,
|
||||
public ComboBox::LookAndFeelMethods,
|
||||
public Label::LookAndFeelMethods,
|
||||
public Slider::LookAndFeelMethods,
|
||||
public ResizableWindow::LookAndFeelMethods,
|
||||
public DocumentWindow::LookAndFeelMethods,
|
||||
public TooltipWindow::LookAndFeelMethods,
|
||||
public TabbedButtonBar::LookAndFeelMethods,
|
||||
public PropertyComponent::LookAndFeelMethods,
|
||||
public FilenameComponent::LookAndFeelMethods,
|
||||
public GroupComponent::LookAndFeelMethods,
|
||||
public TableHeaderComponent::LookAndFeelMethods,
|
||||
public CallOutBox::LookAndFeelMethods,
|
||||
public Toolbar::LookAndFeelMethods,
|
||||
public ConcertinaPanel::LookAndFeelMethods,
|
||||
public ProgressBar::LookAndFeelMethods,
|
||||
public StretchableLayoutResizerBar::LookAndFeelMethods,
|
||||
public ExtraLookAndFeelBaseClasses::KeyMappingEditorComponentMethods,
|
||||
public ExtraLookAndFeelBaseClasses::AudioDeviceSelectorComponentMethods,
|
||||
public ExtraLookAndFeelBaseClasses::LassoComponentMethods,
|
||||
public SidePanel::LookAndFeelMethods
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
/** Creates the default JUCE look and feel. */
|
||||
LookAndFeel();
|
||||
|
||||
/** Destructor. */
|
||||
~LookAndFeel() override;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the current default look-and-feel for a component to use when it
|
||||
hasn't got one explicitly set.
|
||||
|
||||
@see setDefaultLookAndFeel
|
||||
*/
|
||||
static LookAndFeel& getDefaultLookAndFeel() noexcept;
|
||||
|
||||
/** Changes the default look-and-feel.
|
||||
|
||||
@param newDefaultLookAndFeel the new look-and-feel object to use - if this is
|
||||
set to null, it will revert to using the default one. The
|
||||
object passed-in must be deleted by the caller when
|
||||
it's no longer needed.
|
||||
@see getDefaultLookAndFeel
|
||||
*/
|
||||
static void setDefaultLookAndFeel (LookAndFeel* newDefaultLookAndFeel) noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/** Looks for a colour that has been registered with the given colour ID number.
|
||||
|
||||
If a colour has been set for this ID number using setColour(), then it is
|
||||
returned. If none has been set, it will just return Colours::black.
|
||||
|
||||
The colour IDs for various purposes are stored as enums in the components that
|
||||
they are relevant to - for an example, see Slider::ColourIds,
|
||||
Label::ColourIds, TextEditor::ColourIds, TreeView::ColourIds, etc.
|
||||
|
||||
If you're looking up a colour for use in drawing a component, it's usually
|
||||
best not to call this directly, but to use the Component::findColour() method
|
||||
instead. That will first check whether a suitable colour has been registered
|
||||
directly with the component, and will fall-back on calling the component's
|
||||
LookAndFeel's findColour() method if none is found.
|
||||
|
||||
@see setColour, Component::findColour, Component::setColour
|
||||
*/
|
||||
Colour findColour (int colourId) const noexcept;
|
||||
|
||||
/** Registers a colour to be used for a particular purpose.
|
||||
|
||||
For more details, see the comments for findColour().
|
||||
|
||||
@see findColour, Component::findColour, Component::setColour
|
||||
*/
|
||||
void setColour (int colourId, Colour colour) noexcept;
|
||||
|
||||
/** Returns true if the specified colour ID has been explicitly set using the
|
||||
setColour() method.
|
||||
*/
|
||||
bool isColourSpecified (int colourId) const noexcept;
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the typeface that should be used for a given font.
|
||||
|
||||
The default implementation just does what you'd expect it to, but you can override
|
||||
this if you want to intercept fonts and use your own custom typeface object.
|
||||
|
||||
@see setDefaultTypeface
|
||||
*/
|
||||
virtual Typeface::Ptr getTypefaceForFont (const Font&);
|
||||
|
||||
/** Allows you to supply a default typeface that will be returned as the default
|
||||
sans-serif font.
|
||||
|
||||
Instead of a typeface object, you can specify a typeface by name using the
|
||||
setDefaultSansSerifTypefaceName() method.
|
||||
|
||||
You can perform more complex typeface substitutions by overloading
|
||||
getTypefaceForFont() but this lets you easily set a global typeface.
|
||||
*/
|
||||
void setDefaultSansSerifTypeface (Typeface::Ptr newDefaultTypeface);
|
||||
|
||||
/** Allows you to change the default sans-serif font.
|
||||
|
||||
If you need to supply your own Typeface object for any of the default fonts, rather
|
||||
than just supplying the name (e.g. if you want to use an embedded font), then
|
||||
you can instead call setDefaultSansSerifTypeface() with an object to use.
|
||||
*/
|
||||
void setDefaultSansSerifTypefaceName (const String& newName);
|
||||
|
||||
//==============================================================================
|
||||
/** Sets whether native alert windows (if available) or standard JUCE AlertWindows
|
||||
drawn with AlertWindow::LookAndFeelMethods will be used.
|
||||
|
||||
@see isUsingNativeAlertWindows
|
||||
*/
|
||||
void setUsingNativeAlertWindows (bool shouldUseNativeAlerts);
|
||||
|
||||
/** Returns true if native alert windows will be used (if available).
|
||||
|
||||
The default setting for this is false.
|
||||
|
||||
@see setUsingNativeAlertWindows
|
||||
*/
|
||||
bool isUsingNativeAlertWindows();
|
||||
|
||||
//==============================================================================
|
||||
/** Draws a small image that spins to indicate that something's happening.
|
||||
|
||||
This method should use the current time to animate itself, so just keep
|
||||
repainting it every so often.
|
||||
*/
|
||||
virtual void drawSpinningWaitAnimation (Graphics&, const Colour& colour,
|
||||
int x, int y, int w, int h) = 0;
|
||||
|
||||
/** Returns a tick shape for use in yes/no boxes, etc. */
|
||||
virtual Path getTickShape (float height) = 0;
|
||||
|
||||
/** Returns a cross shape for use in yes/no boxes, etc. */
|
||||
virtual Path getCrossShape (float height) = 0;
|
||||
|
||||
/** Creates a drop-shadower for a given component, if required.
|
||||
|
||||
@see DropShadower
|
||||
*/
|
||||
virtual std::unique_ptr<DropShadower> createDropShadowerForComponent (Component&) = 0;
|
||||
|
||||
/** Creates a focus outline for a given component, if required.
|
||||
|
||||
@see FocusOutline
|
||||
*/
|
||||
virtual std::unique_ptr<FocusOutline> createFocusOutlineForComponent (Component&) = 0;
|
||||
|
||||
//==============================================================================
|
||||
/** Override this to get the chance to swap a component's mouse cursor for a
|
||||
customised one.
|
||||
|
||||
@see MouseCursor
|
||||
*/
|
||||
virtual MouseCursor getMouseCursorFor (Component&);
|
||||
|
||||
/** Creates a new graphics context object. */
|
||||
virtual std::unique_ptr<LowLevelGraphicsContext> createGraphicsContext (const Image& imageToRenderOn,
|
||||
Point<int> origin,
|
||||
const RectangleList<int>& initialClip);
|
||||
|
||||
/** Plays the system's default 'beep' noise, to alert the user about something
|
||||
very important. This is only supported on some platforms.
|
||||
*/
|
||||
virtual void playAlertSound();
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
struct ColourSetting
|
||||
{
|
||||
int colourID;
|
||||
Colour colour;
|
||||
|
||||
bool operator< (const ColourSetting& other) const noexcept { return colourID < other.colourID; }
|
||||
bool operator== (const ColourSetting& other) const noexcept { return colourID == other.colourID; }
|
||||
};
|
||||
|
||||
SortedSet<ColourSetting> colours;
|
||||
String defaultSans, defaultSerif, defaultFixed;
|
||||
Typeface::Ptr defaultTypeface;
|
||||
bool useNativeAlertWindows = false;
|
||||
|
||||
JUCE_DECLARE_WEAK_REFERENCEABLE (LookAndFeel)
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,105 +1,105 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
The original JUCE look-and-feel, as used back from 2002 to about 2007ish.
|
||||
@see LookAndFeel, LookAndFeel_V2, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V1 : public LookAndFeel_V2
|
||||
{
|
||||
public:
|
||||
LookAndFeel_V1();
|
||||
~LookAndFeel_V1() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawToggleButton (Graphics&, ToggleButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawTickBox (Graphics&, Component&, float x, float y, float w, float h,
|
||||
bool ticked, bool isEnabled,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawProgressBar (Graphics&, ProgressBar&, int width, int height,
|
||||
double progress, const String& textToShow) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawScrollbarButton (Graphics&, ScrollBar&, int width, int height,
|
||||
int buttonDirection, bool isScrollbarVertical,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height,
|
||||
bool isScrollbarVertical, int thumbStartPosition, int thumbSize,
|
||||
bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
ImageEffectFilter* getScrollbarEffect() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPopupMenuBackground (Graphics&, int width, int height) override;
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH, ComboBox&) override;
|
||||
|
||||
Font getComboBoxFont (ComboBox&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
int getSliderThumbRadius (Slider&) override;
|
||||
Button* createSliderButton (Slider&, bool isIncrement) override;
|
||||
ImageEffectFilter* getSliderEffect (Slider&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCornerResizer (Graphics&, int w, int h, bool isMouseOver, bool isMouseDragging) override;
|
||||
|
||||
Button* createDocumentWindowButton (int buttonType) override;
|
||||
|
||||
void positionDocumentWindowButtons (DocumentWindow&,
|
||||
int titleBarX, int titleBarY, int titleBarW, int titleBarH,
|
||||
Button* minimiseButton, Button* maximiseButton, Button* closeButton,
|
||||
bool positionTitleBarButtonsOnLeft) override;
|
||||
|
||||
private:
|
||||
DropShadowEffect scrollbarShadow;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V1)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2022 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
|
||||
Agreement and JUCE Privacy Policy.
|
||||
|
||||
End User License Agreement: www.juce.com/juce-7-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
The original JUCE look-and-feel, as used back from 2002 to about 2007ish.
|
||||
@see LookAndFeel, LookAndFeel_V2, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V1 : public LookAndFeel_V2
|
||||
{
|
||||
public:
|
||||
LookAndFeel_V1();
|
||||
~LookAndFeel_V1() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawToggleButton (Graphics&, ToggleButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawTickBox (Graphics&, Component&, float x, float y, float w, float h,
|
||||
bool ticked, bool isEnabled,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawProgressBar (Graphics&, ProgressBar&, int width, int height,
|
||||
double progress, const String& textToShow) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawScrollbarButton (Graphics&, ScrollBar&, int width, int height,
|
||||
int buttonDirection, bool isScrollbarVertical,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height,
|
||||
bool isScrollbarVertical, int thumbStartPosition, int thumbSize,
|
||||
bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
ImageEffectFilter* getScrollbarEffect() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPopupMenuBackground (Graphics&, int width, int height) override;
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH, ComboBox&) override;
|
||||
|
||||
Font getComboBoxFont (ComboBox&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
int getSliderThumbRadius (Slider&) override;
|
||||
Button* createSliderButton (Slider&, bool isIncrement) override;
|
||||
ImageEffectFilter* getSliderEffect (Slider&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCornerResizer (Graphics&, int w, int h, bool isMouseOver, bool isMouseDragging) override;
|
||||
|
||||
Button* createDocumentWindowButton (int buttonType) override;
|
||||
|
||||
void positionDocumentWindowButtons (DocumentWindow&,
|
||||
int titleBarX, int titleBarY, int titleBarW, int titleBarH,
|
||||
Button* minimiseButton, Button* maximiseButton, Button* closeButton,
|
||||
bool positionTitleBarButtonsOnLeft) override;
|
||||
|
||||
private:
|
||||
DropShadowEffect scrollbarShadow;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V1)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,426 +1,427 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
This LookAndFeel subclass implements the juce style from around 2008-12.
|
||||
|
||||
@see LookAndFeel, LookAndFeel_V1, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V2 : public LookAndFeel
|
||||
{
|
||||
public:
|
||||
LookAndFeel_V2();
|
||||
~LookAndFeel_V2() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
Font getTextButtonFont (TextButton&, int buttonHeight) override;
|
||||
|
||||
void drawButtonText (Graphics&, TextButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
int getTextButtonWidthToFitText (TextButton&, int buttonHeight) override;
|
||||
|
||||
void drawToggleButton (Graphics&, ToggleButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void changeToggleButtonWidthToFitText (ToggleButton&) override;
|
||||
|
||||
void drawTickBox (Graphics&, Component&,
|
||||
float x, float y, float w, float h,
|
||||
bool ticked, bool isEnabled,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawDrawableButton (Graphics&, DrawableButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
//==============================================================================
|
||||
AlertWindow* createAlertWindow (const String& title, const String& message,
|
||||
const String& button1,
|
||||
const String& button2,
|
||||
const String& button3,
|
||||
MessageBoxIconType iconType,
|
||||
int numButtons, Component* associatedComponent) override;
|
||||
|
||||
void drawAlertBox (Graphics&, AlertWindow&, const Rectangle<int>& textArea, TextLayout&) override;
|
||||
int getAlertBoxWindowFlags() override;
|
||||
|
||||
Array<int> getWidthsForTextButtons (AlertWindow&, const Array<TextButton*>&) override;
|
||||
int getAlertWindowButtonHeight() override;
|
||||
|
||||
/** Override this function to supply a custom font for the alert window title.
|
||||
This default implementation will use a boldened and slightly larger version
|
||||
of the alert window message font.
|
||||
|
||||
@see getAlertWindowMessageFont.
|
||||
*/
|
||||
Font getAlertWindowTitleFont() override;
|
||||
|
||||
/** Override this function to supply a custom font for the alert window message.
|
||||
This default implementation will use the default font with height set to 15.0f.
|
||||
|
||||
@see getAlertWindowTitleFont
|
||||
*/
|
||||
Font getAlertWindowMessageFont() override;
|
||||
|
||||
Font getAlertWindowFont() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String& textToShow) override;
|
||||
void drawSpinningWaitAnimation (Graphics&, const Colour& colour, int x, int y, int w, int h) override;
|
||||
bool isProgressBarOpaque (ProgressBar&) override;
|
||||
|
||||
//==============================================================================
|
||||
bool areScrollbarButtonsVisible() override;
|
||||
void drawScrollbarButton (Graphics&, ScrollBar&, int width, int height, int buttonDirection,
|
||||
bool isScrollbarVertical, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height,
|
||||
bool isScrollbarVertical, int thumbStartPosition, int thumbSize,
|
||||
bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
ImageEffectFilter* getScrollbarEffect() override;
|
||||
int getMinimumScrollbarThumbSize (ScrollBar&) override;
|
||||
int getDefaultScrollbarWidth() override;
|
||||
int getScrollbarButtonSize (ScrollBar&) override;
|
||||
|
||||
//==============================================================================
|
||||
Path getTickShape (float height) override;
|
||||
Path getCrossShape (float height) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTreeviewPlusMinusBox (Graphics&, const Rectangle<float>& area,
|
||||
Colour backgroundColour, bool isOpen, bool isMouseOver) override;
|
||||
bool areLinesDrawnForTreeView (TreeView&) override;
|
||||
int getTreeViewIndentSize (TreeView&) override;
|
||||
|
||||
//==============================================================================
|
||||
void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override;
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
CaretComponent* createCaretComponent (Component* keyFocusOwner) override;
|
||||
|
||||
//==============================================================================
|
||||
const Drawable* getDefaultFolderImage() override;
|
||||
const Drawable* getDefaultDocumentFileImage() override;
|
||||
|
||||
AttributedString createFileChooserHeaderText (const String& title, const String& instructions) override;
|
||||
|
||||
void drawFileBrowserRow (Graphics&, int width, int height,
|
||||
const File& file, const String& filename, Image* icon,
|
||||
const String& fileSizeDescription, const String& fileTimeDescription,
|
||||
bool isDirectory, bool isItemSelected, int itemIndex,
|
||||
DirectoryContentsDisplayComponent&) override;
|
||||
|
||||
Button* createFileBrowserGoUpButton() override;
|
||||
|
||||
void layoutFileBrowserComponent (FileBrowserComponent&,
|
||||
DirectoryContentsDisplayComponent*,
|
||||
FilePreviewComponent*,
|
||||
ComboBox* currentPathBox,
|
||||
TextEditor* filenameBox,
|
||||
Button* goUpButton) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawBubble (Graphics&, BubbleComponent&, const Point<float>& tip, const Rectangle<float>& body) override;
|
||||
|
||||
void drawLasso (Graphics&, Component&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPopupMenuBackground (Graphics&, int width, int height) override;
|
||||
void drawPopupMenuBackgroundWithOptions (Graphics&,
|
||||
int width,
|
||||
int height,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
void drawPopupMenuItem (Graphics&, const Rectangle<int>& area,
|
||||
bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu,
|
||||
const String& text, const String& shortcutKeyText,
|
||||
const Drawable* icon, const Colour* textColour) override;
|
||||
|
||||
void drawPopupMenuItemWithOptions (Graphics&, const Rectangle<int>& area,
|
||||
bool isHighlighted,
|
||||
const PopupMenu::Item& item,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
void drawPopupMenuSectionHeader (Graphics&, const Rectangle<int>& area,
|
||||
const String& sectionName) override;
|
||||
|
||||
void drawPopupMenuSectionHeaderWithOptions (Graphics&, const Rectangle<int>& area,
|
||||
const String& sectionName,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
Font getPopupMenuFont() override;
|
||||
|
||||
void drawPopupMenuUpDownArrow (Graphics&, int width, int height, bool isScrollUpArrow) override;
|
||||
|
||||
void drawPopupMenuUpDownArrowWithOptions (Graphics&,
|
||||
int width, int height,
|
||||
bool isScrollUpArrow,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
void getIdealPopupMenuItemSize (const String& text, bool isSeparator, int standardMenuItemHeight,
|
||||
int& idealWidth, int& idealHeight) override;
|
||||
|
||||
void getIdealPopupMenuItemSizeWithOptions (const String& text,
|
||||
bool isSeparator,
|
||||
int standardMenuItemHeight,
|
||||
int& idealWidth,
|
||||
int& idealHeight,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
int getMenuWindowFlags() override;
|
||||
void preparePopupMenuWindow (Component&) override;
|
||||
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
|
||||
int getMenuBarItemWidth (MenuBarComponent&, int itemIndex, const String& itemText) override;
|
||||
Font getMenuBarFont (MenuBarComponent&, int itemIndex, const String& itemText) override;
|
||||
int getDefaultMenuBarHeight() override;
|
||||
|
||||
void drawMenuBarItem (Graphics&, int width, int height,
|
||||
int itemIndex, const String& itemText,
|
||||
bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar,
|
||||
MenuBarComponent&) override;
|
||||
|
||||
Component* getParentComponentForMenuOptions (const PopupMenu::Options& options) override;
|
||||
|
||||
bool shouldPopupMenuScaleWithTargetComponent (const PopupMenu::Options& options) override;
|
||||
|
||||
int getPopupMenuBorderSize() override;
|
||||
|
||||
int getPopupMenuBorderSizeWithOptions (const PopupMenu::Options&) override;
|
||||
|
||||
void drawPopupMenuColumnSeparatorWithOptions (Graphics& g,
|
||||
const Rectangle<int>& bounds,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
int getPopupMenuColumnSeparatorWidthWithOptions (const PopupMenu::Options&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawComboBox (Graphics&, int width, int height, bool isMouseButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH,
|
||||
ComboBox&) override;
|
||||
Font getComboBoxFont (ComboBox&) override;
|
||||
Label* createComboBoxTextBox (ComboBox&) override;
|
||||
void positionComboBoxText (ComboBox&, Label&, Drawable*) override;
|
||||
PopupMenu::Options getOptionsForComboBoxPopupMenu (ComboBox&, Label&) override;
|
||||
void drawComboBoxTextWhenNothingSelected (Graphics&, ComboBox&, Label&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLabel (Graphics&, Label&) override;
|
||||
Font getLabelFont (Label&) override;
|
||||
BorderSize<int> getLabelBorderSize (Label&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawLinearSliderBackground (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawLinearSliderThumb (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawRotarySlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPosProportional, float rotaryStartAngle, float rotaryEndAngle,
|
||||
Slider&) override;
|
||||
|
||||
int getSliderThumbRadius (Slider&) override;
|
||||
Button* createSliderButton (Slider&, bool isIncrement) override;
|
||||
Label* createSliderTextBox (Slider&) override;
|
||||
ImageEffectFilter* getSliderEffect (Slider&) override;
|
||||
Font getSliderPopupFont (Slider&) override;
|
||||
int getSliderPopupPlacement (Slider&) override;
|
||||
Slider::SliderLayout getSliderLayout (Slider&) override;
|
||||
|
||||
//==============================================================================
|
||||
Rectangle<int> getTooltipBounds (const String& tipText, Point<int> screenPos, Rectangle<int> parentArea) override;
|
||||
void drawTooltip (Graphics&, const String& text, int width, int height) override;
|
||||
|
||||
//==============================================================================
|
||||
Button* createFilenameComponentBrowseButton (const String& text) override;
|
||||
void layoutFilenameComponent (FilenameComponent&, ComboBox* filenameBox, Button* browseButton) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area,
|
||||
bool isMouseOver, bool isMouseDown,
|
||||
ConcertinaPanel&, Component& panel) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCornerResizer (Graphics&, int w, int h, bool isMouseOver, bool isMouseDragging) override;
|
||||
void drawResizableFrame (Graphics&, int w, int h, const BorderSize<int>&) override;
|
||||
|
||||
//==============================================================================
|
||||
void fillResizableWindowBackground (Graphics&, int w, int h, const BorderSize<int>&, ResizableWindow&) override;
|
||||
void drawResizableWindowBorder (Graphics&, int w, int h, const BorderSize<int>& border, ResizableWindow&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawDocumentWindowTitleBar (DocumentWindow&, Graphics&, int w, int h,
|
||||
int titleSpaceX, int titleSpaceW,
|
||||
const Image* icon, bool drawTitleTextOnLeft) override;
|
||||
|
||||
Button* createDocumentWindowButton (int buttonType) override;
|
||||
|
||||
void positionDocumentWindowButtons (DocumentWindow&,
|
||||
int titleBarX, int titleBarY, int titleBarW, int titleBarH,
|
||||
Button* minimiseButton,
|
||||
Button* maximiseButton,
|
||||
Button* closeButton,
|
||||
bool positionTitleBarButtonsOnLeft) override;
|
||||
|
||||
//==============================================================================
|
||||
DropShadower* createDropShadowerForComponent (Component*) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawStretchableLayoutResizerBar (Graphics&, int w, int h, bool isVerticalBar,
|
||||
bool isMouseOver, bool isMouseDragging) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawGroupComponentOutline (Graphics&, int w, int h, const String& text,
|
||||
const Justification&, GroupComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
int getTabButtonSpaceAroundImage() override;
|
||||
int getTabButtonOverlap (int tabDepth) override;
|
||||
int getTabButtonBestWidth (TabBarButton&, int tabDepth) override;
|
||||
Rectangle<int> getTabButtonExtraComponentBounds (const TabBarButton&, Rectangle<int>& textArea, Component& extraComp) override;
|
||||
|
||||
void drawTabButton (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override;
|
||||
Font getTabButtonFont (TabBarButton&, float height) override;
|
||||
void drawTabButtonText (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override;
|
||||
void drawTabbedButtonBarBackground (TabbedButtonBar&, Graphics&) override;
|
||||
void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int w, int h) override;
|
||||
|
||||
void createTabButtonShape (TabBarButton&, Path&, bool isMouseOver, bool isMouseDown) override;
|
||||
void fillTabButtonShape (TabBarButton&, Graphics&, const Path&, bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
Button* createTabBarExtrasButton() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawImageButton (Graphics&, Image*,
|
||||
int imageX, int imageY, int imageW, int imageH,
|
||||
const Colour& overlayColour, float imageOpacity, ImageButton&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTableHeaderBackground (Graphics&, TableHeaderComponent&) override;
|
||||
|
||||
void drawTableHeaderColumn (Graphics&, TableHeaderComponent&, const String& columnName,
|
||||
int columnId, int width, int height, bool isMouseOver,
|
||||
bool isMouseDown, int columnFlags) override;
|
||||
|
||||
//==============================================================================
|
||||
void paintToolbarBackground (Graphics&, int width, int height, Toolbar&) override;
|
||||
|
||||
Button* createToolbarMissingItemsButton (Toolbar&) override;
|
||||
|
||||
void paintToolbarButtonBackground (Graphics&, int width, int height,
|
||||
bool isMouseOver, bool isMouseDown,
|
||||
ToolbarItemComponent&) override;
|
||||
|
||||
void paintToolbarButtonLabel (Graphics&, int x, int y, int width, int height,
|
||||
const String& text, ToolbarItemComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPropertyPanelSectionHeader (Graphics&, const String& name, bool isOpen, int width, int height) override;
|
||||
void drawPropertyComponentBackground (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override;
|
||||
int getPropertyPanelSectionHeaderHeight (const String& sectionTitle) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path& path, Image& cachedImage) override;
|
||||
int getCallOutBoxBorderSize (const CallOutBox&) override;
|
||||
float getCallOutBoxCornerSize (const CallOutBox&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLevelMeter (Graphics&, int width, int height, float level) override;
|
||||
|
||||
void drawKeymapChangeButton (Graphics&, int width, int height, Button&, const String& keyDescription) override;
|
||||
|
||||
//==============================================================================
|
||||
Font getSidePanelTitleFont (SidePanel&) override;
|
||||
Justification getSidePanelTitleJustification (SidePanel&) override;
|
||||
Path getSidePanelDismissButtonShape (SidePanel&) override;
|
||||
|
||||
//==============================================================================
|
||||
/** Draws a 3D raised (or indented) bevel using two colours.
|
||||
|
||||
The bevel is drawn inside the given rectangle, and greater bevel thicknesses
|
||||
extend inwards.
|
||||
|
||||
The top-left colour is used for the top- and left-hand edges of the
|
||||
bevel; the bottom-right colour is used for the bottom- and right-hand
|
||||
edges.
|
||||
|
||||
If useGradient is true, then the bevel fades out to make it look more curved
|
||||
and less angular. If sharpEdgeOnOutside is true, the outside of the bevel is
|
||||
sharp, and it fades towards the centre; if sharpEdgeOnOutside is false, then
|
||||
the centre edges are sharp and it fades towards the outside.
|
||||
*/
|
||||
static void drawBevel (Graphics&,
|
||||
int x, int y, int width, int height,
|
||||
int bevelThickness,
|
||||
const Colour& topLeftColour = Colours::white,
|
||||
const Colour& bottomRightColour = Colours::black,
|
||||
bool useGradient = true,
|
||||
bool sharpEdgeOnOutside = true);
|
||||
|
||||
/** Utility function to draw a shiny, glassy circle (for round LED-type buttons). */
|
||||
static void drawGlassSphere (Graphics&, float x, float y, float diameter,
|
||||
const Colour&, float outlineThickness) noexcept;
|
||||
|
||||
static void drawGlassPointer (Graphics&, float x, float y, float diameter,
|
||||
const Colour&, float outlineThickness, int direction) noexcept;
|
||||
|
||||
/** Utility function to draw a shiny, glassy oblong (for text buttons). */
|
||||
static void drawGlassLozenge (Graphics&,
|
||||
float x, float y, float width, float height,
|
||||
const Colour&, float outlineThickness, float cornerSize,
|
||||
bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
std::unique_ptr<Drawable> folderImage, documentImage;
|
||||
|
||||
void drawShinyButtonShape (Graphics&,
|
||||
float x, float y, float w, float h, float maxCornerSize,
|
||||
const Colour&, float strokeWidth,
|
||||
bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept;
|
||||
|
||||
class GlassWindowButton;
|
||||
class SliderLabelComp;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V2)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2022 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
|
||||
Agreement and JUCE Privacy Policy.
|
||||
|
||||
End User License Agreement: www.juce.com/juce-7-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
This LookAndFeel subclass implements the juce style from around 2008-12.
|
||||
|
||||
@see LookAndFeel, LookAndFeel_V1, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V2 : public LookAndFeel
|
||||
{
|
||||
public:
|
||||
LookAndFeel_V2();
|
||||
~LookAndFeel_V2() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
Font getTextButtonFont (TextButton&, int buttonHeight) override;
|
||||
|
||||
void drawButtonText (Graphics&, TextButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
int getTextButtonWidthToFitText (TextButton&, int buttonHeight) override;
|
||||
|
||||
void drawToggleButton (Graphics&, ToggleButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void changeToggleButtonWidthToFitText (ToggleButton&) override;
|
||||
|
||||
void drawTickBox (Graphics&, Component&,
|
||||
float x, float y, float w, float h,
|
||||
bool ticked, bool isEnabled,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawDrawableButton (Graphics&, DrawableButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
//==============================================================================
|
||||
AlertWindow* createAlertWindow (const String& title, const String& message,
|
||||
const String& button1,
|
||||
const String& button2,
|
||||
const String& button3,
|
||||
MessageBoxIconType iconType,
|
||||
int numButtons, Component* associatedComponent) override;
|
||||
|
||||
void drawAlertBox (Graphics&, AlertWindow&, const Rectangle<int>& textArea, TextLayout&) override;
|
||||
int getAlertBoxWindowFlags() override;
|
||||
|
||||
Array<int> getWidthsForTextButtons (AlertWindow&, const Array<TextButton*>&) override;
|
||||
int getAlertWindowButtonHeight() override;
|
||||
|
||||
/** Override this function to supply a custom font for the alert window title.
|
||||
This default implementation will use a boldened and slightly larger version
|
||||
of the alert window message font.
|
||||
|
||||
@see getAlertWindowMessageFont.
|
||||
*/
|
||||
Font getAlertWindowTitleFont() override;
|
||||
|
||||
/** Override this function to supply a custom font for the alert window message.
|
||||
This default implementation will use the default font with height set to 15.0f.
|
||||
|
||||
@see getAlertWindowTitleFont
|
||||
*/
|
||||
Font getAlertWindowMessageFont() override;
|
||||
|
||||
Font getAlertWindowFont() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String& textToShow) override;
|
||||
void drawSpinningWaitAnimation (Graphics&, const Colour& colour, int x, int y, int w, int h) override;
|
||||
bool isProgressBarOpaque (ProgressBar&) override;
|
||||
|
||||
//==============================================================================
|
||||
bool areScrollbarButtonsVisible() override;
|
||||
void drawScrollbarButton (Graphics&, ScrollBar&, int width, int height, int buttonDirection,
|
||||
bool isScrollbarVertical, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height,
|
||||
bool isScrollbarVertical, int thumbStartPosition, int thumbSize,
|
||||
bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
ImageEffectFilter* getScrollbarEffect() override;
|
||||
int getMinimumScrollbarThumbSize (ScrollBar&) override;
|
||||
int getDefaultScrollbarWidth() override;
|
||||
int getScrollbarButtonSize (ScrollBar&) override;
|
||||
|
||||
//==============================================================================
|
||||
Path getTickShape (float height) override;
|
||||
Path getCrossShape (float height) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTreeviewPlusMinusBox (Graphics&, const Rectangle<float>& area,
|
||||
Colour backgroundColour, bool isOpen, bool isMouseOver) override;
|
||||
bool areLinesDrawnForTreeView (TreeView&) override;
|
||||
int getTreeViewIndentSize (TreeView&) override;
|
||||
|
||||
//==============================================================================
|
||||
void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override;
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
CaretComponent* createCaretComponent (Component* keyFocusOwner) override;
|
||||
|
||||
//==============================================================================
|
||||
const Drawable* getDefaultFolderImage() override;
|
||||
const Drawable* getDefaultDocumentFileImage() override;
|
||||
|
||||
AttributedString createFileChooserHeaderText (const String& title, const String& instructions) override;
|
||||
|
||||
void drawFileBrowserRow (Graphics&, int width, int height,
|
||||
const File& file, const String& filename, Image* icon,
|
||||
const String& fileSizeDescription, const String& fileTimeDescription,
|
||||
bool isDirectory, bool isItemSelected, int itemIndex,
|
||||
DirectoryContentsDisplayComponent&) override;
|
||||
|
||||
Button* createFileBrowserGoUpButton() override;
|
||||
|
||||
void layoutFileBrowserComponent (FileBrowserComponent&,
|
||||
DirectoryContentsDisplayComponent*,
|
||||
FilePreviewComponent*,
|
||||
ComboBox* currentPathBox,
|
||||
TextEditor* filenameBox,
|
||||
Button* goUpButton) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawBubble (Graphics&, BubbleComponent&, const Point<float>& tip, const Rectangle<float>& body) override;
|
||||
|
||||
void drawLasso (Graphics&, Component&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPopupMenuBackground (Graphics&, int width, int height) override;
|
||||
void drawPopupMenuBackgroundWithOptions (Graphics&,
|
||||
int width,
|
||||
int height,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
void drawPopupMenuItem (Graphics&, const Rectangle<int>& area,
|
||||
bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu,
|
||||
const String& text, const String& shortcutKeyText,
|
||||
const Drawable* icon, const Colour* textColour) override;
|
||||
|
||||
void drawPopupMenuItemWithOptions (Graphics&, const Rectangle<int>& area,
|
||||
bool isHighlighted,
|
||||
const PopupMenu::Item& item,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
void drawPopupMenuSectionHeader (Graphics&, const Rectangle<int>& area,
|
||||
const String& sectionName) override;
|
||||
|
||||
void drawPopupMenuSectionHeaderWithOptions (Graphics&, const Rectangle<int>& area,
|
||||
const String& sectionName,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
Font getPopupMenuFont() override;
|
||||
|
||||
void drawPopupMenuUpDownArrow (Graphics&, int width, int height, bool isScrollUpArrow) override;
|
||||
|
||||
void drawPopupMenuUpDownArrowWithOptions (Graphics&,
|
||||
int width, int height,
|
||||
bool isScrollUpArrow,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
void getIdealPopupMenuItemSize (const String& text, bool isSeparator, int standardMenuItemHeight,
|
||||
int& idealWidth, int& idealHeight) override;
|
||||
|
||||
void getIdealPopupMenuItemSizeWithOptions (const String& text,
|
||||
bool isSeparator,
|
||||
int standardMenuItemHeight,
|
||||
int& idealWidth,
|
||||
int& idealHeight,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
int getMenuWindowFlags() override;
|
||||
void preparePopupMenuWindow (Component&) override;
|
||||
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
|
||||
int getMenuBarItemWidth (MenuBarComponent&, int itemIndex, const String& itemText) override;
|
||||
Font getMenuBarFont (MenuBarComponent&, int itemIndex, const String& itemText) override;
|
||||
int getDefaultMenuBarHeight() override;
|
||||
|
||||
void drawMenuBarItem (Graphics&, int width, int height,
|
||||
int itemIndex, const String& itemText,
|
||||
bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar,
|
||||
MenuBarComponent&) override;
|
||||
|
||||
Component* getParentComponentForMenuOptions (const PopupMenu::Options& options) override;
|
||||
|
||||
bool shouldPopupMenuScaleWithTargetComponent (const PopupMenu::Options& options) override;
|
||||
|
||||
int getPopupMenuBorderSize() override;
|
||||
|
||||
int getPopupMenuBorderSizeWithOptions (const PopupMenu::Options&) override;
|
||||
|
||||
void drawPopupMenuColumnSeparatorWithOptions (Graphics& g,
|
||||
const Rectangle<int>& bounds,
|
||||
const PopupMenu::Options&) override;
|
||||
|
||||
int getPopupMenuColumnSeparatorWidthWithOptions (const PopupMenu::Options&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawComboBox (Graphics&, int width, int height, bool isMouseButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH,
|
||||
ComboBox&) override;
|
||||
Font getComboBoxFont (ComboBox&) override;
|
||||
Label* createComboBoxTextBox (ComboBox&) override;
|
||||
void positionComboBoxText (ComboBox&, Label&) override;
|
||||
PopupMenu::Options getOptionsForComboBoxPopupMenu (ComboBox&, Label&) override;
|
||||
void drawComboBoxTextWhenNothingSelected (Graphics&, ComboBox&, Label&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLabel (Graphics&, Label&) override;
|
||||
Font getLabelFont (Label&) override;
|
||||
BorderSize<int> getLabelBorderSize (Label&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawLinearSliderBackground (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawLinearSliderThumb (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawRotarySlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPosProportional, float rotaryStartAngle, float rotaryEndAngle,
|
||||
Slider&) override;
|
||||
|
||||
int getSliderThumbRadius (Slider&) override;
|
||||
Button* createSliderButton (Slider&, bool isIncrement) override;
|
||||
Label* createSliderTextBox (Slider&) override;
|
||||
ImageEffectFilter* getSliderEffect (Slider&) override;
|
||||
Font getSliderPopupFont (Slider&) override;
|
||||
int getSliderPopupPlacement (Slider&) override;
|
||||
Slider::SliderLayout getSliderLayout (Slider&) override;
|
||||
|
||||
//==============================================================================
|
||||
Rectangle<int> getTooltipBounds (const String& tipText, Point<int> screenPos, Rectangle<int> parentArea) override;
|
||||
void drawTooltip (Graphics&, const String& text, int width, int height) override;
|
||||
|
||||
//==============================================================================
|
||||
Button* createFilenameComponentBrowseButton (const String& text) override;
|
||||
void layoutFilenameComponent (FilenameComponent&, ComboBox* filenameBox, Button* browseButton) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area,
|
||||
bool isMouseOver, bool isMouseDown,
|
||||
ConcertinaPanel&, Component& panel) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCornerResizer (Graphics&, int w, int h, bool isMouseOver, bool isMouseDragging) override;
|
||||
void drawResizableFrame (Graphics&, int w, int h, const BorderSize<int>&) override;
|
||||
|
||||
//==============================================================================
|
||||
void fillResizableWindowBackground (Graphics&, int w, int h, const BorderSize<int>&, ResizableWindow&) override;
|
||||
void drawResizableWindowBorder (Graphics&, int w, int h, const BorderSize<int>& border, ResizableWindow&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawDocumentWindowTitleBar (DocumentWindow&, Graphics&, int w, int h,
|
||||
int titleSpaceX, int titleSpaceW,
|
||||
const Image* icon, bool drawTitleTextOnLeft) override;
|
||||
|
||||
Button* createDocumentWindowButton (int buttonType) override;
|
||||
|
||||
void positionDocumentWindowButtons (DocumentWindow&,
|
||||
int titleBarX, int titleBarY, int titleBarW, int titleBarH,
|
||||
Button* minimiseButton,
|
||||
Button* maximiseButton,
|
||||
Button* closeButton,
|
||||
bool positionTitleBarButtonsOnLeft) override;
|
||||
|
||||
//==============================================================================
|
||||
std::unique_ptr<DropShadower> createDropShadowerForComponent (Component&) override;
|
||||
std::unique_ptr<FocusOutline> createFocusOutlineForComponent (Component&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawStretchableLayoutResizerBar (Graphics&, int w, int h, bool isVerticalBar,
|
||||
bool isMouseOver, bool isMouseDragging) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawGroupComponentOutline (Graphics&, int w, int h, const String& text,
|
||||
const Justification&, GroupComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
int getTabButtonSpaceAroundImage() override;
|
||||
int getTabButtonOverlap (int tabDepth) override;
|
||||
int getTabButtonBestWidth (TabBarButton&, int tabDepth) override;
|
||||
Rectangle<int> getTabButtonExtraComponentBounds (const TabBarButton&, Rectangle<int>& textArea, Component& extraComp) override;
|
||||
|
||||
void drawTabButton (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override;
|
||||
Font getTabButtonFont (TabBarButton&, float height) override;
|
||||
void drawTabButtonText (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override;
|
||||
void drawTabbedButtonBarBackground (TabbedButtonBar&, Graphics&) override;
|
||||
void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int w, int h) override;
|
||||
|
||||
void createTabButtonShape (TabBarButton&, Path&, bool isMouseOver, bool isMouseDown) override;
|
||||
void fillTabButtonShape (TabBarButton&, Graphics&, const Path&, bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
Button* createTabBarExtrasButton() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawImageButton (Graphics&, Image*,
|
||||
int imageX, int imageY, int imageW, int imageH,
|
||||
const Colour& overlayColour, float imageOpacity, ImageButton&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTableHeaderBackground (Graphics&, TableHeaderComponent&) override;
|
||||
|
||||
void drawTableHeaderColumn (Graphics&, TableHeaderComponent&, const String& columnName,
|
||||
int columnId, int width, int height, bool isMouseOver,
|
||||
bool isMouseDown, int columnFlags) override;
|
||||
|
||||
//==============================================================================
|
||||
void paintToolbarBackground (Graphics&, int width, int height, Toolbar&) override;
|
||||
|
||||
Button* createToolbarMissingItemsButton (Toolbar&) override;
|
||||
|
||||
void paintToolbarButtonBackground (Graphics&, int width, int height,
|
||||
bool isMouseOver, bool isMouseDown,
|
||||
ToolbarItemComponent&) override;
|
||||
|
||||
void paintToolbarButtonLabel (Graphics&, int x, int y, int width, int height,
|
||||
const String& text, ToolbarItemComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPropertyPanelSectionHeader (Graphics&, const String& name, bool isOpen, int width, int height) override;
|
||||
void drawPropertyComponentBackground (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override;
|
||||
int getPropertyPanelSectionHeaderHeight (const String& sectionTitle) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path& path, Image& cachedImage) override;
|
||||
int getCallOutBoxBorderSize (const CallOutBox&) override;
|
||||
float getCallOutBoxCornerSize (const CallOutBox&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLevelMeter (Graphics&, int width, int height, float level) override;
|
||||
|
||||
void drawKeymapChangeButton (Graphics&, int width, int height, Button&, const String& keyDescription) override;
|
||||
|
||||
//==============================================================================
|
||||
Font getSidePanelTitleFont (SidePanel&) override;
|
||||
Justification getSidePanelTitleJustification (SidePanel&) override;
|
||||
Path getSidePanelDismissButtonShape (SidePanel&) override;
|
||||
|
||||
//==============================================================================
|
||||
/** Draws a 3D raised (or indented) bevel using two colours.
|
||||
|
||||
The bevel is drawn inside the given rectangle, and greater bevel thicknesses
|
||||
extend inwards.
|
||||
|
||||
The top-left colour is used for the top- and left-hand edges of the
|
||||
bevel; the bottom-right colour is used for the bottom- and right-hand
|
||||
edges.
|
||||
|
||||
If useGradient is true, then the bevel fades out to make it look more curved
|
||||
and less angular. If sharpEdgeOnOutside is true, the outside of the bevel is
|
||||
sharp, and it fades towards the centre; if sharpEdgeOnOutside is false, then
|
||||
the centre edges are sharp and it fades towards the outside.
|
||||
*/
|
||||
static void drawBevel (Graphics&,
|
||||
int x, int y, int width, int height,
|
||||
int bevelThickness,
|
||||
const Colour& topLeftColour = Colours::white,
|
||||
const Colour& bottomRightColour = Colours::black,
|
||||
bool useGradient = true,
|
||||
bool sharpEdgeOnOutside = true);
|
||||
|
||||
/** Utility function to draw a shiny, glassy circle (for round LED-type buttons). */
|
||||
static void drawGlassSphere (Graphics&, float x, float y, float diameter,
|
||||
const Colour&, float outlineThickness) noexcept;
|
||||
|
||||
static void drawGlassPointer (Graphics&, float x, float y, float diameter,
|
||||
const Colour&, float outlineThickness, int direction) noexcept;
|
||||
|
||||
/** Utility function to draw a shiny, glassy oblong (for text buttons). */
|
||||
static void drawGlassLozenge (Graphics&,
|
||||
float x, float y, float width, float height,
|
||||
const Colour&, float outlineThickness, float cornerSize,
|
||||
bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
std::unique_ptr<Drawable> folderImage, documentImage;
|
||||
|
||||
void drawShinyButtonShape (Graphics&,
|
||||
float x, float y, float w, float h, float maxCornerSize,
|
||||
const Colour&, float strokeWidth,
|
||||
bool flatOnLeft, bool flatOnRight, bool flatOnTop, bool flatOnBottom) noexcept;
|
||||
|
||||
class GlassWindowButton;
|
||||
class SliderLabelComp;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V2)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,98 +1,98 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
The latest JUCE look-and-feel style, as introduced in 2013.
|
||||
@see LookAndFeel, LookAndFeel_V1, LookAndFeel_V2
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V3 : public LookAndFeel_V2
|
||||
{
|
||||
public:
|
||||
LookAndFeel_V3();
|
||||
~LookAndFeel_V3() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawTableHeaderBackground (Graphics&, TableHeaderComponent&) override;
|
||||
|
||||
void drawTreeviewPlusMinusBox (Graphics&, const Rectangle<float>& area,
|
||||
Colour backgroundColour, bool isOpen, bool isMouseOver) override;
|
||||
bool areLinesDrawnForTreeView (TreeView&) override;
|
||||
int getTreeViewIndentSize (TreeView&) override;
|
||||
|
||||
Button* createDocumentWindowButton (int buttonType) override;
|
||||
|
||||
void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH, ComboBox& box) override;
|
||||
|
||||
void drawKeymapChangeButton (Graphics&, int width, int height, Button& button, const String& keyDescription) override;
|
||||
|
||||
void drawPopupMenuBackground (Graphics&, int width, int height) override;
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool, MenuBarComponent&) override;
|
||||
|
||||
int getTabButtonOverlap (int tabDepth) override;
|
||||
int getTabButtonSpaceAroundImage() override;
|
||||
void drawTabButton (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override;
|
||||
void drawTabAreaBehindFrontButton (TabbedButtonBar& bar, Graphics& g, int w, int h) override;
|
||||
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
|
||||
void drawStretchableLayoutResizerBar (Graphics&, int w, int h, bool isVerticalBar, bool isMouseOver, bool isMouseDragging) override;
|
||||
|
||||
bool areScrollbarButtonsVisible() override;
|
||||
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height, bool isScrollbarVertical,
|
||||
int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawLinearSliderBackground (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area, bool isMouseOver, bool isMouseDown,
|
||||
ConcertinaPanel&, Component&) override;
|
||||
|
||||
Path getTickShape (float height) override;
|
||||
Path getCrossShape (float height) override;
|
||||
|
||||
static void createTabTextLayout (const TabBarButton& button, float length, float depth, Colour colour, TextLayout&);
|
||||
|
||||
private:
|
||||
Image backgroundTexture;
|
||||
Colour backgroundTextureBaseColour;
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2022 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
|
||||
Agreement and JUCE Privacy Policy.
|
||||
|
||||
End User License Agreement: www.juce.com/juce-7-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
The latest JUCE look-and-feel style, as introduced in 2013.
|
||||
@see LookAndFeel, LookAndFeel_V1, LookAndFeel_V2
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V3 : public LookAndFeel_V2
|
||||
{
|
||||
public:
|
||||
LookAndFeel_V3();
|
||||
~LookAndFeel_V3() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawTableHeaderBackground (Graphics&, TableHeaderComponent&) override;
|
||||
|
||||
void drawTreeviewPlusMinusBox (Graphics&, const Rectangle<float>& area,
|
||||
Colour backgroundColour, bool isOpen, bool isMouseOver) override;
|
||||
bool areLinesDrawnForTreeView (TreeView&) override;
|
||||
int getTreeViewIndentSize (TreeView&) override;
|
||||
|
||||
Button* createDocumentWindowButton (int buttonType) override;
|
||||
|
||||
void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH, ComboBox& box) override;
|
||||
|
||||
void drawKeymapChangeButton (Graphics&, int width, int height, Button& button, const String& keyDescription) override;
|
||||
|
||||
void drawPopupMenuBackground (Graphics&, int width, int height) override;
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool, MenuBarComponent&) override;
|
||||
|
||||
int getTabButtonOverlap (int tabDepth) override;
|
||||
int getTabButtonSpaceAroundImage() override;
|
||||
void drawTabButton (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override;
|
||||
void drawTabAreaBehindFrontButton (TabbedButtonBar& bar, Graphics& g, int w, int h) override;
|
||||
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
|
||||
void drawStretchableLayoutResizerBar (Graphics&, int w, int h, bool isVerticalBar, bool isMouseOver, bool isMouseDragging) override;
|
||||
|
||||
bool areScrollbarButtonsVisible() override;
|
||||
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height, bool isScrollbarVertical,
|
||||
int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawLinearSliderBackground (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area, bool isMouseOver, bool isMouseDown,
|
||||
ConcertinaPanel&, Component&) override;
|
||||
|
||||
Path getTickShape (float height) override;
|
||||
Path getCrossShape (float height) override;
|
||||
|
||||
static void createTabTextLayout (const TabBarButton& button, float length, float depth, Colour colour, TextLayout&);
|
||||
|
||||
private:
|
||||
Image backgroundTexture;
|
||||
Colour backgroundTextureBaseColour;
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,258 +1,258 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
The latest JUCE look-and-feel style, as introduced in 2017.
|
||||
@see LookAndFeel, LookAndFeel_V1, LookAndFeel_V2, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V4 : public LookAndFeel_V3
|
||||
{
|
||||
public:
|
||||
/**
|
||||
A struct containing the set of colours to apply to the GUI
|
||||
*/
|
||||
class ColourScheme
|
||||
{
|
||||
public:
|
||||
/** The standard set of colours to use. */
|
||||
enum UIColour
|
||||
{
|
||||
windowBackground = 0,
|
||||
widgetBackground,
|
||||
menuBackground,
|
||||
outline,
|
||||
defaultText,
|
||||
defaultFill,
|
||||
highlightedText,
|
||||
highlightedFill,
|
||||
menuText,
|
||||
|
||||
numColours
|
||||
};
|
||||
|
||||
template <typename... ItemColours>
|
||||
ColourScheme (ItemColours... coloursToUse)
|
||||
{
|
||||
static_assert (sizeof... (coloursToUse) == numColours, "Must supply one colour for each UIColour item");
|
||||
const Colour c[] = { Colour (coloursToUse)... };
|
||||
|
||||
for (int i = 0; i < numColours; ++i)
|
||||
palette[i] = c[i];
|
||||
}
|
||||
|
||||
ColourScheme (const ColourScheme&) = default;
|
||||
ColourScheme& operator= (const ColourScheme&) = default;
|
||||
|
||||
/** Returns a colour from the scheme */
|
||||
Colour getUIColour (UIColour colourToGet) const noexcept;
|
||||
|
||||
/** Sets a scheme colour. */
|
||||
void setUIColour (UIColour colourToSet, Colour newColour) noexcept;
|
||||
|
||||
/** Returns true if two ColourPalette objects contain the same colours. */
|
||||
bool operator== (const ColourScheme&) const noexcept;
|
||||
/** Returns false if two ColourPalette objects contain the same colours. */
|
||||
bool operator!= (const ColourScheme&) const noexcept;
|
||||
|
||||
private:
|
||||
Colour palette[numColours];
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** Creates a LookAndFeel_V4 object with a default colour scheme. */
|
||||
LookAndFeel_V4();
|
||||
|
||||
/** Creates a LookAndFeel_V4 object with a given colour scheme. */
|
||||
LookAndFeel_V4 (ColourScheme);
|
||||
|
||||
/** Destructor. */
|
||||
~LookAndFeel_V4() override;
|
||||
|
||||
//==============================================================================
|
||||
void setColourScheme (ColourScheme);
|
||||
ColourScheme& getCurrentColourScheme() noexcept { return currentColourScheme; }
|
||||
|
||||
static ColourScheme getDarkColourScheme();
|
||||
static ColourScheme getMidnightColourScheme();
|
||||
static ColourScheme getGreyColourScheme();
|
||||
static ColourScheme getLightColourScheme();
|
||||
|
||||
//==============================================================================
|
||||
Button* createDocumentWindowButton (int) override;
|
||||
void positionDocumentWindowButtons (DocumentWindow&, int, int, int, int, Button*, Button*, Button*, bool) override;
|
||||
void drawDocumentWindowTitleBar (DocumentWindow&, Graphics&, int, int, int, int, const Image*, bool) override;
|
||||
|
||||
//==============================================================================
|
||||
Font getTextButtonFont (TextButton&, int buttonHeight) override;
|
||||
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawToggleButton (Graphics&, ToggleButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
void drawTickBox (Graphics&, Component&,
|
||||
float x, float y, float w, float h,
|
||||
bool ticked, bool isEnabled,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void changeToggleButtonWidthToFitText (ToggleButton&) override;
|
||||
|
||||
//==============================================================================
|
||||
AlertWindow* createAlertWindow (const String& title, const String& message,
|
||||
const String& button1,
|
||||
const String& button2,
|
||||
const String& button3,
|
||||
MessageBoxIconType iconType,
|
||||
int numButtons, Component* associatedComponent) override;
|
||||
void drawAlertBox (Graphics&, AlertWindow&, const Rectangle<int>& textArea, TextLayout&) override;
|
||||
|
||||
int getAlertWindowButtonHeight() override;
|
||||
Font getAlertWindowTitleFont() override;
|
||||
Font getAlertWindowMessageFont() override;
|
||||
Font getAlertWindowFont() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String& textToShow) override;
|
||||
bool isProgressBarOpaque (ProgressBar&) override { return false; }
|
||||
|
||||
//==============================================================================
|
||||
int getDefaultScrollbarWidth() override;
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height, bool isScrollbarVertical,
|
||||
int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
//==============================================================================
|
||||
Path getTickShape (float height) override;
|
||||
Path getCrossShape (float height) override;
|
||||
|
||||
//==============================================================================
|
||||
void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override;
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
|
||||
//==============================================================================
|
||||
Button* createFileBrowserGoUpButton() override;
|
||||
|
||||
void layoutFileBrowserComponent (FileBrowserComponent&,
|
||||
DirectoryContentsDisplayComponent*,
|
||||
FilePreviewComponent*,
|
||||
ComboBox* currentPathBox,
|
||||
TextEditor* filenameBox,
|
||||
Button* goUpButton) override;
|
||||
|
||||
void drawFileBrowserRow (Graphics&, int width, int height,
|
||||
const File& file, const String& filename, Image* icon,
|
||||
const String& fileSizeDescription, const String& fileTimeDescription,
|
||||
bool isDirectory, bool isItemSelected, int itemIndex,
|
||||
DirectoryContentsDisplayComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPopupMenuItem (Graphics&, const Rectangle<int>& area,
|
||||
bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu,
|
||||
const String& text, const String& shortcutKeyText,
|
||||
const Drawable* icon, const Colour* textColour) override;
|
||||
|
||||
void getIdealPopupMenuItemSize (const String& text, bool isSeparator, int standardMenuItemHeight,
|
||||
int& idealWidth, int& idealHeight) override;
|
||||
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
|
||||
|
||||
void drawMenuBarItem (Graphics&, int width, int height,
|
||||
int itemIndex, const String& itemText,
|
||||
bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar,
|
||||
MenuBarComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH,
|
||||
ComboBox&) override;
|
||||
Font getComboBoxFont (ComboBox&) override;
|
||||
void positionComboBoxText (ComboBox&, Label&, Drawable*) override;
|
||||
|
||||
//==============================================================================
|
||||
int getSliderThumbRadius (Slider&) override;
|
||||
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawRotarySlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPosProportional, float rotaryStartAngle,
|
||||
float rotaryEndAngle, Slider&) override;
|
||||
|
||||
void drawPointer (Graphics&, float x, float y, float diameter,
|
||||
const Colour&, int direction) noexcept;
|
||||
|
||||
Label* createSliderTextBox (Slider&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTooltip (Graphics&, const String& text, int width, int height) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area,
|
||||
bool isMouseOver, bool isMouseDown,
|
||||
ConcertinaPanel&, Component& panel) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLevelMeter (Graphics&, int, int, float) override;
|
||||
|
||||
//==============================================================================
|
||||
void paintToolbarBackground (Graphics&, int width, int height, Toolbar&) override;
|
||||
|
||||
void paintToolbarButtonLabel (Graphics&, int x, int y, int width, int height,
|
||||
const String& text, ToolbarItemComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPropertyPanelSectionHeader (Graphics&, const String& name, bool isOpen, int width, int height) override;
|
||||
void drawPropertyComponentBackground (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawStretchableLayoutResizerBar (Graphics&, int, int, bool, bool, bool) override;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
void drawLinearProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String&);
|
||||
void drawCircularProgressBar (Graphics&, ProgressBar&, const String&);
|
||||
|
||||
int getPropertyComponentIndent (PropertyComponent&);
|
||||
|
||||
//==============================================================================
|
||||
void initialiseColours();
|
||||
ColourScheme currentColourScheme;
|
||||
|
||||
//==============================================================================
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V4)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2022 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
|
||||
Agreement and JUCE Privacy Policy.
|
||||
|
||||
End User License Agreement: www.juce.com/juce-7-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
The latest JUCE look-and-feel style, as introduced in 2017.
|
||||
@see LookAndFeel, LookAndFeel_V1, LookAndFeel_V2, LookAndFeel_V3
|
||||
|
||||
@tags{GUI}
|
||||
*/
|
||||
class JUCE_API LookAndFeel_V4 : public LookAndFeel_V3
|
||||
{
|
||||
public:
|
||||
/**
|
||||
A struct containing the set of colours to apply to the GUI
|
||||
*/
|
||||
class ColourScheme
|
||||
{
|
||||
public:
|
||||
/** The standard set of colours to use. */
|
||||
enum UIColour
|
||||
{
|
||||
windowBackground = 0,
|
||||
widgetBackground,
|
||||
menuBackground,
|
||||
outline,
|
||||
defaultText,
|
||||
defaultFill,
|
||||
highlightedText,
|
||||
highlightedFill,
|
||||
menuText,
|
||||
|
||||
numColours
|
||||
};
|
||||
|
||||
template <typename... ItemColours>
|
||||
ColourScheme (ItemColours... coloursToUse)
|
||||
{
|
||||
static_assert (sizeof... (coloursToUse) == numColours, "Must supply one colour for each UIColour item");
|
||||
const Colour c[] = { Colour (coloursToUse)... };
|
||||
|
||||
for (int i = 0; i < numColours; ++i)
|
||||
palette[i] = c[i];
|
||||
}
|
||||
|
||||
ColourScheme (const ColourScheme&) = default;
|
||||
ColourScheme& operator= (const ColourScheme&) = default;
|
||||
|
||||
/** Returns a colour from the scheme */
|
||||
Colour getUIColour (UIColour colourToGet) const noexcept;
|
||||
|
||||
/** Sets a scheme colour. */
|
||||
void setUIColour (UIColour colourToSet, Colour newColour) noexcept;
|
||||
|
||||
/** Returns true if two ColourPalette objects contain the same colours. */
|
||||
bool operator== (const ColourScheme&) const noexcept;
|
||||
/** Returns false if two ColourPalette objects contain the same colours. */
|
||||
bool operator!= (const ColourScheme&) const noexcept;
|
||||
|
||||
private:
|
||||
Colour palette[numColours];
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** Creates a LookAndFeel_V4 object with a default colour scheme. */
|
||||
LookAndFeel_V4();
|
||||
|
||||
/** Creates a LookAndFeel_V4 object with a given colour scheme. */
|
||||
LookAndFeel_V4 (ColourScheme);
|
||||
|
||||
/** Destructor. */
|
||||
~LookAndFeel_V4() override;
|
||||
|
||||
//==============================================================================
|
||||
void setColourScheme (ColourScheme);
|
||||
ColourScheme& getCurrentColourScheme() noexcept { return currentColourScheme; }
|
||||
|
||||
static ColourScheme getDarkColourScheme();
|
||||
static ColourScheme getMidnightColourScheme();
|
||||
static ColourScheme getGreyColourScheme();
|
||||
static ColourScheme getLightColourScheme();
|
||||
|
||||
//==============================================================================
|
||||
Button* createDocumentWindowButton (int) override;
|
||||
void positionDocumentWindowButtons (DocumentWindow&, int, int, int, int, Button*, Button*, Button*, bool) override;
|
||||
void drawDocumentWindowTitleBar (DocumentWindow&, Graphics&, int, int, int, int, const Image*, bool) override;
|
||||
|
||||
//==============================================================================
|
||||
Font getTextButtonFont (TextButton&, int buttonHeight) override;
|
||||
|
||||
void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void drawToggleButton (Graphics&, ToggleButton&,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
void drawTickBox (Graphics&, Component&,
|
||||
float x, float y, float w, float h,
|
||||
bool ticked, bool isEnabled,
|
||||
bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
|
||||
|
||||
void changeToggleButtonWidthToFitText (ToggleButton&) override;
|
||||
|
||||
//==============================================================================
|
||||
AlertWindow* createAlertWindow (const String& title, const String& message,
|
||||
const String& button1,
|
||||
const String& button2,
|
||||
const String& button3,
|
||||
MessageBoxIconType iconType,
|
||||
int numButtons, Component* associatedComponent) override;
|
||||
void drawAlertBox (Graphics&, AlertWindow&, const Rectangle<int>& textArea, TextLayout&) override;
|
||||
|
||||
int getAlertWindowButtonHeight() override;
|
||||
Font getAlertWindowTitleFont() override;
|
||||
Font getAlertWindowMessageFont() override;
|
||||
Font getAlertWindowFont() override;
|
||||
|
||||
//==============================================================================
|
||||
void drawProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String& textToShow) override;
|
||||
bool isProgressBarOpaque (ProgressBar&) override { return false; }
|
||||
|
||||
//==============================================================================
|
||||
int getDefaultScrollbarWidth() override;
|
||||
void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height, bool isScrollbarVertical,
|
||||
int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override;
|
||||
|
||||
//==============================================================================
|
||||
Path getTickShape (float height) override;
|
||||
Path getCrossShape (float height) override;
|
||||
|
||||
//==============================================================================
|
||||
void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override;
|
||||
void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
|
||||
|
||||
//==============================================================================
|
||||
Button* createFileBrowserGoUpButton() override;
|
||||
|
||||
void layoutFileBrowserComponent (FileBrowserComponent&,
|
||||
DirectoryContentsDisplayComponent*,
|
||||
FilePreviewComponent*,
|
||||
ComboBox* currentPathBox,
|
||||
TextEditor* filenameBox,
|
||||
Button* goUpButton) override;
|
||||
|
||||
void drawFileBrowserRow (Graphics&, int width, int height,
|
||||
const File& file, const String& filename, Image* icon,
|
||||
const String& fileSizeDescription, const String& fileTimeDescription,
|
||||
bool isDirectory, bool isItemSelected, int itemIndex,
|
||||
DirectoryContentsDisplayComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPopupMenuItem (Graphics&, const Rectangle<int>& area,
|
||||
bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu,
|
||||
const String& text, const String& shortcutKeyText,
|
||||
const Drawable* icon, const Colour* textColour) override;
|
||||
|
||||
void getIdealPopupMenuItemSize (const String& text, bool isSeparator, int standardMenuItemHeight,
|
||||
int& idealWidth, int& idealHeight) override;
|
||||
|
||||
void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
|
||||
|
||||
void drawMenuBarItem (Graphics&, int width, int height,
|
||||
int itemIndex, const String& itemText,
|
||||
bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar,
|
||||
MenuBarComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
|
||||
int buttonX, int buttonY, int buttonW, int buttonH,
|
||||
ComboBox&) override;
|
||||
Font getComboBoxFont (ComboBox&) override;
|
||||
void positionComboBoxText (ComboBox&, Label&) override;
|
||||
|
||||
//==============================================================================
|
||||
int getSliderThumbRadius (Slider&) override;
|
||||
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPos, float minSliderPos, float maxSliderPos,
|
||||
const Slider::SliderStyle, Slider&) override;
|
||||
|
||||
void drawRotarySlider (Graphics&, int x, int y, int width, int height,
|
||||
float sliderPosProportional, float rotaryStartAngle,
|
||||
float rotaryEndAngle, Slider&) override;
|
||||
|
||||
void drawPointer (Graphics&, float x, float y, float diameter,
|
||||
const Colour&, int direction) noexcept;
|
||||
|
||||
Label* createSliderTextBox (Slider&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawTooltip (Graphics&, const String& text, int width, int height) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area,
|
||||
bool isMouseOver, bool isMouseDown,
|
||||
ConcertinaPanel&, Component& panel) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLevelMeter (Graphics&, int, int, float) override;
|
||||
|
||||
//==============================================================================
|
||||
void paintToolbarBackground (Graphics&, int width, int height, Toolbar&) override;
|
||||
|
||||
void paintToolbarButtonLabel (Graphics&, int x, int y, int width, int height,
|
||||
const String& text, ToolbarItemComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawPropertyPanelSectionHeader (Graphics&, const String& name, bool isOpen, int width, int height) override;
|
||||
void drawPropertyComponentBackground (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override;
|
||||
Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawStretchableLayoutResizerBar (Graphics&, int, int, bool, bool, bool) override;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
void drawLinearProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String&);
|
||||
void drawCircularProgressBar (Graphics&, ProgressBar&, const String&);
|
||||
|
||||
int getPropertyComponentIndent (PropertyComponent&);
|
||||
|
||||
//==============================================================================
|
||||
void initialiseColours();
|
||||
ColourScheme currentColourScheme;
|
||||
|
||||
//==============================================================================
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V4)
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
Reference in New Issue
Block a user