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

Inheritance diagram for class
AutoWrapStaticText:
|
|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.