1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxIndividualLayoutConstraint class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxIndividualLayoutConstraint
13 Objects of this class are stored in the wxLayoutConstraint class
14 as one of eight possible constraints that a window can be involved in.
16 Constraints are initially set to have the relationship wxUnconstrained,
17 which means that their values should be calculated by looking at known
24 @ref overview_constraintsoverview "Overview and examples", wxLayoutConstraints,
25 wxWindow::SetConstraints.
27 class wxIndividualLayoutConstraint
: public wxObject
31 Constructor. Not used by the end-user.
33 wxIndividualLayoutConstraint();
36 Constrains this edge to be above the given window, with an
37 optional margin. Implicitly, this is relative to the top edge of the other
40 void Above(wxWindow
* otherWin
, int margin
= 0);
43 Constrains this edge or dimension to be the given absolute value.
45 void Absolute(int value
);
48 Sets this edge or constraint to be whatever the window's value is
49 at the moment. If either of the width and height constraints
50 are @e as is, the window will not be resized, but moved instead.
51 This is important when considering panel items which are intended
52 to have a default size, such as a button, which may take its size
53 from the size of the button label.
55 #define void AsIs() /* implementation is private */
58 Constrains this edge to be below the given window, with an
59 optional margin. Implicitly, this is relative to the bottom edge of the other
62 void Below(wxWindow
* otherWin
, int margin
= 0);
65 The @e wxEdge enumerated type specifies the type of edge or dimension of a
91 The x-coordinate of the centre of the window.
96 The y-coordinate of the centre of the window.
98 The @e wxRelationship enumerated type specifies the relationship that
99 this edge or dimension has with another specified edge or dimension. Normally,
101 doesn't use these directly because functions such as @e Below and @e RightOf
103 for using the more general @e Set function.
108 The edge or dimension is unconstrained (the default for edges.
113 The edge or dimension is to be taken from the current window position or size
115 default for dimensions.
120 The edge should be above another edge.
125 The edge should be below another edge.
130 The edge should be to the left of another edge.
135 The edge should be to the right of another edge.
140 The edge or dimension should be the same as another edge or dimension.
145 The edge or dimension should be a percentage of another edge or dimension.
150 The edge or dimension should be a given absolute value.
155 Constrains this edge to be to the left of the given window, with an
156 optional margin. Implicitly, this is relative to the left edge of the other
159 void LeftOf(wxWindow
* otherWin
, int margin
= 0);
162 Constrains this edge or dimension to be to a percentage of the given window,
166 void PercentOf(wxWindow
* otherWin
, wxEdge edge
, int per
);
169 Constrains this edge to be to the right of the given window, with an
170 optional margin. Implicitly, this is relative to the right edge of the other
173 void RightOf(wxWindow
* otherWin
, int margin
= 0);
176 Constrains this edge or dimension to be to the same as the edge of the given
180 void SameAs(wxWindow
* otherWin
, wxEdge edge
, int margin
= 0);
183 Sets the properties of the constraint. Normally called by one of the convenience
184 functions such as Above, RightOf, SameAs.
186 #define void Set(wxRelationship rel, wxWindow * otherWin,
187 wxEdge otherEdge
, int value
= 0,
188 int margin
= 0) /* implementation is private */
191 Sets this edge or dimension to be unconstrained, that is, dependent on
192 other edges and dimensions from which this value can be deduced.
194 void Unconstrained();
199 @class wxLayoutConstraints
202 @b Note: constraints are now deprecated and you should use sizers instead.
204 Objects of this class can be associated with a window to define its
205 layout constraints, with respect to siblings or its parent.
207 The class consists of the following eight constraints of class
208 wxIndividualLayoutConstraint,
209 some or all of which should be accessed directly to set the appropriate
212 @b left: represents the left hand edge of the window
213 @b right: represents the right hand edge of the window
214 @b top: represents the top edge of the window
215 @b bottom: represents the bottom edge of the window
216 @b width: represents the width of the window
217 @b height: represents the height of the window
218 @b centreX: represents the horizontal centre point of the window
219 @b centreY: represents the vertical centre point of the window
221 Most constraints are initially set to have the relationship wxUnconstrained,
222 which means that their values should be calculated by looking at known
224 The exceptions are @e width and @e height, which are set to wxAsIs to
225 ensure that if the user does not specify a constraint, the existing
226 width and height will be used, to be compatible with panel items which often
227 have take a default size. If the constraint is wxAsIs, the dimension will
230 @b wxPerl note: In wxPerl the constraints are accessed as
233 constraint = Wx::LayoutConstraints-new();
234 constraint-centreX-AsIs();
235 constraint-centreY-Unconstrained();
243 @ref overview_constraintsoverview "Overview and examples",
244 wxIndividualLayoutConstraint, wxWindow::SetConstraints
246 class wxLayoutConstraints
: public wxObject
252 wxLayoutConstraints();
255 wxIndividualLayoutConstraint bottom
257 Constraint for the bottom edge.
262 wxIndividualLayoutConstraint centreX
264 Constraint for the horizontal centre point.
269 wxIndividualLayoutConstraint centreY
271 Constraint for the vertical centre point.
276 wxIndividualLayoutConstraint height
278 Constraint for the height.
283 wxIndividualLayoutConstraint left
285 Constraint for the left-hand edge.
290 wxIndividualLayoutConstraint right
292 Constraint for the right-hand edge.
297 wxIndividualLayoutConstraint top
299 Constraint for the top edge.
304 wxIndividualLayoutConstraint width
306 Constraint for the width.