.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. module:: wx.lib.sized_controls

.. currentmodule:: wx.lib.sized_controls

.. highlight:: python



.. _wx.lib.sized_controls:

==========================================================================================================================================
|phoenix_title|  **wx.lib.sized_controls**
==========================================================================================================================================

The sized controls default HIG compliant sizers under the hood and provides
a simple interface for customizing those sizers.

The following sized controls exist:

:class:`SizedFrame`
:class:`SizedDialog`
:class:`SizedPanel`
:class:`SizedScrolledPanel`
:class `SizedStaticBox`

Description
===========

The sized controls allow you to create sizer based layouts without having to
code the sizers by hand, but still provide you the manual detailed control of
the sizer and sizer items if necessary.

Usage
=====

Sample usage::

    import wx
    import wx.lib.sized_controls as sc

    app = wx.App(0)

    frame = sc.SizedFrame(None, -1, "A sized frame")

    pane = frame.GetContentsPane()
    pane.SetSizerType("horizontal")

    b1 = wx.Button(pane, wx.ID_ANY)
    t1 = wx.TextCtrl(pane, -1)
    t1.SetSizerProps(expand=True)

    frame.Show()

    app.MainLoop()


|function_summary| Functions Summary
====================================

================================================================================ ================================================================================
:func:`~wx.lib.sized_controls.GetDefaultBorder`                                  Return the platform specific default border.
:func:`~wx.lib.sized_controls.GetDefaultPanelBorder`                             Default panel border is set to 0 by default as the child control
:func:`~wx.lib.sized_controls.GetDialogBorder`                                   Get the platform specific dialog border.
:func:`~wx.lib.sized_controls.GetHGrow`                                          Get the horizontal grow value.
:func:`~wx.lib.sized_controls.GetSizerProps`                                     Returns a dictionary of prop name + value.
:func:`~wx.lib.sized_controls.GetVGrow`                                          Get the vertical grow value.
:func:`~wx.lib.sized_controls.SetDefaultSizerProps`                              Set default sizer properties.
:func:`~wx.lib.sized_controls.SetHGrow`                                          Set horizontal grow proportion.
:func:`~wx.lib.sized_controls.SetSizerProp`                                      Sets a sizer property
:func:`~wx.lib.sized_controls.SetSizerProps`                                     Allows to set multiple sizer properties
:func:`~wx.lib.sized_controls.SetVGrow`                                          Set vertical grow proportion.
================================================================================ ================================================================================


|


|class_summary| Classes Summary
===============================

================================================================================ ================================================================================
:ref:`~wx.lib.sized_controls.SizedDialog`                                        A sized dialog
:ref:`~wx.lib.sized_controls.SizedFrame`                                         A sized frame.
:ref:`~wx.lib.sized_controls.SizedPanel`                                         A sized panel.
:ref:`~wx.lib.sized_controls.SizedParent`                                        Mixin class for some methods used by the ``Sized*`` classes.
:ref:`~wx.lib.sized_controls.SizedScrolledPanel`                                 A sized scrolled panel.
:ref:`~wx.lib.sized_controls.SizedStaticBox`                                     StaticBox()
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.sized_controls.SizedDialog
   wx.lib.sized_controls.SizedFrame
   wx.lib.sized_controls.SizedPanel
   wx.lib.sized_controls.SizedParent
   wx.lib.sized_controls.SizedScrolledPanel
   wx.lib.sized_controls.SizedStaticBox





Functions
------------

.. function:: GetDefaultBorder(self)

   Return the platform specific default border.
   
   :rtype: `int`


.. function:: GetDefaultPanelBorder(self)

   Default panel border is set to 0 by default as the child control
   will set their borders.


.. function:: GetDialogBorder(self)

   Get the platform specific dialog border.
   
   :rtype: `int`


.. function:: GetHGrow(self)

   Get the horizontal grow value.
   
   :rtype: `int`


.. function:: GetSizerProps(self)

   Returns a dictionary of prop name + value.


.. function:: GetVGrow(self)

   Get the vertical grow value.
   
   :rtype: `int`


.. function:: SetDefaultSizerProps(self)

   Set default sizer properties.


.. function:: SetHGrow(self, proportion)

   Set horizontal grow proportion.
   
   :param int `proportion`: proportion to use


.. function:: SetSizerProp(self, prop, value)

   Sets a sizer property
   
   Sample usages::
   
       control.SetSizerProp('expand', True)
   
   :param string `prop`: valid strings are "proportion", "hgrow", "vgrow",
    "align", "halign", "valign", "border", "minsize" and "expand"
   :param `value`: corresponding value for the prop


.. function:: SetSizerProps(self, props={}, \*\*kwargs)

   Allows to set multiple sizer properties
   
   Sample usages::
   
       control.SetSizerProps(expand=True, proportion=1)
   
       control.SetSizerProps(expand=True, valign='center', border=(['top',
                                                                    'bottom'], 5))
   
       control.SetSizerProps({'growable_row': (1, 1),
                              'growable_col': (0, 1),})
   
   :param dict `props`: a dictionary of prop name + value
   :param `kwargs`: keywords can be used for properties, e.g. expand=True


.. function:: SetVGrow(self, proportion)

   Set vertical grow proportion.
   
   :param int `proportion`: proportion to use


