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 191 192 193 194 195 196
|
.. 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
.. currentmodule:: wx.lib.agw.buttonpanel
.. highlight:: python
.. _wx.lib.agw.buttonpanel.BoxSizer:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.buttonpanel.BoxSizer**
==========================================================================================================================================
Pseudo-class that imitates :class:`BoxSizer`.
|
|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>BoxSizer</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.lib.agw.buttonpanel.BoxSizer_inheritance.png" alt="Inheritance diagram of BoxSizer" 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="231,160,329,189"/> <area shape="rect" id="node4" href="wx.lib.agw.buttonpanel.BoxSizer.html" title="wx.lib.agw.buttonpanel.BoxSizer" alt="" coords="79,237,304,267"/> <area shape="rect" id="node2" href="wx.Sizer.html" title="wx.Sizer" alt="" coords="243,83,316,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="239,5,320,35"/> <area shape="rect" id="node5" href="wx.lib.agw.buttonpanel.Sizer.html" title="wx.lib.agw.buttonpanel.Sizer" alt="" coords="5,160,205,189"/> </map>
</p>
|
|super_classes| Known Superclasses
==================================
:class:`wx.BoxSizer`, :class:`wx.lib.agw.buttonpanel.Sizer`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.buttonpanel.BoxSizer.__init__` Constructor for :class:`BoxSizer`.
:meth:`~wx.lib.agw.buttonpanel.BoxSizer.Add` Appends a child item to the sizer.
:meth:`~wx.lib.agw.buttonpanel.BoxSizer.Insert` Inserts a child item into the sizer.
:meth:`~wx.lib.agw.buttonpanel.BoxSizer.Layout` Call this to force layout of the children anew, e.g. after having added a
:meth:`~wx.lib.agw.buttonpanel.BoxSizer.Prepend` Prepends a child item to the sizer.
:meth:`~wx.lib.agw.buttonpanel.BoxSizer.Remove` Removes an item from the sizer and destroys it.
:meth:`~wx.lib.agw.buttonpanel.BoxSizer.Show` Shows or hides the sizer item.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: BoxSizer(Sizer, wx.BoxSizer)
Pseudo-class that imitates :class:`BoxSizer`.
.. method:: __init__(self, orient=wx.HORIZONTAL)
Constructor for :class:`BoxSizer`.
:param integer `orient`: may be one of ``wx.VERTICAL`` or ``wx.HORIZONTAL`` for creating
either a column sizer or a row sizer.
.. method:: Add(self, item, proportion=0, flag=0, border=0, userData=None)
Appends a child item to the sizer.
:param `item`: the item to be added to :class:`BoxSizer`. Can be an instance of :class:`wx.Window`,
:class:`wx.Sizer` or a spacer;
:param integer `proportion`: this parameter is used in :class:`BoxSizer` to indicate if a child of
a sizer can change its size in the main orientation of the :class:`BoxSizer` - where 0
stands for not changeable and a value of more than zero is interpreted relative
to the value of other children of the same :class:`BoxSizer`. For example, you might have
a horizontal :class:`BoxSizer` with three children, two of which are supposed to change their
size with the sizer. Then the two stretchable windows would get a value of 1 each to
make them grow and shrink equally with the sizer's horizontal dimension.
:param integer `flag`: this parameter can be used to set a number of flags which can be combined using the binary OR operator ``|``.
Two main behaviours are defined using these flags. One is the border around a window: the border parameter determines the border
width whereas the flags given here determine which side(s) of the item that the border will be added. The other flags determine
how the sizer item behaves when the space allotted to the sizer changes, and is somewhat dependent on the specific kind of sizer used:
+-----------------------------------------------------------------------+------------------------------------------------------------------------------+
| Sizer Flag | Description |
+=======================================================================+==============================================================================+
| | ``wx.TOP`` | These flags are used to specify which side(s) of the sizer |
| | ``wx.BOTTOM`` | item the border width will apply to. |
| | ``wx.LEFT`` | |
| | ``wx.RIGHT`` | |
| | ``wx.ALL`` | |
+-----------------------------------------------------------------------+------------------------------------------------------------------------------+
| ``wx.EXPAND`` | The item will be expanded to fill the space assigned to |
| | the item. |
+-----------------------------------------------------------------------+------------------------------------------------------------------------------+
| ``wx.SHAPED`` | The item will be expanded as much as possible while also |
| | maintaining its aspect ratio |
+-----------------------------------------------------------------------+------------------------------------------------------------------------------+
| ``wx.FIXED_MINSIZE`` | Normally :class:`wx.Sizer` will use |
| | :meth:`wx.Window.GetEffectiveMinSize` to |
| | determine what the minimal size of window items should be, and will use that |
| | size to calculate the layout. This allows layouts to adjust when an item |
| | changes and its best size becomes different. If you would rather have a |
| | window item stay the size it started with then use ``wx.FIXED_MINSIZE``. |
+-----------------------------------------------------------------------+------------------------------------------------------------------------------+
| ``wx.RESERVE_SPACE_EVEN_IF_HIDDEN`` | Normally `Sizers` don't allocate space for hidden windows or other items. |
| | This flag overrides this behavior so that sufficient space is allocated for |
| | the window even if it isn't visible. This makes it possible to dynamically |
| | show and hide controls without resizing parent dialog, for example. This |
| | function is new since wxWidgets version 2.8.8 |
+-----------------------------------------------------------------------+------------------------------------------------------------------------------+
| | ``wx.ALIGN_CENTER`` **or** ``wx.ALIGN_CENTRE`` | The ``wx.ALIGN*`` flags allow you to specify the alignment of the item |
| | ``wx.ALIGN_LEFT`` | within the space allotted to it by the sizer, adjusted for the border if |
| | ``wx.ALIGN_RIGHT`` | any. |
| | ``wx.ALIGN_TOP`` | |
| | ``wx.ALIGN_BOTTOM`` | |
| | ``wx.ALIGN_CENTER_VERTICAL`` **or** ``wx.ALIGN_CENTRE_VERTICAL`` | |
| | ``wx.ALIGN_CENTER_HORIZONTAL`` **or** ``wx.ALIGN_CENTRE_HORIZONTAL``| |
+-----------------------------------------------------------------------+------------------------------------------------------------------------------+
:param integer `border`: determines the border width, if the flag parameter is set
to include any border flag.
:param object `userData`: Allows an extra object to be attached to the sizer item,
for use in derived classes when sizing information is more complex than the
proportion and flag will allow for.
:note: there is no support for `userData` parameter if `item` is a pseudocontrol,
since that is already used.
.. method:: Insert(self, before, item, proportion=0, flag=0, border=0, userData=None, realIndex=None)
Inserts a child item into the sizer.
:see: :meth:`BoxSizer.Add` method for an explanation of the input parameters.
.. method:: Layout(self)
Call this to force layout of the children anew, e.g. after having added a
child to or removed a child (window, other sizer or space) from the sizer
while keeping the current dimension.
.. method:: Prepend(self, item, proportion=0, flag=0, border=0, userData=None)
Prepends a child item to the sizer.
:see: :meth:`BoxSizer.Add` method for an explanation of the input parameters.
.. method:: Remove(self, indx, pop=-1)
Removes an item from the sizer and destroys it.
This method does not cause any layout or resizing to take place, call
:meth:`BoxSizer.Layout() <BoxSizer.Layout>` to update the layout on screen after removing a child from
the sizer.
:param integer `indx`: the zero-based index of an item to remove;
:param bool `pop`: whether to remove the sizer item from the list of children.
.. method:: Show(self, item, show=True)
Shows or hides the sizer item.
:param `item`: the sizer item we want to show/hide;
:param bool `show`: ``True`` to show the item, ``False`` to hide it.
|