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
|
.. 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.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>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.stattext.GenStaticText.html" title="wx.lib.stattext.GenStaticText" alt="" coords="32,392,235,421"/> <area shape="rect" id="node7" href="wx.lib.agw.infobar.AutoWrapStaticText.html" title="wx.lib.agw.infobar.AutoWrapStaticText" alt="" coords="4,469,261,499"/> <area shape="rect" id="node2" href="wx.Control.html" title="wx.Control" alt="" coords="89,315,177,344"/> <area shape="rect" id="node3" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="25,5,127,35"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="77,83,188,112"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="73,160,193,189"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="151,5,232,35"/> <area shape="rect" id="node8" href="wx.Window.html" title="wx.Window" alt="" coords="89,237,177,267"/> </map>
</p>
|
|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.
|