The Margins class defines the four margins of a rectangle. More...
#include <Margins.h>
Public Member Functions | |
Margins () | |
Constructs a Margins object with a left, top, right and bottom margin of 0. More... | |
Margins (int margin) | |
Constructs a Margins object with the given margin used for all 4 margins. More... | |
Margins (int left, int top, int right, int bottom) | |
Constructs a Margins object with the given margins. More... | |
bool | IsNull () const |
Returns true if all 4 margins are 0; otherwise, it return false. More... | |
int | Left () const |
Gets the left margin. More... | |
int | Top () const |
Gets the top margin. More... | |
int | Right () const |
Gets the right margin. More... | |
int | Bottom () const |
Gets the bottom margin. More... | |
void | SetMargin (int margin) |
Sets all 4 margins with the given margin. More... | |
void | SetMargin (int left, int top, int right, int bottom) |
Sets the 4 margins to the given values. More... | |
void | SetLeft (int left) |
Gets the left margin. More... | |
void | SetTop (int top) |
Gets the top margin. More... | |
void | SetRight (int right) |
Gets the right margin. More... | |
void | SetBottom (int bottom) |
Gets the bottom margin. More... | |
Friends | |
bool | operator== (const Margins &, const Margins &) |
bool | operator!= (const Margins &, const Margins &) |
The Margins class defines the four margins of a rectangle.
Margins defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.
Margins | ( | int | margin | ) |
Constructs a Margins object with the given margin used for all 4 margins.
[in] | margin | margin used for all 4 margins |
Margins | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom | ||
) |
Constructs a Margins object with the given margins.
[in] | left | the left margin |
[in] | top | the top margin |
[in] | right | the right margin |
[in] | bottom | the bottom margin |
int Bottom | ( | ) | const |
Gets the bottom margin.
bool IsNull | ( | ) | const |
Returns true if all 4 margins are 0; otherwise, it return false.
int Left | ( | ) | const |
Gets the left margin.
int Right | ( | ) | const |
Gets the right margin.
void SetBottom | ( | int | bottom | ) |
Gets the bottom margin.
void SetLeft | ( | int | left | ) |
Gets the left margin.
void SetMargin | ( | int | margin | ) |
Sets all 4 margins with the given margin.
[in] | margin | margin used for all 4 margins |
void SetMargin | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom | ||
) |
Sets the 4 margins to the given values.
[in] | left | the left margin |
[in] | top | the top margin |
[in] | right | the right margin |
[in] | bottom | the bottom margin |
void SetRight | ( | int | right | ) |
Gets the right margin.
void SetTop | ( | int | top | ) |
Gets the top margin.
int Top | ( | ) | const |
Gets the top margin.