1wxSizerItem(3) Erlang Module Definition wxSizerItem(3)
2
3
4
6 wxSizerItem - Functions for wxSizerItem class
7
9 The wxSizerItem class is used to track the position, size and other at‐
10 tributes of each item managed by a wxSizer.
11
12 It is not usually necessary to use this class because the sizer ele‐
13 ments can also be identified by their positions or window or sizer
14 pointers but sometimes it may be more convenient to use it directly.
15
16 wxWidgets docs: wxSizerItem
17
19 wxSizerItem() = wx:wx_object()
20
22 new(Window) -> wxSizerItem()
23
24 Types:
25
26 Window = wxWindow:wxWindow() | wxSizer:wxSizer()
27
28 new(Width, Height) -> wxSizerItem()
29
30 new(Window, Flags) -> wxSizerItem()
31
32 new(Window, Height :: [Option]) -> wxSizerItem()
33
34 Types:
35
36 Window = wxWindow:wxWindow() | wxSizer:wxSizer()
37 Option =
38 {proportion, integer()} |
39 {flag, integer()} |
40 {border, integer()} |
41 {userData, wx:wx_object()}
42
43 new(Width, Height, Options :: [Option]) -> wxSizerItem()
44
45 Types:
46
47 Width = Height = integer()
48 Option =
49 {proportion, integer()} |
50 {flag, integer()} |
51 {border, integer()} |
52 {userData, wx:wx_object()}
53
54 Construct a sizer item for tracking a spacer.
55
56 destroy(This :: wxSizerItem()) -> ok
57
58 Deletes the user data and subsizer, if any.
59
60 calcMin(This) -> {W :: integer(), H :: integer()}
61
62 Types:
63
64 This = wxSizerItem()
65
66 Calculates the minimum desired size for the item, including any
67 space needed by borders.
68
69 deleteWindows(This) -> ok
70
71 Types:
72
73 This = wxSizerItem()
74
75 Destroy the window or the windows in a subsizer, depending on
76 the type of item.
77
78 detachSizer(This) -> ok
79
80 Types:
81
82 This = wxSizerItem()
83
84 Enable deleting the SizerItem without destroying the contained
85 sizer.
86
87 getBorder(This) -> integer()
88
89 Types:
90
91 This = wxSizerItem()
92
93 Return the border attribute.
94
95 getFlag(This) -> integer()
96
97 Types:
98
99 This = wxSizerItem()
100
101 Return the flags attribute.
102
103 See wxSizer flags list (not implemented in wx) for details.
104
105 getMinSize(This) -> {W :: integer(), H :: integer()}
106
107 Types:
108
109 This = wxSizerItem()
110
111 Get the minimum size needed for the item.
112
113 getPosition(This) -> {X :: integer(), Y :: integer()}
114
115 Types:
116
117 This = wxSizerItem()
118
119 What is the current position of the item, as set in the last
120 Layout.
121
122 getProportion(This) -> integer()
123
124 Types:
125
126 This = wxSizerItem()
127
128 Get the proportion item attribute.
129
130 getRatio(This) -> number()
131
132 Types:
133
134 This = wxSizerItem()
135
136 Get the ratio item attribute.
137
138 getRect(This) ->
139 {X :: integer(),
140 Y :: integer(),
141 W :: integer(),
142 H :: integer()}
143
144 Types:
145
146 This = wxSizerItem()
147
148 Get the rectangle of the item on the parent window, excluding
149 borders.
150
151 getSize(This) -> {W :: integer(), H :: integer()}
152
153 Types:
154
155 This = wxSizerItem()
156
157 Get the current size of the item, as set in the last Layout.
158
159 getSizer(This) -> wxSizer:wxSizer()
160
161 Types:
162
163 This = wxSizerItem()
164
165 If this item is tracking a sizer, return it.
166
167 NULL otherwise.
168
169 getSpacer(This) -> {W :: integer(), H :: integer()}
170
171 Types:
172
173 This = wxSizerItem()
174
175 If this item is tracking a spacer, return its size.
176
177 getUserData(This) -> wx:wx_object()
178
179 Types:
180
181 This = wxSizerItem()
182
183 Get the userData item attribute.
184
185 getWindow(This) -> wxWindow:wxWindow()
186
187 Types:
188
189 This = wxSizerItem()
190
191 If this item is tracking a window then return it.
192
193 NULL otherwise.
194
195 isSizer(This) -> boolean()
196
197 Types:
198
199 This = wxSizerItem()
200
201 Is this item a sizer?
202
203 isShown(This) -> boolean()
204
205 Types:
206
207 This = wxSizerItem()
208
209 Returns true if this item is a window or a spacer and it is
210 shown or if this item is a sizer and not all of its elements are
211 hidden.
212
213 In other words, for sizer items, all of the child elements must
214 be hidden for the sizer itself to be considered hidden.
215
216 As an exception, if the wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was
217 used for this sizer item, then isShown/1 always returns true for
218 it (see wxSizerFlags::ReserveSpaceEvenIfHidden() (not imple‐
219 mented in wx)).
220
221 isSpacer(This) -> boolean()
222
223 Types:
224
225 This = wxSizerItem()
226
227 Is this item a spacer?
228
229 isWindow(This) -> boolean()
230
231 Types:
232
233 This = wxSizerItem()
234
235 Is this item a window?
236
237 setBorder(This, Border) -> ok
238
239 Types:
240
241 This = wxSizerItem()
242 Border = integer()
243
244 Set the border item attribute.
245
246 setDimension(This, Pos, Size) -> ok
247
248 Types:
249
250 This = wxSizerItem()
251 Pos = {X :: integer(), Y :: integer()}
252 Size = {W :: integer(), H :: integer()}
253
254 Set the position and size of the space allocated to the sizer,
255 and adjust the position and size of the item to be within that
256 space taking alignment and borders into account.
257
258 setFlag(This, Flag) -> ok
259
260 Types:
261
262 This = wxSizerItem()
263 Flag = integer()
264
265 Set the flag item attribute.
266
267 setInitSize(This, X, Y) -> ok
268
269 Types:
270
271 This = wxSizerItem()
272 X = Y = integer()
273
274 Sets the minimum size to be allocated for this item.
275
276 This is identical to setMinSize/3, prefer to use the other func‐
277 tion, as its name is more clear.
278
279 setMinSize(This, Size) -> ok
280
281 Types:
282
283 This = wxSizerItem()
284 Size = {W :: integer(), H :: integer()}
285
286 Sets the minimum size to be allocated for this item.
287
288 If this item is a window, the size is also passed to wxWin‐
289 dow:setMinSize/2.
290
291 setMinSize(This, X, Y) -> ok
292
293 Types:
294
295 This = wxSizerItem()
296 X = Y = integer()
297
298 This is an overloaded member function, provided for convenience.
299 It differs from the above function only in what argument(s) it
300 accepts.
301
302 setProportion(This, Proportion) -> ok
303
304 Types:
305
306 This = wxSizerItem()
307 Proportion = integer()
308
309 Set the proportion item attribute.
310
311 setRatio(This, Ratio) -> ok
312
313 setRatio(This, Size) -> ok
314
315 Types:
316
317 This = wxSizerItem()
318 Size = {W :: integer(), H :: integer()}
319
320 setRatio(This, Width, Height) -> ok
321
322 Types:
323
324 This = wxSizerItem()
325 Width = Height = integer()
326
327 Set the ratio item attribute.
328
329 assignSizer(This, Sizer) -> ok
330
331 Types:
332
333 This = wxSizerItem()
334 Sizer = wxSizer:wxSizer()
335
336 Set the sizer tracked by this item.
337
338 Old sizer, if any, is deleted.
339
340 assignSpacer(This, Size) -> ok
341
342 Types:
343
344 This = wxSizerItem()
345 Size = {W :: integer(), H :: integer()}
346
347 Set the size of the spacer tracked by this item.
348
349 Old spacer, if any, is deleted.
350
351 assignSpacer(This, W, H) -> ok
352
353 Types:
354
355 This = wxSizerItem()
356 W = H = integer()
357
358 assignWindow(This, Window) -> ok
359
360 Types:
361
362 This = wxSizerItem()
363 Window = wxWindow:wxWindow()
364
365 Set the window to be tracked by this item.
366
367 Note: This is a low-level method which is dangerous if used in‐
368 correctly, avoid using it if possible, i.e. if higher level
369 methods such as wxSizer:replace/4 can be used instead.
370
371 If the sizer item previously contained a window, it is dissoci‐
372 ated from the sizer containing this sizer item (if any), but
373 this object doesn't have the pointer to the containing sizer and
374 so it's the caller's responsibility to call wxWindow:setContain‐
375 ingSizer/2 on window. Failure to do this can result in memory
376 corruption when the window is destroyed later, so it is crucial
377 to not forget to do it.
378
379 Also note that the previously contained window is not deleted,
380 so it's also the callers responsibility to do it, if necessary.
381
382 show(This, Show) -> ok
383
384 Types:
385
386 This = wxSizerItem()
387 Show = boolean()
388
389 Set the show item attribute, which sizers use to determine if
390 the item is to be made part of the layout or not.
391
392 If the item is tracking a window then it is shown or hidden as
393 needed.
394
395
396
397wxWidgets team. wx 2.2.2 wxSizerItem(3)