JUCE  v5.1.1-3-g1a0b28c73
JUCE API
BorderSize< ValueType > Class Template Reference

Specifies a set of gaps to be left around the sides of a rectangle. More...

#include <juce_BorderSize.h>

Collaboration diagram for BorderSize< ValueType >:

Public Member Functions

 BorderSize () noexcept
 Creates a null border. More...
 
 BorderSize (const BorderSize &other) noexcept
 Creates a copy of another border. More...
 
 BorderSize (ValueType topGap, ValueType leftGap, ValueType bottomGap, ValueType rightGap) noexcept
 Creates a border with the given gaps. More...
 
 BorderSize (ValueType allGaps) noexcept
 Creates a border with the given gap on all sides. More...
 
Rectangle< ValueType > addedTo (const Rectangle< ValueType > &original) const noexcept
 Returns a rectangle with these borders added around it. More...
 
void addTo (Rectangle< ValueType > &rectangle) const noexcept
 Adds this border around a given rectangle. More...
 
ValueType getBottom () const noexcept
 Returns the gap that should be left at the top of the region. More...
 
ValueType getLeft () const noexcept
 Returns the gap that should be left at the top of the region. More...
 
ValueType getLeftAndRight () const noexcept
 Returns the sum of the left and right gaps. More...
 
ValueType getRight () const noexcept
 Returns the gap that should be left at the top of the region. More...
 
ValueType getTop () const noexcept
 Returns the gap that should be left at the top of the region. More...
 
ValueType getTopAndBottom () const noexcept
 Returns the sum of the top and bottom gaps. More...
 
bool isEmpty () const noexcept
 Returns true if this border has no thickness along any edge. More...
 
bool operator!= (const BorderSize &other) const noexcept
 
bool operator== (const BorderSize &other) const noexcept
 
void setBottom (ValueType newBottomGap) noexcept
 Changes the bottom gap. More...
 
void setLeft (ValueType newLeftGap) noexcept
 Changes the left gap. More...
 
void setRight (ValueType newRightGap) noexcept
 Changes the right gap. More...
 
void setTop (ValueType newTopGap) noexcept
 Changes the top gap. More...
 
Rectangle< ValueType > subtractedFrom (const Rectangle< ValueType > &original) const noexcept
 Returns a rectangle with these borders removed from it. More...
 
void subtractFrom (Rectangle< ValueType > &rectangle) const noexcept
 Removes this border from a given rectangle. More...
 

Private Attributes

ValueType bottom
 
ValueType left
 
ValueType right
 
ValueType top
 

Detailed Description

template<typename ValueType>
class BorderSize< ValueType >

Specifies a set of gaps to be left around the sides of a rectangle.

This is basically the size of the spaces at the top, bottom, left and right of a rectangle. It's used by various component classes to specify borders.

See also
Rectangle

Constructor & Destructor Documentation

◆ BorderSize() [1/4]

template<typename ValueType>
BorderSize< ValueType >::BorderSize ( )
inlinenoexcept

Creates a null border.

All sizes are left as 0.

◆ BorderSize() [2/4]

template<typename ValueType>
BorderSize< ValueType >::BorderSize ( const BorderSize< ValueType > &  other)
inlinenoexcept

Creates a copy of another border.

◆ BorderSize() [3/4]

template<typename ValueType>
BorderSize< ValueType >::BorderSize ( ValueType  topGap,
ValueType  leftGap,
ValueType  bottomGap,
ValueType  rightGap 
)
inlinenoexcept

Creates a border with the given gaps.

◆ BorderSize() [4/4]

template<typename ValueType>
BorderSize< ValueType >::BorderSize ( ValueType  allGaps)
inlineexplicitnoexcept

Creates a border with the given gap on all sides.

Member Function Documentation

◆ addedTo()

template<typename ValueType>
Rectangle<ValueType> BorderSize< ValueType >::addedTo ( const Rectangle< ValueType > &  original) const
inlinenoexcept

◆ addTo()

template<typename ValueType>
void BorderSize< ValueType >::addTo ( Rectangle< ValueType > &  rectangle) const
inlinenoexcept

Adds this border around a given rectangle.

References BorderSize< ValueType >::addedTo().

◆ getBottom()

template<typename ValueType>
ValueType BorderSize< ValueType >::getBottom ( ) const
inlinenoexcept

Returns the gap that should be left at the top of the region.

References BorderSize< ValueType >::bottom.

◆ getLeft()

template<typename ValueType>
ValueType BorderSize< ValueType >::getLeft ( ) const
inlinenoexcept

Returns the gap that should be left at the top of the region.

References BorderSize< ValueType >::left.

◆ getLeftAndRight()

template<typename ValueType>
ValueType BorderSize< ValueType >::getLeftAndRight ( ) const
inlinenoexcept

Returns the sum of the left and right gaps.

References BorderSize< ValueType >::left, and BorderSize< ValueType >::right.

◆ getRight()

template<typename ValueType>
ValueType BorderSize< ValueType >::getRight ( ) const
inlinenoexcept

Returns the gap that should be left at the top of the region.

References BorderSize< ValueType >::right.

◆ getTop()

template<typename ValueType>
ValueType BorderSize< ValueType >::getTop ( ) const
inlinenoexcept

Returns the gap that should be left at the top of the region.

References BorderSize< ValueType >::top.

◆ getTopAndBottom()

template<typename ValueType>
ValueType BorderSize< ValueType >::getTopAndBottom ( ) const
inlinenoexcept

Returns the sum of the top and bottom gaps.

References BorderSize< ValueType >::bottom, and BorderSize< ValueType >::top.

◆ isEmpty()

template<typename ValueType>
bool BorderSize< ValueType >::isEmpty ( ) const
inlinenoexcept

Returns true if this border has no thickness along any edge.

References BorderSize< ValueType >::bottom, BorderSize< ValueType >::left, BorderSize< ValueType >::right, and BorderSize< ValueType >::top.

◆ operator!=()

template<typename ValueType>
bool BorderSize< ValueType >::operator!= ( const BorderSize< ValueType > &  other) const
inlinenoexcept

◆ operator==()

template<typename ValueType>
bool BorderSize< ValueType >::operator== ( const BorderSize< ValueType > &  other) const
inlinenoexcept

◆ setBottom()

template<typename ValueType>
void BorderSize< ValueType >::setBottom ( ValueType  newBottomGap)
inlinenoexcept

Changes the bottom gap.

References BorderSize< ValueType >::bottom.

◆ setLeft()

template<typename ValueType>
void BorderSize< ValueType >::setLeft ( ValueType  newLeftGap)
inlinenoexcept

Changes the left gap.

References BorderSize< ValueType >::left.

◆ setRight()

template<typename ValueType>
void BorderSize< ValueType >::setRight ( ValueType  newRightGap)
inlinenoexcept

Changes the right gap.

References BorderSize< ValueType >::right.

◆ setTop()

template<typename ValueType>
void BorderSize< ValueType >::setTop ( ValueType  newTopGap)
inlinenoexcept

Changes the top gap.

References BorderSize< ValueType >::top.

◆ subtractedFrom()

template<typename ValueType>
Rectangle<ValueType> BorderSize< ValueType >::subtractedFrom ( const Rectangle< ValueType > &  original) const
inlinenoexcept

◆ subtractFrom()

template<typename ValueType>
void BorderSize< ValueType >::subtractFrom ( Rectangle< ValueType > &  rectangle) const
inlinenoexcept

Removes this border from a given rectangle.

References BorderSize< ValueType >::subtractedFrom().

Member Data Documentation

◆ bottom

◆ left

◆ right

◆ top


The documentation for this class was generated from the following file: