****************** wx.CollapsiblePane ****************** Inheritance diagram for `wx.CollapsiblePane`: | .. inheritance-diagram:: wx.CollapsiblePane | Description =========== A collapsible pane is a container with an embedded button-like control which can be used by the user to collapse or expand the pane's contents. Once constructed you should use the `GetPane <#GetPane>`_ function to access the pane and add your controls inside it (i.e. use the `GetPane <#GetPane>`_ 's returned pointer as parent for the controls which must go in the pane, NOT the `wx.CollapsiblePane` itself!). Note that because of its nature of control which can dynamically (and drastically) change its size at run-time under user-input, when putting `wx.CollapsiblePane` inside a `wx.Sizer `_ you should be careful to add it with a proportion value of zero; this is because otherwise all other windows with non-null proportion values would automatically get resized each time the user expands or collapse the pane window resulting usually in a weird, flickering effect. For example:: # Create a wx.CollapsiblePane widget collpane = wx.CollapsiblePane(self, wx.ID_ANY, "Details:") # Add the pane with a zero proportion value to the 'sz' sizer # which contains it sz.Add(collpane, 0, wx.GROW|wx.ALL, 5) # Now add a test label in the collapsible pane using a sizer to layout it: win = collpane.GetPane() paneSz = wx.BoxSizer(wx.VERTICAL) paneSz.Add(wx.StaticText(win, wx.ID_ANY, "test"), 1, wx.GROW|wx.ALL, 2) win.SetSizer(paneSz) paneSz.SetSizeHints(win) .. seealso:: `wx.Panel `_, `wx.CollapsiblePaneEvent <../Events/wx.CollapsiblePaneEvent.html>`_ Derived From ^^^^^^^^^^^^^ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Window Styles ^^^^^^^^^^^^^ ================================================== ================================================== Window Style Description ================================================== ================================================== ``wx.CP_DEFAULT_STYLE`` The default style: 0. ================================================== ================================================== Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_COLLAPSIBLEPANE_CHANGED(id, func) The user showed or hidden the collapsible pane. ================================================== ================================================== | Control Appearance ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/collapsiblepane.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/collapsiblepane.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/collapsiblepane.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Collapse <#Collapse>`_ * `Expand <#Expand>`_ * `GetPane <#GetPane>`_ * `IsCollapsed <#IsCollapsed>`_ * `IsExpanded <#IsExpanded>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Collapsed <#Collapsed>`_ * `Expanded <#Expanded>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, winid=-1, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CP_DEFAULT_STYLE, val=wx.DefaultValidator, name=wx.CollapsiblePaneNameStr) Create and show a `wx.CollapsiblePane`. **Parameters:** * `parent` (`wx.Window `_) * `winid` (int) * `label` (string) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `val` (`wx.Validator `_) * `name` (string) | **Returns:** `wx.CollapsiblePane `_ -------- .. method:: Collapse() Collapses or expands the pane window. -------- .. method:: Expand() Same as `Collapse <#Collapse>`_ (``False``). -------- .. method:: GetPane() Returns a pointer to the pane window. Add controls to the returned `wx.Window `_ to make them collapsible. | **Returns:** `wx.Window `_ -------- .. method:: IsCollapsed() Returns ``True`` if the pane window is currently hidden. | **Returns:** `bool` -------- .. method:: IsExpanded() Returns ``True`` if the pane window is currently shown. | **Returns:** `bool` -------- Properties ^^^^^^^^^^ .. attribute:: Collapsed Returns ``True`` if the pane window is currently hidden. .. attribute:: Expanded Returns ``True`` if the pane window is currently shown.