]>
Commit | Line | Data |
---|---|---|
20b35a69 RD |
1 | |
2 | \section{\class{wxSizerItem}}\label{wxsizeritem} | |
3 | ||
4 | The wxSizerItem class is used to track the position, size and other | |
1b2afc5a VZ |
5 | attributes of each item managed by a \helpref{wxSizer}{wxsizer}. It is not |
6 | usually necessary to use this class because the sizer elements can also be | |
7 | identified by their positions or window or sizer pointers but sometimes it may | |
8 | be more convenient to use it directly. | |
20b35a69 RD |
9 | |
10 | ||
11 | \wxheading{Derived from} | |
12 | ||
13 | \helpref{wxObject}{wxobject} | |
14 | ||
15 | \wxheading{Include files} | |
16 | ||
17 | <wx/sizer.h> | |
18 | ||
a7af285d VZ |
19 | \wxheading{Library} |
20 | ||
21 | \helpref{wxCore}{librarieslist} | |
22 | ||
20b35a69 RD |
23 | |
24 | \latexignore{\rtfignore{\wxheading{Members}}} | |
25 | ||
26 | ||
27 | \membersection{wxSizerItem::wxSizerItem}\label{wxsizeritemwxsizeritem} | |
28 | ||
29 | \func{}{wxSizerItem}{\param{int }{width}, \param{int }{height}, \param{int }{proportion}, \param{int }{flag}, \param{int }{border}, \param{wxObject* }{userData}} | |
30 | ||
31 | Construct a sizer item for tracking a spacer. | |
32 | ||
33 | ||
40210d8a RN |
34 | \func{}{wxSizerItem}{\param{wxWindow* }{window}, \param{const wxSizerFlags\& }{flags}} |
35 | ||
20b35a69 RD |
36 | \func{}{wxSizerItem}{\param{wxWindow* }{window}, \param{int }{proportion}, \param{int }{flag}, \param{int }{border}, \param{wxObject* }{userData}} |
37 | ||
38 | Construct a sizer item for tracking a window. | |
39 | ||
40 | ||
40210d8a RN |
41 | \func{}{wxSizerItem}{\param{wxSizer* }{window}, \param{const wxSizerFlags\& }{flags}} |
42 | ||
20b35a69 RD |
43 | \func{}{wxSizerItem}{\param{wxSizer* }{sizer}, \param{int }{proportion}, \param{int }{flag}, \param{int }{border}, \param{wxObject* }{userData}} |
44 | ||
45 | Construct a sizer item for tracking a subsizer. | |
46 | ||
47 | ||
48 | ||
49 | \membersection{wxSizerItem::\destruct{wxSizerItem}}\label{wxsizeritemdtor} | |
50 | ||
51 | \func{}{\destruct{wxSizerItem}}{\void} | |
52 | ||
53 | Deletes the user data and subsizer, if any. | |
54 | ||
55 | ||
56 | \membersection{wxSizerItem::CalcMin}\label{wxsizeritemcalcmin} | |
57 | ||
58 | \func{wxSize}{CalcMin}{\void} | |
59 | ||
60 | Calculates the minimum desired size for the item, including any space | |
61 | needed by borders. | |
62 | ||
63 | ||
64 | \membersection{wxSizerItem::DeleteWindows}\label{wxsizeritemdeletewindows} | |
65 | ||
66 | \func{void}{DeleteWindows}{\void} | |
67 | ||
68 | Destroy the window or the windows in a subsizer, depending on the type | |
69 | of item. | |
70 | ||
71 | ||
72 | \membersection{wxSizerItem::DetachSizer}\label{wxsizeritemdetachsizer} | |
73 | ||
74 | \func{void}{DetachSizer}{\void} | |
75 | ||
76 | Enable deleting the SizerItem without destroying the contained sizer. | |
77 | ||
78 | ||
79 | \membersection{wxSizerItem::GetBorder}\label{wxsizeritemgetborder} | |
80 | ||
81 | \constfunc{int}{GetBorder}{\void} | |
82 | ||
83 | Return the border attribute. | |
84 | ||
85 | \membersection{wxSizerItem::GetFlag}\label{wxsizeritemgetflag} | |
86 | ||
87 | \constfunc{int}{GetFlag}{\void} | |
88 | ||
89 | Return the flags attribute. | |
90 | ||
91 | ||
92 | \membersection{wxSizerItem::GetMinSize}\label{wxsizeritemgetminsize} | |
93 | ||
94 | \constfunc{wxSize}{GetMinSize}{\void} | |
95 | ||
96 | Get the minimum size needed for the item. | |
97 | ||
98 | \membersection{wxSizerItem::GetPosition}\label{wxsizeritemgetposition} | |
99 | ||
100 | \constfunc{wxPoint}{GetPosition}{\void} | |
101 | ||
102 | What is the current position of the item, as set in the last Layout. | |
103 | ||
104 | \membersection{wxSizerItem::GetProportion}\label{wxsizeritemgetproportion} | |
105 | ||
106 | \constfunc{int}{GetProportion}{\void} | |
107 | ||
108 | Get the proportion item attribute. | |
109 | ||
110 | \membersection{wxSizerItem::GetRatio}\label{wxsizeritemgetratio} | |
111 | ||
112 | \constfunc{float}{GetRatio}{\void} | |
113 | ||
114 | Get the ration item attribute. | |
115 | ||
56eee37f WS |
116 | \membersection{wxSizerItem::GetRect}\label{wxsizeritemgetrect} |
117 | ||
118 | \func{wxRect}{GetRect}{\void} | |
119 | ||
e6994168 | 120 | Get the rectangle of the item on the parent window, excluding borders. |
56eee37f | 121 | |
20b35a69 RD |
122 | \membersection{wxSizerItem::GetSize}\label{wxsizeritemgetsize} |
123 | ||
124 | \constfunc{wxSize}{GetSize}{\void} | |
125 | ||
126 | Get the current size of the item, as set in the last Layout. | |
127 | ||
128 | \membersection{wxSizerItem::GetSizer}\label{wxsizeritemgetsizer} | |
129 | ||
130 | \constfunc{wxSizer*}{GetSizer}{\void} | |
131 | ||
132 | If this item is tracking a sizer, return it. NULL otherwise. | |
133 | ||
134 | ||
135 | \membersection{wxSizerItem::GetSpacer}\label{wxsizeritemgetspacer} | |
136 | ||
137 | \constfunc{const wxSize\&}{GetSpacer}{\void} | |
138 | ||
139 | If this item is tracking a spacer, return its size. | |
140 | ||
141 | ||
142 | \membersection{wxSizerItem::GetUserData}\label{wxsizeritemgetuserdata} | |
143 | ||
144 | \constfunc{wxObject*}{GetUserData}{\void} | |
145 | ||
146 | Get the userData item attribute. | |
147 | ||
148 | ||
149 | \membersection{wxSizerItem::GetWindow}\label{wxsizeritemgetwindow} | |
150 | ||
151 | \constfunc{wxWindow*}{GetWindow}{\void} | |
152 | ||
3103e8a9 | 153 | If this item is tracking a window then return it. NULL otherwise. |
20b35a69 | 154 | |
20b35a69 RD |
155 | |
156 | \membersection{wxSizerItem::IsSizer}\label{wxsizeritemissizer} | |
157 | ||
158 | \constfunc{bool}{IsSizer}{\void} | |
159 | ||
160 | Is this item a sizer? | |
161 | ||
162 | ||
c86fd3a7 VZ |
163 | \membersection{wxSizerItem::IsShown}\label{wxsizeritemisshown} |
164 | ||
165 | \constfunc{bool}{IsShown}{\void} | |
166 | ||
167 | Returns \true if this item is a window or a spacer and it is shown or if this | |
168 | item is a sizer and not all its elements are hidden. In other words, for sizer | |
169 | items, all of the child elements must be hidden for the sizer itself to be | |
170 | considered hidden. | |
171 | ||
172 | ||
20b35a69 RD |
173 | \membersection{wxSizerItem::IsSpacer}\label{wxsizeritemisspacer} |
174 | ||
175 | \constfunc{bool}{IsSpacer}{\void} | |
176 | ||
177 | Is this item a spacer? | |
178 | ||
179 | ||
180 | \membersection{wxSizerItem::IsWindow}\label{wxsizeritemiswindow} | |
181 | ||
182 | \constfunc{bool}{IsWindow}{\void} | |
183 | ||
184 | Is this item a window? | |
185 | ||
186 | ||
187 | \membersection{wxSizerItem::SetBorder}\label{wxsizeritemsetborder} | |
188 | ||
189 | \func{void}{SetBorder}{\param{int }{border}} | |
190 | ||
191 | Set the border item attribute. | |
192 | ||
193 | \membersection{wxSizerItem::SetDimension}\label{wxsizeritemsetdimension} | |
194 | ||
fbfb8bcc | 195 | \func{void}{SetDimension}{\param{const wxPoint\& }{pos}, \param{const wxSize\& }{size}} |
20b35a69 RD |
196 | |
197 | Set the position and size of the space allocated to the sizer, and | |
198 | adjust the position and size of the item to be within that space | |
199 | taking alignment and borders into account. | |
200 | ||
201 | ||
202 | \membersection{wxSizerItem::SetFlag}\label{wxsizeritemsetflag} | |
203 | ||
204 | \func{void}{SetFlag}{\param{int }{flag}} | |
205 | ||
206 | Set the flag item attribute. | |
207 | ||
208 | ||
209 | \membersection{wxSizerItem::SetInitSize}\label{wxsizeritemsetinitsize} | |
210 | ||
211 | \func{void}{SetInitSize}{\param{int }{x}, \param{int }{y}} | |
212 | ||
213 | ||
214 | \membersection{wxSizerItem::SetProportion}\label{wxsizeritemsetproportion} | |
215 | ||
216 | \func{void}{SetProportion}{\param{int }{proportion}} | |
217 | ||
218 | Set the proportion item attribute. | |
219 | ||
220 | \membersection{wxSizerItem::SetRatio}\label{wxsizeritemsetratio} | |
221 | ||
222 | \func{void}{SetRatio}{\param{int }{width}, \param{int }{height}} | |
223 | ||
224 | \func{void}{SetRatio}{\param{wxSize }{size}} | |
225 | ||
226 | \func{void}{SetRatio}{\param{float }{ratio}} | |
227 | ||
228 | Set the ratio item attribute. | |
229 | ||
230 | ||
231 | \membersection{wxSizerItem::SetSizer}\label{wxsizeritemsetsizer} | |
232 | ||
233 | \func{void}{SetSizer}{\param{wxSizer* }{sizer}} | |
234 | ||
235 | Set the sizer tracked by this item. | |
236 | ||
237 | ||
238 | \membersection{wxSizerItem::SetSpacer}\label{wxsizeritemsetspacer} | |
239 | ||
240 | \func{void}{SetSpacer}{\param{const wxSize\& }{size}} | |
241 | ||
242 | Set the size of the spacer tracked by this item. | |
243 | ||
244 | ||
245 | \membersection{wxSizerItem::SetWindow}\label{wxsizeritemsetwindow} | |
246 | ||
247 | \func{void}{SetWindow}{\param{wxWindow* }{window}} | |
248 | ||
249 | Set the window to be tracked by thsi item. | |
250 | ||
251 | ||
252 | \membersection{wxSizerItem::Show}\label{wxsizeritemshow} | |
253 | ||
254 | \func{void}{Show}{\param{bool }{show}} | |
255 | ||
256 | Set the show item attribute, which sizers use to determine if the item | |
257 | is to be made part of the layout or not. If the item is tracking a | |
258 | window then it is shown or hidden as needed. | |
259 |