xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
xtd::forms::padding Class Reference

Represents a display device or multiple display devices on a single system. More...

#include <padding.h>

Public Member Functions

 padding ()=default
 Initializes a new instance of the padding class. More...
 
 padding (int all)
 Initializes a new instance of the padding class using the supplied padding size for all edges. More...
 
 padding (int left, int top, int right, int bottom)
 Initializes a new instance of the padding class using a separate padding size for each edge. More...
 
int all () const
 Gets the padding value for all the edges. More...
 
void all (int all)
 Sets the padding value for all the edges. More...
 
int bottom () const
 Gets the padding value for the bottom edge. More...
 
void bottom (int bottom)
 Sets the padding value for the bottom edge. More...
 
int horizontal () const
 Gets the combined padding for the right and left edges. More...
 
int left () const
 Gets the padding value for the left edge. More...
 
void left (int left)
 Sets the padding value for the left edge. More...
 
int right () const
 Gets the padding value for the right edge. More...
 
void right (int right)
 Sets the padding value for the right edge. More...
 
std::string to_string () const noexcept override
 Returns a string that represents the current padding. More...
 
int top () const
 Gets the padding value for the top edge. More...
 
void top (int top)
 Sets the padding value for the top edge. More...
 
int vertical () const
 Gets the combined padding for the bottom and top edges. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::shared_ptr< objectmemberwise_clone () const
 Gets the type of the current instance. More...
 

Static Public Member Functions

static padding add (const padding &p1, const padding &p2)
 Computes the sum of the two specified padding values. More...
 
static padding subtract (const padding &p1, const padding &p2)
 Subtracts one specified Padding value from another. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Static Public Attributes

static const padding empty
 Provides a Padding object with no padding. More...
 

Detailed Description

Represents a display device or multiple display devices on a single system.

Library
xtd.forms
Examples:
emoticons.cpp, and list_box.cpp.

Constructor & Destructor Documentation

◆ padding() [1/3]

xtd::forms::padding::padding ( )
default

Initializes a new instance of the padding class.

◆ padding() [2/3]

xtd::forms::padding::padding ( int  all)
inline

Initializes a new instance of the padding class using the supplied padding size for all edges.

Parameters
allThe number of pixels to be used for padding for all edges.
Remarks
This constructor sets the right, left, bottom, top and all properties to the value of the all parameter.

◆ padding() [3/3]

xtd::forms::padding::padding ( int  left,
int  top,
int  right,
int  bottom 
)
inline

Initializes a new instance of the padding class using a separate padding size for each edge.

Parameters
leftThe padding size, in pixels, for the left edge.
topoThe padding size, in pixels, for the toop edge.
rrightThe padding size, in pixels, for the right edge.
bottomThe padding size, in pixels, for the bottom edge.
Remarks
If all of the parameter values are equal, then the all property will reflect this common value.

Member Function Documentation

◆ add()

static padding xtd::forms::padding::add ( const padding p1,
const padding p2 
)
inlinestatic

Computes the sum of the two specified padding values.

Returns
A padding that contains the sum of the two specified padding values.

◆ all() [1/2]

int xtd::forms::padding::all ( ) const
inline

Gets the padding value for all the edges.

Returns
The padding, in pixels, for all edges if the same; otherwise, -1.
Remarks
When retrieving this property, if all the edges use the same padding value, then this common value is returned. Otherwise, -1 is returned to indicate that all the padding values are not equal.

◆ all() [2/2]

void xtd::forms::padding::all ( int  all)
inline

Sets the padding value for all the edges.

Parameters
allThe padding, in pixels, for all edges if the same; otherwise, -1.
Remarks
When retrieving this property, if all the edges use the same padding value, then this common value is returned. Otherwise, -1 is returned to indicate that all the padding values are not equal.

◆ bottom() [1/2]

int xtd::forms::padding::bottom ( ) const
inline

Gets the padding value for the bottom edge.

Returns
The padding, in pixels, for the bottom edge.
Remarks
Setting this value can also alter the all property.

◆ bottom() [2/2]

void xtd::forms::padding::bottom ( int  bottom)
inline

Sets the padding value for the bottom edge.

Parameters
bottomThe padding, in pixels, for the bottom edge.
Remarks
Setting this value can also alter the all property.

◆ horizontal()

int xtd::forms::padding::horizontal ( ) const
inline

Gets the combined padding for the right and left edges.

Returns
Gets the sum, in pixels, of the left and right padding values.

◆ left() [1/2]

int xtd::forms::padding::left ( ) const
inline

Gets the padding value for the left edge.

Returns
The padding, in pixels, for the left edge.
Remarks
Setting this value can also alter the all property.

◆ left() [2/2]

void xtd::forms::padding::left ( int  left)
inline

Sets the padding value for the left edge.

Parameters
leftThe padding, in pixels, for the left edge.
Remarks
Setting this value can also alter the all property.

◆ right() [1/2]

int xtd::forms::padding::right ( ) const
inline

Gets the padding value for the right edge.

Returns
The padding, in pixels, for the right edge.
Remarks
Setting this value can also alter the all property.

◆ right() [2/2]

void xtd::forms::padding::right ( int  right)
inline

Sets the padding value for the right edge.

Parameters
rightThe padding, in pixels, for the right edge.
Remarks
Setting this value can also alter the all property.

◆ subtract()

static padding xtd::forms::padding::subtract ( const padding p1,
const padding p2 
)
inlinestatic

Subtracts one specified Padding value from another.

Parameters
p1A padding.
p2A padding.
Returns
A padding that contains the result of the subtraction of one specified padding value from another.

◆ to_string()

std::string xtd::forms::padding::to_string ( ) const
inlineoverridevirtualnoexcept

Returns a string that represents the current padding.

Returns
A string that represents the current padding.
Remarks
This method returns a string containing the labeled values of the padding for all four edges.

Reimplemented from xtd::object.

◆ top() [1/2]

int xtd::forms::padding::top ( ) const
inline

Gets the padding value for the top edge.

Returns
The padding, in pixels, for the top edge.
Remarks
Setting this value can also alter the all property.

◆ top() [2/2]

void xtd::forms::padding::top ( int  top)
inline

Sets the padding value for the top edge.

Parameters
topThe padding, in pixels, for the top edge.
Remarks
Setting this value can also alter the all property.

◆ vertical()

int xtd::forms::padding::vertical ( ) const
inline

Gets the combined padding for the bottom and top edges.

Parameters
p1A padding.
p2A padding.
Returns
Gets the sum, in pixels, of the top and bottom padding values.

Member Data Documentation

◆ empty

const padding xtd::forms::padding::empty
static

Provides a Padding object with no padding.


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