]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxIndividualLayoutConstraint}}\label{wxindividuallayoutconstraint} |
2 | ||
3f8e5072 | 3 | Objects of this class are stored in the wxLayoutConstraint class |
a660d684 KB |
4 | as one of eight possible constraints that a window can be involved in. |
5 | ||
6 | Constraints are initially set to have the relationship wxUnconstrained, | |
7 | which means that their values should be calculated by looking at known constraints. | |
8 | ||
9 | \wxheading{Derived from} | |
10 | ||
11 | \helpref{wxObject}{wxobject} | |
12 | ||
954b8ae6 JS |
13 | \wxheading{Include files} |
14 | ||
15 | <wx/layout.h> | |
16 | ||
a7af285d VZ |
17 | \wxheading{Library} |
18 | ||
19 | \helpref{wxCore}{librarieslist} | |
20 | ||
a660d684 KB |
21 | \wxheading{See also} |
22 | ||
23 | \helpref{Overview and examples}{constraintsoverview},\rtfsp | |
24 | \helpref{wxLayoutConstraints}{wxlayoutconstraints}, \helpref{wxWindow::SetConstraints}{wxwindowsetconstraints}. | |
25 | ||
26 | \latexignore{\rtfignore{\wxheading{Members}}} | |
27 | ||
f0e8a2d0 | 28 | \subsection{Edges and relationships}\label{edgesandrelationships} |
a660d684 | 29 | |
a660d684 KB |
30 | The {\it wxEdge}\index{wxEdge} enumerated type specifies the type of edge or dimension of a window. |
31 | ||
32 | \begin{twocollist}\itemsep=0pt | |
33 | \twocolitem{wxLeft}{The left edge.} | |
34 | \twocolitem{wxTop}{The top edge.} | |
35 | \twocolitem{wxRight}{The right edge.} | |
36 | \twocolitem{wxBottom}{The bottom edge.} | |
37 | \twocolitem{wxCentreX}{The x-coordinate of the centre of the window.} | |
38 | \twocolitem{wxCentreY}{The y-coordinate of the centre of the window.} | |
39 | \end{twocollist} | |
40 | ||
41 | The {\it wxRelationship}\index{wxRelationship} enumerated type specifies the relationship that | |
42 | this edge or dimension has with another specified edge or dimension. Normally, the user | |
43 | doesn't use these directly because functions such as {\it Below} and {\it RightOf} are a convenience | |
44 | for using the more general {\it Set} function. | |
45 | ||
46 | \begin{twocollist}\itemsep=0pt | |
47 | \twocolitem{wxUnconstrained}{The edge or dimension is unconstrained (the default for edges.} | |
48 | \twocolitem{wxAsIs}{The edge or dimension is to be taken from the current window position or size (the | |
49 | default for dimensions.} | |
50 | \twocolitem{wxAbove}{The edge should be above another edge.} | |
51 | \twocolitem{wxBelow}{The edge should be below another edge.} | |
52 | \twocolitem{wxLeftOf}{The edge should be to the left of another edge.} | |
53 | \twocolitem{wxRightOf}{The edge should be to the right of another edge.} | |
54 | \twocolitem{wxSameAs}{The edge or dimension should be the same as another edge or dimension.} | |
55 | \twocolitem{wxPercentOf}{The edge or dimension should be a percentage of another edge or dimension.} | |
56 | \twocolitem{wxAbsolute}{The edge or dimension should be a given absolute value.} | |
57 | \end{twocollist} | |
58 | ||
f0e8a2d0 | 59 | \membersection{wxIndividualLayoutConstraint::wxIndividualLayoutConstraint}\label{wxindividuallayoutconstraintctor} |
a660d684 KB |
60 | |
61 | \func{void}{wxIndividualLayoutConstraint}{\void} | |
62 | ||
63 | Constructor. Not used by the end-user. | |
64 | ||
f0e8a2d0 | 65 | \membersection{wxIndividualLayoutConstraint::Above}\label{wxindividuallayoutconstraintabove} |
a660d684 KB |
66 | |
67 | \func{void}{Above}{\param{wxWindow *}{otherWin}, \param{int}{ margin = 0}} | |
68 | ||
69 | Constrains this edge to be above the given window, with an | |
70 | optional margin. Implicitly, this is relative to the top edge of the other window. | |
71 | ||
f0e8a2d0 | 72 | \membersection{wxIndividualLayoutConstraint::Absolute}\label{wxindividuallayoutconstraintabsolute} |
a660d684 KB |
73 | |
74 | \func{void}{Absolute}{\param{int}{ value}} | |
75 | ||
76 | Constrains this edge or dimension to be the given absolute value. | |
77 | ||
f0e8a2d0 | 78 | \membersection{wxIndividualLayoutConstraint::AsIs}\label{wxindividuallayoutconstraintasis} |
a660d684 KB |
79 | |
80 | \func{void}{AsIs}{\void} | |
81 | ||
82 | Sets this edge or constraint to be whatever the window's value is | |
83 | at the moment. If either of the width and height constraints | |
84 | are {\it as is}, the window will not be resized, but moved instead. | |
85 | This is important when considering panel items which are intended | |
86 | to have a default size, such as a button, which may take its size | |
87 | from the size of the button label. | |
88 | ||
f0e8a2d0 | 89 | \membersection{wxIndividualLayoutConstraint::Below}\label{wxindividuallayoutconstraintbelow} |
a660d684 KB |
90 | |
91 | \func{void}{Below}{\param{wxWindow *}{otherWin}, \param{int}{ margin = 0}} | |
92 | ||
93 | Constrains this edge to be below the given window, with an | |
94 | optional margin. Implicitly, this is relative to the bottom edge of the other window. | |
95 | ||
f0e8a2d0 | 96 | \membersection{wxIndividualLayoutConstraint::Unconstrained}\label{wxindividuallayoutconstraintunconstrained} |
a660d684 KB |
97 | |
98 | \func{void}{Unconstrained}{\void} | |
99 | ||
100 | Sets this edge or dimension to be unconstrained, that is, dependent on | |
101 | other edges and dimensions from which this value can be deduced. | |
102 | ||
f0e8a2d0 | 103 | \membersection{wxIndividualLayoutConstraint::LeftOf}\label{wxindividuallayoutconstraintleftof} |
a660d684 KB |
104 | |
105 | \func{void}{LeftOf}{\param{wxWindow *}{otherWin}, \param{int}{ margin = 0}} | |
106 | ||
107 | Constrains this edge to be to the left of the given window, with an | |
108 | optional margin. Implicitly, this is relative to the left edge of the other window. | |
109 | ||
f0e8a2d0 | 110 | \membersection{wxIndividualLayoutConstraint::PercentOf}\label{wxindividuallayoutconstraintpercentof} |
a660d684 | 111 | |
3f8e5072 | 112 | \func{void}{PercentOf}{\param{wxWindow *}{otherWin}, \param{wxEdge}{ edge}, \param{int}{ per}} |
a660d684 KB |
113 | |
114 | Constrains this edge or dimension to be to a percentage of the given window, with an | |
115 | optional margin. | |
116 | ||
f0e8a2d0 | 117 | \membersection{wxIndividualLayoutConstraint::RightOf}\label{wxindividuallayoutconstraintrightof} |
a660d684 KB |
118 | |
119 | \func{void}{RightOf}{\param{wxWindow *}{otherWin}, \param{int}{ margin = 0}} | |
120 | ||
121 | Constrains this edge to be to the right of the given window, with an | |
122 | optional margin. Implicitly, this is relative to the right edge of the other window. | |
123 | ||
f0e8a2d0 | 124 | \membersection{wxIndividualLayoutConstraint::SameAs}\label{wxindividuallayoutconstraintsameas} |
a660d684 KB |
125 | |
126 | \func{void}{SameAs}{\param{wxWindow *}{otherWin}, \param{wxEdge}{ edge}, \param{int}{ margin = 0}} | |
127 | ||
128 | Constrains this edge or dimension to be to the same as the edge of the given window, with an | |
129 | optional margin. | |
130 | ||
f0e8a2d0 | 131 | \membersection{wxIndividualLayoutConstraint::Set}\label{wxindividuallayoutconstraintset} |
a660d684 KB |
132 | |
133 | \func{void}{Set}{\param{wxRelationship}{ rel}, \param{wxWindow *}{otherWin}, \param{wxEdge}{ otherEdge}, | |
134 | \param{int}{ value = 0}, \param{int}{ margin = 0}} | |
135 | ||
136 | Sets the properties of the constraint. Normally called by one of the convenience | |
137 | functions such as Above, RightOf, SameAs. | |
138 | ||
139 |