.. 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

.. currentmodule:: wx.lib.agw.infobar

.. highlight:: python



.. _wx.lib.agw.infobar.AutoWrapStaticText:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.infobar.AutoWrapStaticText**
==========================================================================================================================================

A simple class derived from :mod:`lib.stattext` that implements auto-wrapping
behaviour depending on the parent size.

.. versionadded:: 0.9.5



|

|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>AutoWrapStaticText</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.infobar.AutoWrapStaticText_inheritance.png" alt="Inheritance diagram of AutoWrapStaticText" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.infobar.AutoWrapStaticText.html" title="wx.lib.agw.infobar.AutoWrapStaticText" alt="" coords="5,469,276,499"/> <area shape="rect" id="node2" href="wx.lib.stattext.GenStaticText.html" title="wx.lib.stattext.GenStaticText" alt="" coords="35,392,246,421"/> <area shape="rect" id="node3" href="wx.Control.html" title="wx.Control" alt="" coords="95,315,187,344"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window" alt="" coords="92,237,189,267"/> <area shape="rect" id="node5" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="76,160,205,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="82,83,199,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="wx.Object" alt="" coords="37,5,124,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="149,5,255,35"/> </map> 
   </p>
   </div>

|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.stattext.GenStaticText`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.infobar.AutoWrapStaticText.__init__`                          Defsult class constructor.
:meth:`~wx.lib.agw.infobar.AutoWrapStaticText.OnSize`                            Handles the ``wx.EVT_SIZE`` event for :class:`AutoWrapStaticText`.
:meth:`~wx.lib.agw.infobar.AutoWrapStaticText.SetLabel`                          Sets the :class:`AutoWrapStaticText` label.
:meth:`~wx.lib.agw.infobar.AutoWrapStaticText.Wrap`                              This functions wraps the controls label so that each of its lines becomes at
================================================================================ ================================================================================


|


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


.. class:: AutoWrapStaticText(StaticText)

   A simple class derived from :mod:`lib.stattext` that implements auto-wrapping
   behaviour depending on the parent size.
   
   .. versionadded:: 0.9.5

   .. method:: __init__(self, parent, label)

      Defsult class constructor.
      
      :param wx.Window parent: a subclass of :class:`wx.Window`, must not be ``None``;
      :param string `label`: the :class:`AutoWrapStaticText` text label.


   .. method:: OnSize(self, event)

      Handles the ``wx.EVT_SIZE`` event for :class:`AutoWrapStaticText`.
      
      :param `event`: a :class:`wx.SizeEvent` event to be processed.


   .. method:: SetLabel(self, label, wrapped=False)

      Sets the :class:`AutoWrapStaticText` label.
      
      All "&" characters in the label are special and indicate that the following character is
      a mnemonic for this control and can be used to activate it from the keyboard (typically
      by using ``Alt`` key in combination with it). To insert a literal ampersand character, you
      need to double it, i.e. use "&&". If this behaviour is undesirable, use :meth:`~Control.SetLabelText` instead.
      
      :param string `label`: the new :class:`AutoWrapStaticText` text label;
      :param bool `wrapped`: ``True`` if this method was called by the developer using :meth:`~AutoWrapStaticText.SetLabel`,
       ``False`` if it comes from the :meth:`~AutoWrapStaticText.OnSize` event handler.
      
      :note: Reimplemented from :class:`wx.Control`.


   .. method:: Wrap(self, width)

      This functions wraps the controls label so that each of its lines becomes at
      most `width` pixels wide if possible (the lines are broken at words boundaries
      so it might not be the case if words are too long).
      
      If `width` is negative, no wrapping is done.
      
      :param integer `width`: the maximum available width for the text, in pixels.
      
      :note: Note that this `width` is not necessarily the total width of the control,
       since a few pixels for the border (depending on the controls border style) may be added.


