Alignment Class Reference

#include <Pt/Forms/Alignment.h>

Names a position in a rectangle. More...

Public Types

enum  Mode {
  TopLeft ,
  Top ,
  TopRight ,
  Left ,
  Center ,
  Right ,
  BottomLeft ,
  Bottom ,
  BottomRight
}
 Position of content in a rectangle. More...

Public Member Functions

 Alignment (Mode m=Center)
 Creates an alignment with mode m.
Alignmentoperator= (Mode m)
 Sets the alignment to m and returns this object.
 operator Pt::uint32_t () const
 Returns the alignment as an unsigned integer value.

Detailed Description

The nine modes place content at a corner, an edge center, or the middle of a rectangle. The default is Center.

+-----+-----+-----+
| TL | Top | TR |
+-----+-----+-----+
| Left| C |Right|
+-----+-----+-----+
| BL | Bot | BR |
+-----+-----+-----+
@ Top
Top edge, horizontally centered.
Definition Alignment.h:73
@ Left
Left edge, vertically centered.
Definition Alignment.h:81
@ Right
Right edge, vertically centered.
Definition Alignment.h:89
label.setAlignment(Pt::Forms::Alignment::TopLeft);
@ TopLeft
Top-left corner.
Definition Alignment.h:69

Member Enumeration Documentation

◆ Mode

enum Mode
Enumerator
TopLeft 

Top-left corner.

Top 

Top edge, horizontally centered.

TopRight 

Top-right corner.

Left 

Left edge, vertically centered.

Center 

Center of the rectangle.

Right 

Right edge, vertically centered.

BottomLeft 

Bottom-left corner.

Bottom 

Bottom edge, horizontally centered.

BottomRight 

Bottom-right corner.