tbx  0.7.3
Public Member Functions | Public Attributes | List of all members
tbx::Margin Class Reference

Class to represent a margin around an area. More...

#include <margin.h>

Public Member Functions

 Margin ()
 Construct a margin with 0 for all measurements.
 
 Margin (int all)
 Construct a margin with all measurements equal. More...
 
 Margin (int x, int y)
 Construct a margin with the left = right and top = bottom. More...
 
 Margin (int l, int t, int r, int b)
 Construct a margin with all measurements specified. More...
 
 Margin (const Margin &other)
 Copy constructor. More...
 
Marginoperator= (const Margin &other)
 Assign this margin with the values of another. More...
 
bool operator== (const Margin &other) const
 Check if this margin contains the same values as another margin. More...
 
bool operator!= (const Margin &other) const
 Check if this margin contains differing values from another margin. More...
 

Public Attributes

int left
 Left margin.
 
int top
 Top margin.
 
int right
 Right margin.
 
int bottom
 Bottom margin.
 

Detailed Description

Class to represent a margin around an area.

Constructor & Destructor Documentation

tbx::Margin::Margin ( int  all)
inline

Construct a margin with all measurements equal.

Parameters
allvalue for all measurements
tbx::Margin::Margin ( int  x,
int  y 
)
inline

Construct a margin with the left = right and top = bottom.

Parameters
xsize for left and right margins
ysize for top and bottom margins
tbx::Margin::Margin ( int  l,
int  t,
int  r,
int  b 
)
inline

Construct a margin with all measurements specified.

Parameters
lleft margin
ttop margin
rright margin
bbottom margin
tbx::Margin::Margin ( const Margin other)
inline

Copy constructor.

Parameters
otherMargin to copy

Member Function Documentation

bool tbx::Margin::operator!= ( const Margin other) const
inline

Check if this margin contains differing values from another margin.

Parameters
othermargin to compare with
Returns
true if one or more measurements are not equal
Margin& tbx::Margin::operator= ( const Margin other)
inline

Assign this margin with the values of another.

Parameters
otherMargin to copy
bool tbx::Margin::operator== ( const Margin other) const
inline

Check if this margin contains the same values as another margin.

Parameters
othermargin to compare with
Returns
true if all measurements are equal

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