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.
Loading...
Searching...
No Matches
Static Public Attributes | Public Member Functions | Static Public Member Functions | List of all members
xtd::forms::padding Class Reference

#include <padding.h>

Definition

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

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

Inherits xtd::object.

Static Public Attributes

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

Public Member Functions

 padding ()=default
 Initializes a new instance of the padding class.
 
 padding (int all)
 Initializes a new instance of the padding class using the supplied padding size for all edges.
 
 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.
 
int all () const
 Gets the padding value for all the edges.
 
void all (int all)
 Sets the padding value for all the edges.
 
int bottom () const
 Gets the padding value for the bottom edge.
 
void bottom (int bottom)
 Sets the padding value for the bottom edge.
 
int horizontal () const
 Gets the combined padding for the right and left edges.
 
int left () const
 Gets the padding value for the left edge.
 
void left (int left)
 Sets the padding value for the left edge.
 
int right () const
 Gets the padding value for the right edge.
 
void right (int right)
 Sets the padding value for the right edge.
 
xtd::ustring to_string () const noexcept override
 Returns a string that represents the current padding.
 
int top () const
 Gets the padding value for the top edge.
 
void top (int top)
 Sets the padding value for the top edge.
 
int vertical () const
 Gets the combined padding for the bottom and top edges.
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual 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.
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance.
 
virtual xtd::ustring to_string () const noexcept
 Returns a std::string that represents the current object.
 

Static Public Member Functions

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

xtd::ustring 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: