xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::padding Class Reference
Inheritance diagram for xtd::forms::padding:
xtd::object xtd::iequatable< padding > xtd::interface

Definition

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

Header
#include <xtd/forms/padding>
Namespace
xtd::forms
Library
xtd.forms
Examples
change_parent.cpp, emoticons.cpp, form_show.cpp, horizontal_layout_panel.cpp, list_box.cpp, system_sound.cpp, and vertical_layout_panel.cpp.

Public Fields

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

Public Constructors

 padding ()=default
 Initializes a new instance of the padding class.
 
 padding (int32 all)
 Initializes a new instance of the padding class using the supplied padding size for all edges.
 
 padding (int32 left, int32 top, int32 right, int32 bottom)
 Initializes a new instance of the padding class using a separate padding size for each edge.
 

Peorperties

int32 all () const noexcept
 Gets the padding value for all the edges.
 
void all (int32 all)
 Sets the padding value for all the edges.
 
int32 bottom () const noexcept
 Gets the padding value for the bottom edge.
 
void bottom (int32 bottom)
 Sets the padding value for the bottom edge.
 
int32 horizontal () const noexcept
 Gets the combined padding for the right and left edges.
 
int32 left () const noexcept
 Gets the padding value for the left edge.
 
void left (int32 left)
 Sets the padding value for the left edge.
 
int32 right () const noexcept
 Gets the padding value for the right edge.
 
void right (int32 right)
 Sets the padding value for the right edge.
 
int32 top () const noexcept
 Gets the padding value for the top edge.
 
void top (int32 top)
 Sets the padding value for the top edge.
 
int32 vertical () const noexcept
 Gets the combined padding for the bottom and top edges.
 

Public Methods

bool equals (const padding &value) const noexcept override
 
xtd::ustring to_string () const noexcept override
 Returns a string that represents the current padding.
 

Public Static Methods

static padding add (const padding &p1, const padding &p2)
 Computes the sum of the two specified padding values.
 
static padding subtract (const padding &p1, const padding &p2)
 Subtracts one specified Padding value from another.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object.
 
- Public Member Functions inherited from xtd::iequatable< padding >
virtual bool equals (const padding &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- 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.
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

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 ( int32  all)

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 ( int32  left,
int32  top,
int32  right,
int32  bottom 
)

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.
topThe padding size, in pixels, for the top edge.
rightThe 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 
)
static

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]

int32 xtd::forms::padding::all ( ) const
noexcept

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 ( int32  all)

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]

int32 xtd::forms::padding::bottom ( ) const
noexcept

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 ( int32  bottom)

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

int32 xtd::forms::padding::horizontal ( ) const
noexcept

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]

int32 xtd::forms::padding::left ( ) const
noexcept

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 ( int32  left)

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]

int32 xtd::forms::padding::right ( ) const
noexcept

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 ( int32  right)

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

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

xtd::ustring xtd::forms::padding::to_string ( ) const
overridevirtualnoexcept

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]

int32 xtd::forms::padding::top ( ) const
noexcept

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 ( int32  top)

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

int32 xtd::forms::padding::vertical ( ) const
noexcept

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: