JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::BorderSize< ValueType > Class Template Reference

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

#include "juce_BorderSize.h"

Public Member Functions

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

Detailed Description

template<typename ValueType>
class juce::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

@tags{Graphics}

Definition at line 41 of file juce_BorderSize.h.

Constructor & Destructor Documentation

◆ BorderSize() [1/3]

template<typename ValueType >
juce::BorderSize< ValueType >::BorderSize ( )
default

Creates a null border.

All sizes are left as 0.

◆ BorderSize() [2/3]

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

Creates a border with the given gaps.

Definition at line 53 of file juce_BorderSize.h.

◆ BorderSize() [3/3]

template<typename ValueType >
juce::BorderSize< ValueType >::BorderSize ( ValueType  allGaps)
explicitnoexcept

Creates a border with the given gap on all sides.

Definition at line 59 of file juce_BorderSize.h.

Member Function Documentation

◆ addedTo() [1/2]

template<typename ValueType >
BorderSize< ValueType > juce::BorderSize< ValueType >::addedTo ( const BorderSize< ValueType > &  other) const
noexcept

Adds this border to another border.

Definition at line 140 of file juce_BorderSize.h.

◆ addedTo() [2/2]

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

Returns a rectangle with these borders added around it.

Definition at line 116 of file juce_BorderSize.h.

◆ addTo()

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

Adds this border around a given rectangle.

Definition at line 125 of file juce_BorderSize.h.

◆ getBottom()

template<typename ValueType >
ValueType juce::BorderSize< ValueType >::getBottom ( ) const
noexcept

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

Definition at line 72 of file juce_BorderSize.h.

◆ getLeft()

template<typename ValueType >
ValueType juce::BorderSize< ValueType >::getLeft ( ) const
noexcept

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

Definition at line 69 of file juce_BorderSize.h.

◆ getLeftAndRight()

template<typename ValueType >
ValueType juce::BorderSize< ValueType >::getLeftAndRight ( ) const
noexcept

Returns the sum of the left and right gaps.

Definition at line 81 of file juce_BorderSize.h.

◆ getRight()

template<typename ValueType >
ValueType juce::BorderSize< ValueType >::getRight ( ) const
noexcept

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

Definition at line 75 of file juce_BorderSize.h.

◆ getTop()

template<typename ValueType >
ValueType juce::BorderSize< ValueType >::getTop ( ) const
noexcept

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

Definition at line 66 of file juce_BorderSize.h.

◆ getTopAndBottom()

template<typename ValueType >
ValueType juce::BorderSize< ValueType >::getTopAndBottom ( ) const
noexcept

Returns the sum of the top and bottom gaps.

Definition at line 78 of file juce_BorderSize.h.

◆ isEmpty()

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

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

Definition at line 84 of file juce_BorderSize.h.

◆ multipliedBy()

template<typename ValueType >
template<typename ScalarType >
BorderSize< ValueType > juce::BorderSize< ValueType >::multipliedBy ( ScalarType  scalar) const
noexcept

Multiplies each member of the border by a scalar.

Definition at line 150 of file juce_BorderSize.h.

◆ operator!=()

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

Definition at line 160 of file juce_BorderSize.h.

◆ operator==()

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

Definition at line 159 of file juce_BorderSize.h.

◆ setBottom()

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

Changes the bottom gap.

Definition at line 94 of file juce_BorderSize.h.

◆ setLeft()

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

Changes the left gap.

Definition at line 91 of file juce_BorderSize.h.

◆ setRight()

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

Changes the right gap.

Definition at line 97 of file juce_BorderSize.h.

◆ setTop()

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

Changes the top gap.

Definition at line 88 of file juce_BorderSize.h.

◆ subtractedFrom() [1/2]

template<typename ValueType >
BorderSize< ValueType > juce::BorderSize< ValueType >::subtractedFrom ( const BorderSize< ValueType > &  other) const
noexcept

Removes this border from another border.

Definition at line 131 of file juce_BorderSize.h.

◆ subtractedFrom() [2/2]

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

Returns a rectangle with these borders removed from it.

Definition at line 101 of file juce_BorderSize.h.

◆ subtractFrom()

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

Removes this border from a given rectangle.

Definition at line 110 of file juce_BorderSize.h.


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