Iridescence 1.00
Embedded Graphic Framework
Loading...
Searching...
No Matches
DsAlignment Class Reference

DsAlignment is a class representing both horizontal and vertical alignment type. More...

#include <ds_types.h>

Public Types

enum  Alignment : uint8_t {
  NONE = 0 ,
  TOP = 1 ,
  LEFT = 1 ,
  BOTTOM = 2 ,
  RIGHT = 2 ,
  CENTER = 3
}
 Alignment is an enumeration of all alignment types.
 

Public Member Functions

 DsAlignment ()
 Creates a DsAlignment object specifying no orientation.
 
 DsAlignment (Alignment horizontal, Alignment vertical)
 Creates a DsAlignment object using the specified horizontal / vertical orientation. The "fit" flag is set to false.
 
 DsAlignment (Alignment horizontal, Alignment vertical, bool fit_in_parent)
 Creates a DsAlignment object using the specified horizontal / vertical orientation.
 
DsAlignmentfit (void)
 Sets the "fit" flag.
 
bool isLeft (void) const
 Is the horizontal alignment left?
 
bool isCenterH (void) const
 Is the horizontal alignment center?
 
bool isRight (void) const
 Is the horizontal alignment right?
 
bool isTop (void) const
 Is the vertical alignment top?
 
bool isCenterV (void) const
 Is the vertical alignment center?
 
bool isBottom (void) const
 Is the vertical alignment bottom?
 
bool fitInParent (void) const
 Will fit in parent?
 

Detailed Description

DsAlignment is a class representing both horizontal and vertical alignment type.

The class also contains the "fit" flag. This is used in some cases to specify that a view will be expanded to fit its parent.

Constructor & Destructor Documentation

◆ DsAlignment() [1/2]

DsAlignment::DsAlignment ( Alignment  horizontal,
Alignment  vertical 
)
inline

Creates a DsAlignment object using the specified horizontal / vertical orientation. The "fit" flag is set to false.

Parameters
horizontalHorizontal alignment
verticalVertical alignment

◆ DsAlignment() [2/2]

DsAlignment::DsAlignment ( Alignment  horizontal,
Alignment  vertical,
bool  fit_in_parent 
)
inline

Creates a DsAlignment object using the specified horizontal / vertical orientation.

Parameters
horizontalHorizontal alignment
verticalVertical alignment
fit_in_parentThe "fit" flag value

Member Function Documentation

◆ fit()

DsAlignment & DsAlignment::fit ( void  )
inline

Sets the "fit" flag.

Returns
Reference to the "this" object so calls can be daisychained like this: object = new DsAlignment().fit()

◆ fitInParent()

bool DsAlignment::fitInParent ( void  ) const
inline

Will fit in parent?

Returns
True if the "fit" flag is set

◆ isBottom()

bool DsAlignment::isBottom ( void  ) const
inline

Is the vertical alignment bottom?

Returns
True if the vertical alignment is bottom

◆ isCenterH()

bool DsAlignment::isCenterH ( void  ) const
inline

Is the horizontal alignment center?

Returns
True if the horizontal alignment is center

◆ isCenterV()

bool DsAlignment::isCenterV ( void  ) const
inline

Is the vertical alignment center?

Returns
True if the vertical alignment is center

◆ isLeft()

bool DsAlignment::isLeft ( void  ) const
inline

Is the horizontal alignment left?

Returns
True if the horizontal alignment is left

◆ isRight()

bool DsAlignment::isRight ( void  ) const
inline

Is the horizontal alignment right?

Returns
True if the horizontal alignment is right

◆ isTop()

bool DsAlignment::isTop ( void  ) const
inline

Is the vertical alignment top?

Returns
True if the vertical alignment is top

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