Public Member Functions | Friends | List of all members
Margins Class Reference

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 &)
 

Detailed Description

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.

Constructor & Destructor Documentation

Margins ( )

Constructs a Margins object with a left, top, right and bottom margin of 0.

Margins ( int  margin)

Constructs a Margins object with the given margin used for all 4 margins.

Parameters
[in]marginmargin used for all 4 margins
Margins ( int  left,
int  top,
int  right,
int  bottom 
)

Constructs a Margins object with the given margins.

Parameters
[in]leftthe left margin
[in]topthe top margin
[in]rightthe right margin
[in]bottomthe bottom margin

Member Function Documentation

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.

Parameters
[in]marginmargin used for all 4 margins
void SetMargin ( int  left,
int  top,
int  right,
int  bottom 
)

Sets the 4 margins to the given values.

Parameters
[in]leftthe left margin
[in]topthe top margin
[in]rightthe right margin
[in]bottomthe 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.

Friends And Related Function Documentation

bool operator!= ( const Margins ,
const Margins  
)
friend
bool operator== ( const Margins ,
const Margins  
)
friend

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

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.