@@ -308,7 +308,7 @@ namespace CodeHelpers | |||||
return "Colour (0x" + hexString8Digits ((int) col.getARGB()) + ')'; | return "Colour (0x" + hexString8Digits ((int) col.getARGB()) + ')'; | ||||
} | } | ||||
String justificationToCode (const Justification& justification) | |||||
String justificationToCode (Justification justification) | |||||
{ | { | ||||
switch (justification.getFlags()) | switch (justification.getFlags()) | ||||
{ | { | ||||
@@ -42,7 +42,7 @@ namespace CodeHelpers | |||||
String boolLiteral (bool value); | String boolLiteral (bool value); | ||||
String colourToCode (Colour col); | String colourToCode (Colour col); | ||||
String justificationToCode (const Justification&); | |||||
String justificationToCode (Justification); | |||||
String alignFunctionCallParams (const String& call, const StringArray& parameters, int maxLineLength); | String alignFunctionCallParams (const String& call, const StringArray& parameters, int maxLineLength); | ||||
@@ -222,7 +222,7 @@ Font Graphics::getCurrentFont() const | |||||
//============================================================================== | //============================================================================== | ||||
void Graphics::drawSingleLineText (const String& text, const int startX, const int baselineY, | void Graphics::drawSingleLineText (const String& text, const int startX, const int baselineY, | ||||
const Justification& justification) const | |||||
Justification justification) const | |||||
{ | { | ||||
if (text.isNotEmpty() | if (text.isNotEmpty() | ||||
&& startX < context.getClipBounds().getRight()) | && startX < context.getClipBounds().getRight()) | ||||
@@ -266,7 +266,7 @@ void Graphics::drawMultiLineText (const String& text, const int startX, | |||||
} | } | ||||
void Graphics::drawText (const String& text, const Rectangle<int>& area, | void Graphics::drawText (const String& text, const Rectangle<int>& area, | ||||
const Justification& justificationType, | |||||
Justification justificationType, | |||||
const bool useEllipsesIfTooBig) const | const bool useEllipsesIfTooBig) const | ||||
{ | { | ||||
if (text.isNotEmpty() && context.clipRegionIntersects (area)) | if (text.isNotEmpty() && context.clipRegionIntersects (area)) | ||||
@@ -285,14 +285,14 @@ void Graphics::drawText (const String& text, const Rectangle<int>& area, | |||||
} | } | ||||
void Graphics::drawText (const String& text, const int x, const int y, const int width, const int height, | void Graphics::drawText (const String& text, const int x, const int y, const int width, const int height, | ||||
const Justification& justificationType, | |||||
Justification justificationType, | |||||
const bool useEllipsesIfTooBig) const | const bool useEllipsesIfTooBig) const | ||||
{ | { | ||||
drawText (text, Rectangle<int> (x, y, width, height), justificationType, useEllipsesIfTooBig); | drawText (text, Rectangle<int> (x, y, width, height), justificationType, useEllipsesIfTooBig); | ||||
} | } | ||||
void Graphics::drawFittedText (const String& text, const Rectangle<int>& area, | void Graphics::drawFittedText (const String& text, const Rectangle<int>& area, | ||||
const Justification& justification, | |||||
Justification justification, | |||||
const int maximumNumberOfLines, | const int maximumNumberOfLines, | ||||
const float minimumHorizontalScale) const | const float minimumHorizontalScale) const | ||||
{ | { | ||||
@@ -311,7 +311,7 @@ void Graphics::drawFittedText (const String& text, const Rectangle<int>& area, | |||||
} | } | ||||
void Graphics::drawFittedText (const String& text, const int x, const int y, const int width, const int height, | void Graphics::drawFittedText (const String& text, const int x, const int y, const int width, const int height, | ||||
const Justification& justification, | |||||
Justification justification, | |||||
const int maximumNumberOfLines, | const int maximumNumberOfLines, | ||||
const float minimumHorizontalScale) const | const float minimumHorizontalScale) const | ||||
{ | { | ||||
@@ -144,7 +144,7 @@ public: | |||||
*/ | */ | ||||
void drawSingleLineText (const String& text, | void drawSingleLineText (const String& text, | ||||
int startX, int baselineY, | int startX, int baselineY, | ||||
const Justification& justification = Justification::left) const; | |||||
Justification justification = Justification::left) const; | |||||
/** Draws text across multiple lines. | /** Draws text across multiple lines. | ||||
@@ -169,7 +169,7 @@ public: | |||||
*/ | */ | ||||
void drawText (const String& text, | void drawText (const String& text, | ||||
int x, int y, int width, int height, | int x, int y, int width, int height, | ||||
const Justification& justificationType, | |||||
Justification justificationType, | |||||
bool useEllipsesIfTooBig) const; | bool useEllipsesIfTooBig) const; | ||||
/** Draws a line of text within a specified rectangle. | /** Draws a line of text within a specified rectangle. | ||||
@@ -183,7 +183,7 @@ public: | |||||
*/ | */ | ||||
void drawText (const String& text, | void drawText (const String& text, | ||||
const Rectangle<int>& area, | const Rectangle<int>& area, | ||||
const Justification& justificationType, | |||||
Justification justificationType, | |||||
bool useEllipsesIfTooBig) const; | bool useEllipsesIfTooBig) const; | ||||
/** Tries to draw a text string inside a given space. | /** Tries to draw a text string inside a given space. | ||||
@@ -207,7 +207,7 @@ public: | |||||
*/ | */ | ||||
void drawFittedText (const String& text, | void drawFittedText (const String& text, | ||||
int x, int y, int width, int height, | int x, int y, int width, int height, | ||||
const Justification& justificationFlags, | |||||
Justification justificationFlags, | |||||
int maximumNumberOfLines, | int maximumNumberOfLines, | ||||
float minimumHorizontalScale = 0.7f) const; | float minimumHorizontalScale = 0.7f) const; | ||||
@@ -232,7 +232,7 @@ public: | |||||
*/ | */ | ||||
void drawFittedText (const String& text, | void drawFittedText (const String& text, | ||||
const Rectangle<int>& area, | const Rectangle<int>& area, | ||||
const Justification& justificationFlags, | |||||
Justification justificationFlags, | |||||
int maximumNumberOfLines, | int maximumNumberOfLines, | ||||
float minimumHorizontalScale = 0.7f) const; | float minimumHorizontalScale = 0.7f) const; | ||||
@@ -170,7 +170,7 @@ void AttributedString::clear() | |||||
attributes.clear(); | attributes.clear(); | ||||
} | } | ||||
void AttributedString::setJustification (const Justification& newJustification) noexcept | |||||
void AttributedString::setJustification (Justification newJustification) noexcept | |||||
{ | { | ||||
justification = newJustification; | justification = newJustification; | ||||
} | } | ||||
@@ -102,7 +102,7 @@ public: | |||||
/** Sets the justification that should be used for laying-out the text. | /** Sets the justification that should be used for laying-out the text. | ||||
This may include both vertical and horizontal flags. | This may include both vertical and horizontal flags. | ||||
*/ | */ | ||||
void setJustification (const Justification& newJustification) noexcept; | |||||
void setJustification (Justification newJustification) noexcept; | |||||
//============================================================================== | //============================================================================== | ||||
/** Types of word-wrap behaviour. | /** Types of word-wrap behaviour. | ||||
@@ -50,7 +50,7 @@ HyperlinkButton::~HyperlinkButton() | |||||
//============================================================================== | //============================================================================== | ||||
void HyperlinkButton::setFont (const Font& newFont, | void HyperlinkButton::setFont (const Font& newFont, | ||||
const bool resizeToMatchComponentHeight, | const bool resizeToMatchComponentHeight, | ||||
const Justification& justificationType) | |||||
Justification justificationType) | |||||
{ | { | ||||
font = newFont; | font = newFont; | ||||
resizeFont = resizeToMatchComponentHeight; | resizeFont = resizeToMatchComponentHeight; | ||||
@@ -63,7 +63,7 @@ public: | |||||
*/ | */ | ||||
void setFont (const Font& newFont, | void setFont (const Font& newFont, | ||||
bool resizeToMatchComponentHeight, | bool resizeToMatchComponentHeight, | ||||
const Justification& justificationType = Justification::horizontallyCentred); | |||||
Justification justificationType = Justification::horizontallyCentred); | |||||
//============================================================================== | //============================================================================== | ||||
/** A set of colour IDs to use to change the colour of various aspects of the link. | /** A set of colour IDs to use to change the colour of various aspects of the link. | ||||
@@ -1167,7 +1167,7 @@ void Component::setBoundsInset (const BorderSize<int>& borders) | |||||
} | } | ||||
void Component::setBoundsToFit (int x, int y, int width, int height, | void Component::setBoundsToFit (int x, int y, int width, int height, | ||||
const Justification& justification, | |||||
Justification justification, | |||||
const bool onlyReduceInSize) | const bool onlyReduceInSize) | ||||
{ | { | ||||
// it's no good calling this method unless both the component and | // it's no good calling this method unless both the component and | ||||
@@ -565,7 +565,7 @@ public: | |||||
@see setBounds | @see setBounds | ||||
*/ | */ | ||||
void setBoundsToFit (int x, int y, int width, int height, | void setBoundsToFit (int x, int y, int width, int height, | ||||
const Justification& justification, | |||||
Justification justification, | |||||
bool onlyReduceInSize); | bool onlyReduceInSize); | ||||
/** Changes the position of the component's centre. | /** Changes the position of the component's centre. | ||||
@@ -83,7 +83,7 @@ void DrawableText::setFont (const Font& newFont, bool applySizeAndScale) | |||||
} | } | ||||
} | } | ||||
void DrawableText::setJustification (const Justification& newJustification) | |||||
void DrawableText::setJustification (Justification newJustification) | |||||
{ | { | ||||
justification = newJustification; | justification = newJustification; | ||||
repaint(); | repaint(); | ||||
@@ -235,7 +235,7 @@ Justification DrawableText::ValueTreeWrapper::getJustification() const | |||||
return Justification ((int) state [justification]); | return Justification ((int) state [justification]); | ||||
} | } | ||||
void DrawableText::ValueTreeWrapper::setJustification (const Justification& newJustification, UndoManager* undoManager) | |||||
void DrawableText::ValueTreeWrapper::setJustification (Justification newJustification, UndoManager* undoManager) | |||||
{ | { | ||||
state.setProperty (justification, newJustification.getFlags(), undoManager); | state.setProperty (justification, newJustification.getFlags(), undoManager); | ||||
} | } | ||||
@@ -71,10 +71,10 @@ public: | |||||
const Font& getFont() const noexcept { return font; } | const Font& getFont() const noexcept { return font; } | ||||
/** Changes the justification of the text within the bounding box. */ | /** Changes the justification of the text within the bounding box. */ | ||||
void setJustification (const Justification& newJustification); | |||||
void setJustification (Justification newJustification); | |||||
/** Returns the current justification. */ | /** Returns the current justification. */ | ||||
const Justification& getJustification() const noexcept { return justification; } | |||||
Justification getJustification() const noexcept { return justification; } | |||||
/** Returns the parallelogram that defines the text bounding box. */ | /** Returns the parallelogram that defines the text bounding box. */ | ||||
const RelativeParallelogram& getBoundingBox() const noexcept { return bounds; } | const RelativeParallelogram& getBoundingBox() const noexcept { return bounds; } | ||||
@@ -117,7 +117,7 @@ public: | |||||
void setColour (Colour newColour, UndoManager* undoManager); | void setColour (Colour newColour, UndoManager* undoManager); | ||||
Justification getJustification() const; | Justification getJustification() const; | ||||
void setJustification (const Justification& newJustification, UndoManager* undoManager); | |||||
void setJustification (Justification newJustification, UndoManager* undoManager); | |||||
Font getFont() const; | Font getFont() const; | ||||
void setFont (const Font& newFont, UndoManager* undoManager); | void setFont (const Font& newFont, UndoManager* undoManager); | ||||
@@ -51,7 +51,7 @@ String GroupComponent::getText() const | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
void GroupComponent::setTextLabelPosition (const Justification& newJustification) | |||||
void GroupComponent::setTextLabelPosition (Justification newJustification) | |||||
{ | { | ||||
if (justification != newJustification) | if (justification != newJustification) | ||||
{ | { | ||||
@@ -62,13 +62,13 @@ public: | |||||
@see getTextLabelPosition | @see getTextLabelPosition | ||||
*/ | */ | ||||
void setTextLabelPosition (const Justification& justification); | |||||
void setTextLabelPosition (Justification justification); | |||||
/** Returns the current text label position. | /** Returns the current text label position. | ||||
@see setTextLabelPosition | @see setTextLabelPosition | ||||
*/ | */ | ||||
const Justification getTextLabelPosition() const noexcept { return justification; } | |||||
Justification getTextLabelPosition() const noexcept { return justification; } | |||||
//============================================================================== | //============================================================================== | ||||
/** A set of colour IDs to use to change the colour of various aspects of the component. | /** A set of colour IDs to use to change the colour of various aspects of the component. | ||||
@@ -77,7 +77,7 @@ bool ComboBox::isTextEditable() const noexcept | |||||
return label->isEditable(); | return label->isEditable(); | ||||
} | } | ||||
void ComboBox::setJustificationType (const Justification& justification) | |||||
void ComboBox::setJustificationType (Justification justification) | |||||
{ | { | ||||
label->setJustificationType (justification); | label->setJustificationType (justification); | ||||
} | } | ||||
@@ -82,7 +82,7 @@ public: | |||||
The default is Justification::centredLeft. The text is displayed using a | The default is Justification::centredLeft. The text is displayed using a | ||||
Label component inside the ComboBox. | Label component inside the ComboBox. | ||||
*/ | */ | ||||
void setJustificationType (const Justification& justification); | |||||
void setJustificationType (Justification justification); | |||||
/** Returns the current justification for the text box. | /** Returns the current justification for the text box. | ||||
@see setJustificationType | @see setJustificationType | ||||
@@ -115,7 +115,7 @@ void Label::setEditable (const bool editOnSingleClick, | |||||
setFocusContainer (editOnSingleClick || editOnDoubleClick); | setFocusContainer (editOnSingleClick || editOnDoubleClick); | ||||
} | } | ||||
void Label::setJustificationType (const Justification& newJustification) | |||||
void Label::setJustificationType (Justification newJustification) | |||||
{ | { | ||||
if (justification != newJustification) | if (justification != newJustification) | ||||
{ | { | ||||
@@ -114,7 +114,7 @@ public: | |||||
(The default is Justification::centredLeft) | (The default is Justification::centredLeft) | ||||
*/ | */ | ||||
void setJustificationType (const Justification& justification); | |||||
void setJustificationType (Justification justification); | |||||
/** Returns the type of justification, as set in setJustificationType(). */ | /** Returns the type of justification, as set in setJustificationType(). */ | ||||
Justification getJustificationType() const noexcept { return justification; } | Justification getJustificationType() const noexcept { return justification; } | ||||