1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Viewport component listener fix. Minor clean-ups.

This commit is contained in:
jules 2012-01-30 12:59:36 +00:00
parent c539feabd5
commit 36bd285c4b
22 changed files with 27 additions and 24 deletions

View file

@ -114,7 +114,7 @@ double ColourGradient::getColourPosition (const int index) const noexcept
return 0;
}
const Colour ColourGradient::getColour (const int index) const noexcept
Colour ColourGradient::getColour (const int index) const noexcept
{
if (isPositiveAndBelow (index, colours.size()))
return colours.getReference (index).colour;

View file

@ -112,7 +112,7 @@ public:
/** Returns the colour that was added with a given index.
The index is from 0 to getNumColours() - 1.
*/
const Colour getColour (int index) const noexcept;
Colour getColour (int index) const noexcept;
/** Changes the colour at a given index.
The index is from 0 to getNumColours() - 1.

View file

@ -168,8 +168,8 @@ const Colour Colours::yellow (0xffffff00);
const Colour Colours::yellowgreen (0xff9acd32);
//==============================================================================
const Colour Colours::findColourForName (const String& colourName,
const Colour& defaultColour)
Colour Colours::findColourForName (const String& colourName,
const Colour& defaultColour)
{
static const int presets[] =
{

View file

@ -95,8 +95,8 @@ public:
if a match is found, that colour is returned. If no match is found, the
colour passed in as the defaultColour parameter is returned.
*/
static JUCE_API const Colour findColourForName (const String& colourName,
const Colour& defaultColour);
static JUCE_API Colour findColourForName (const String& colourName,
const Colour& defaultColour);
private:
//==============================================================================

View file

@ -373,7 +373,7 @@ Image::BitmapData::~BitmapData()
{
}
const Colour Image::BitmapData::getPixelColour (const int x, const int y) const noexcept
Colour Image::BitmapData::getPixelColour (const int x, const int y) const noexcept
{
jassert (isPositiveAndBelow (x, width) && isPositiveAndBelow (y, height));

View file

@ -338,7 +338,7 @@ public:
For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's
repsonsibility to make sure they're within the image's size.
*/
const Colour getPixelColour (int x, int y) const noexcept;
Colour getPixelColour (int x, int y) const noexcept;
/** Sets the colour of a given pixel.
For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's

View file

@ -2071,7 +2071,7 @@ void Component::sendLookAndFeelChange()
}
}
const Colour Component::findColour (const int colourId, const bool inheritFromParent) const
Colour Component::findColour (const int colourId, const bool inheritFromParent) const
{
const var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId));

View file

@ -2061,7 +2061,7 @@ public:
@see setColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour
*/
const Colour findColour (int colourId, bool inheritFromParent = false) const;
Colour findColour (int colourId, bool inheritFromParent = false) const;
/** Registers a colour to be used for a particular purpose.

View file

@ -203,7 +203,7 @@ void DrawableImage::ValueTreeWrapper::setOpacity (float newOpacity, UndoManager*
state.setProperty (opacity, newOpacity, undoManager);
}
const Colour DrawableImage::ValueTreeWrapper::getOverlayColour() const
Colour DrawableImage::ValueTreeWrapper::getOverlayColour() const
{
return Colour::fromString (state [overlay].toString());
}

View file

@ -113,7 +113,7 @@ public:
void setOpacity (float newOpacity, UndoManager* undoManager);
Value getOpacityValue (UndoManager* undoManager);
const Colour getOverlayColour() const;
Colour getOverlayColour() const;
void setOverlayColour (const Colour& newColour, UndoManager* undoManager);
Value getOverlayColourValue (UndoManager* undoManager);

View file

@ -1070,7 +1070,7 @@ private:
}
//==============================================================================
static const Colour parseColour (const String& s, int& index, const Colour& defaultColour)
static Colour parseColour (const String& s, int& index, const Colour& defaultColour)
{
if (s [index] == '#')
{

View file

@ -450,7 +450,7 @@ void TabbedButtonBar::resized()
}
//==============================================================================
const Colour TabbedButtonBar::getTabBackgroundColour (const int tabIndex)
Colour TabbedButtonBar::getTabBackgroundColour (const int tabIndex)
{
TabInfo* const tab = tabs [tabIndex];
return tab == nullptr ? Colours::white : tab->colour;

View file

@ -234,7 +234,7 @@ public:
This is the colour that was specified in addTab().
*/
const Colour getTabBackgroundColour (int tabIndex);
Colour getTabBackgroundColour (int tabIndex);
/** Changes the background colour of a tab.

View file

@ -72,7 +72,7 @@ public:
owner.popupMenuClickOnTab (tabIndex, tabName);
}
const Colour getTabBackgroundColour (const int tabIndex)
Colour getTabBackgroundColour (const int tabIndex)
{
return owner.tabs->getTabBackgroundColour (tabIndex);
}
@ -192,7 +192,7 @@ Component* TabbedComponent::getTabContentComponent (const int tabIndex) const no
return contentComponents [tabIndex];
}
const Colour TabbedComponent::getTabBackgroundColour (const int tabIndex) const noexcept
Colour TabbedComponent::getTabBackgroundColour (const int tabIndex) const noexcept
{
return tabs->getTabBackgroundColour (tabIndex);
}

View file

@ -138,7 +138,7 @@ public:
Component* getTabContentComponent (int tabIndex) const noexcept;
/** Returns the colour of one of the tabs. */
const Colour getTabBackgroundColour (int tabIndex) const noexcept;
Colour getTabBackgroundColour (int tabIndex) const noexcept;
/** Changes the background colour of one of the tabs. */
void setTabBackgroundColour (int tabIndex, const Colour& newColour);

View file

@ -63,6 +63,9 @@ void Viewport::viewedComponentChanged (Component*) {}
//==============================================================================
void Viewport::deleteContentComp()
{
if (contentComp != nullptr)
contentComp->removeComponentListener (this);
if (deleteContent)
{
// This sets the content comp to a null pointer before deleting the old one, in case

View file

@ -268,7 +268,7 @@ LookAndFeel::~LookAndFeel()
}
//==============================================================================
const Colour LookAndFeel::findColour (const int colourId) const noexcept
Colour LookAndFeel::findColour (const int colourId) const noexcept
{
const int index = colourIds.indexOf (colourId);

View file

@ -111,7 +111,7 @@ public:
@see setColour, Component::findColour, Component::setColour
*/
const Colour findColour (int colourId) const noexcept;
Colour findColour (int colourId) const noexcept;
/** Registers a colour to be used for a particular purpose.

View file

@ -402,7 +402,7 @@ void ResizableWindow::lookAndFeelChanged()
}
}
const Colour ResizableWindow::getBackgroundColour() const noexcept
Colour ResizableWindow::getBackgroundColour() const noexcept
{
return findColour (backgroundColourId, false);
}

View file

@ -94,7 +94,7 @@ public:
@see setBackgroundColour
*/
const Colour getBackgroundColour() const noexcept;
Colour getBackgroundColour() const noexcept;
/** Changes the colour currently being used for the window's background.

View file

@ -1109,7 +1109,7 @@ void CodeEditorComponent::setColourForTokenType (const int tokenType, const Colo
repaint();
}
const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const
Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const
{
if (! isPositiveAndBelow (tokenType, coloursForTokenCategories.size()))
return findColour (CodeEditorComponent::defaultTextColourId);

View file

@ -191,7 +191,7 @@ public:
CodeTokeniser::getTokenTypes() to get a list of the token types.
@see setColourForTokenType
*/
const Colour getColourForTokenType (int tokenType) const;
Colour getColourForTokenType (int tokenType) const;
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the editor.