Close menu
Start
Download
Getting Started
License
References
Jam Build Tool
Class Index
Namespaces
Modules
Pt
›
Documentation
Documentation
›
Get Platinum
≡
Class Index
Namespaces
Modules
include
Pt
Forms
Alignment.h
1
/* Copyright (C) 2017 Marc Boris Duerner
2
3
This library is free software; you can redistribute it and/or
4
modify it under the terms of the GNU Lesser General Public
5
License as published by the Free Software Foundation; either
6
version 2.1 of the License, or (at your option) any later version.
7
8
As a special exception, you may use this file as part of a free
9
software library without restriction. Specifically, if other files
10
instantiate templates or use macros or inline functions from this
11
file, or you compile this file and link it with other files to
12
produce an executable, this file does not by itself cause the
13
resulting executable to be covered by the GNU General Public
14
License. This exception does not however invalidate any other
15
reasons why the executable file might be covered by the GNU Library
16
General Public License.
17
18
This library is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
Lesser General Public License for more details.
22
23
You should have received a copy of the GNU Lesser General Public
24
License along with this library; if not, write to the Free Software
25
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26
MA 02110-1301 USA
27
*/
28
29
#ifndef Pt_Forms_Alignment_H
30
#define Pt_Forms_Alignment_H
31
32
#include <Pt/Forms/Api.h>
33
#include <Pt/Types.h>
34
35
namespace
Pt
{
36
37
namespace
Forms
{
38
60
class
Alignment
61
{
62
public
:
65
enum
Mode
66
{
69
TopLeft
,
70
73
Top
,
74
77
TopRight
,
78
81
Left
,
82
85
Center
,
86
89
Right
,
90
93
BottomLeft
,
94
97
Bottom
,
98
101
BottomRight
102
};
103
106
Alignment
(
Mode
m =
Center
)
107
: _mode(m)
108
{}
109
112
Alignment
&
operator=
(
Mode
m)
113
{
114
_mode = m;
115
return
*
this
;
116
}
117
120
operator
Pt::uint32_t
()
const
121
{
122
return
_mode;
123
}
124
125
private
:
126
Pt::uint32_t
_mode;
127
};
128
129
}
// namespace
130
131
}
// namespace
132
133
#endif
Pt::Forms::Alignment::Alignment
Alignment(Mode m=Center)
Creates an alignment with mode m.
Definition
Alignment.h:106
Pt::Forms::Alignment::Mode
Mode
Position of content in a rectangle.
Definition
Alignment.h:66
Pt::Forms::Alignment::Bottom
@ Bottom
Bottom edge, horizontally centered.
Definition
Alignment.h:97
Pt::Forms::Alignment::BottomRight
@ BottomRight
Bottom-right corner.
Definition
Alignment.h:101
Pt::Forms::Alignment::Top
@ Top
Top edge, horizontally centered.
Definition
Alignment.h:73
Pt::Forms::Alignment::TopLeft
@ TopLeft
Top-left corner.
Definition
Alignment.h:69
Pt::Forms::Alignment::TopRight
@ TopRight
Top-right corner.
Definition
Alignment.h:77
Pt::Forms::Alignment::Left
@ Left
Left edge, vertically centered.
Definition
Alignment.h:81
Pt::Forms::Alignment::Center
@ Center
Center of the rectangle.
Definition
Alignment.h:85
Pt::Forms::Alignment::Right
@ Right
Right edge, vertically centered.
Definition
Alignment.h:89
Pt::Forms::Alignment::BottomLeft
@ BottomLeft
Bottom-left corner.
Definition
Alignment.h:93
Pt::Forms::Alignment::operator=
Alignment & operator=(Mode m)
Sets the alignment to m and returns this object.
Definition
Alignment.h:112
Pt::uint32_t
uint_type uint32_t
Unsigned 32-bit integer type.
Definition
Api-Types.h:52
Pt::Forms
Graphical user interfaces.
Definition
ActivateEvent.h:40
Pt
Core module.
Definition
Allocator.h:33