File: wx.WrapSizer.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (190 lines) | stat: -rw-r--r-- 6,140 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.WrapSizer:

==========================================================================================================================================
|phoenix_title|  **wx.WrapSizer**
==========================================================================================================================================

A wrap sizer lays out its items in a single line, like a box sizer          

Once all available space in the primary direction has been used, a new line is added and items are added there. 

So a wrap sizer has a primary orientation for adding items, and adds lines as needed in the secondary direction. 







         



.. seealso:: :ref:`wx.BoxSizer`, :ref:`wx.Sizer`, :ref:`Sizers Overview <sizers overview>`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>WrapSizer</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.WrapSizer_inheritance.png" alt="Inheritance diagram of WrapSizer" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.BoxSizer.html" title="wx.BoxSizer" alt="" coords="8,160,107,189"/> <area shape="rect" id="node4" href="wx.WrapSizer.html" title="wx.WrapSizer" alt="" coords="5,237,109,267"/> <area shape="rect" id="node2" href="wx.Sizer.html" title="wx.Sizer" alt="" coords="20,83,93,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="16,5,97,35"/> </map> 
   </p>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.WrapSizer.__init__`                                                   Constructor for a :ref:`wx.WrapSizer`.
:meth:`~wx.WrapSizer.CalcMin`                                                    Implements the calculation of a box sizer's minimal.
:meth:`~wx.WrapSizer.InformFirstDirection`                                       Not used by an application.
:meth:`~wx.WrapSizer.IsSpaceItem`                                                Can be overridden in the derived classes to treat some normal items as spacers.
:meth:`~wx.WrapSizer.RecalcSizes`                                                Implements the calculation of a box sizer's dimensions and then sets the size of its children (calling :meth:`wx.Window.SetSize`   if the child is a window).
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.WrapSizer(BoxSizer)

   **Possible constructors**::

       WrapSizer(orient=HORIZONTAL, flags=WRAPSIZER_DEFAULT_FLAGS)
       
   
   A wrap sizer lays out its items in a single line, like a box sizer  as
   long as there is space available in that direction.



   .. method:: __init__(self, orient=HORIZONTAL, flags=WRAPSIZER_DEFAULT_FLAGS)

      Constructor for a :ref:`wx.WrapSizer`.                  

      `orient`  determines the primary direction of the sizer (the most common case being  ``HORIZONTAL`` ). The flags parameter can be a combination of the values   ``EXTEND_LAST_ON_EACH_LINE``   which will cause the last item on each line to use any remaining space on that line and   ``REMOVE_LEADING_SPACES``   which removes any spacer elements from the beginning of a row. 

      Both of these flags are on by default.                  


      :param `orient`: 
      :type `orient`: int
      :param `flags`: 
      :type `flags`: int







   .. method:: CalcMin(self)

      Implements the calculation of a box sizer's minimal.                  

      It is used internally only and must not be called by the user. Documented for information.                  

      :rtype: :ref:`wx.Size`








   .. method:: InformFirstDirection(self, direction, size, availableOtherDir)

      Not used by an application.                  

      This is the mechanism by which sizers can inform sub-items of the first determined size component. The sub-item can then better determine its size requirements. 

      Returns ``True`` if the information was used (and the sub-item min size was updated).                  


      :param `direction`: 
      :type `direction`: int
      :param `size`: 
      :type `size`: int
      :param `availableOtherDir`: 
      :type `availableOtherDir`: int




      :rtype: `bool`








   .. method:: IsSpaceItem(self, item)

      Can be overridden in the derived classes to treat some normal items as spacers.                  

      This method is used to determine whether the given `item`  should be considered to be a spacer for the purposes of  ``REMOVE_LEADING_SPACES``   implementation. By default only returns ``True`` for the real spacers.                   


      :param `item`: 
      :type `item`: wx.SizerItem




      :rtype: `bool`








   .. method:: RecalcSizes(self)

      Implements the calculation of a box sizer's dimensions and then sets the size of its children (calling :meth:`wx.Window.SetSize`   if the child is a window).                  

      It is used internally only and must not be called by the user (call :meth:`Layout`   if you want to resize). Documented for information.