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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
|
.. 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.expando
.. highlight:: python
.. _wx.lib.expando.ExpandoTextCtrl:
==========================================================================================================================================
|phoenix_title| **wx.lib.expando.ExpandoTextCtrl**
==========================================================================================================================================
The ExpandoTextCtrl is a multi-line wx.TextCtrl that will
adjust its height on the fly as needed to accomodate the number of
lines needed to display the current content of the control. It is
assumed that the width of the control will be a fixed value and
that only the height will be adjusted automatically. If the
control is used in a sizer then the width should be set as part of
the initial or min size of the control.
When the control resizes itself it will attempt to also make
necessary adjustments in the sizer hierarchy it is a member of (if
any) but if that is not suffiecient then the programmer can catch
the EVT_ETC_LAYOUT_NEEDED event in the container and make any
other layout adjustments that may be needed.
|
|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>ExpandoTextCtrl</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.expando.ExpandoTextCtrl_inheritance.png" alt="Inheritance diagram of ExpandoTextCtrl" 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.TextCtrl.html" title="wx.TextCtrl" alt="" coords="127,392,216,421"/> <area shape="rect" id="node9" href="wx.lib.expando.ExpandoTextCtrl.html" title="wx.lib.expando.ExpandoTextCtrl" alt="" coords="61,469,283,499"/> <area shape="rect" id="node2" href="wx.Control.html" title="wx.Control" alt="" coords="69,315,157,344"/> <area shape="rect" id="node3" href="wx.TextEntry.html" title="wx.TextEntry" alt="" coords="182,315,281,344"/> <area shape="rect" id="node4" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="5,5,107,35"/> <area shape="rect" id="node5" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="57,83,168,112"/> <area shape="rect" id="node7" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="53,160,173,189"/> <area shape="rect" id="node6" href="wx.Object.html" title="wx.Object" alt="" coords="131,5,212,35"/> <area shape="rect" id="node8" href="wx.Window.html" title="wx.Window" alt="" coords="69,237,157,267"/> </map>
</p>
|
|sub_classes| Known Subclasses
==============================
:class:`wx.lib.agw.aui.auibook.TabTextCtrl`, :class:`wx.lib.agw.customtreectrl.TreeTextCtrl`, :class:`wx.lib.agw.ultimatelistctrl.UltimateListTextCtrl`
|
|super_classes| Known Superclasses
==================================
:class:`wx.TextCtrl`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.expando.ExpandoTextCtrl.__init__` Default class constructor.
:meth:`~wx.lib.expando.ExpandoTextCtrl.AppendText` Appends the text to the end of the text control.
:meth:`~wx.lib.expando.ExpandoTextCtrl.GetMaxHeight` Returns the maximum height that the control will expand to on its own.
:meth:`~wx.lib.expando.ExpandoTextCtrl.GetNumberOfLines`
:meth:`~wx.lib.expando.ExpandoTextCtrl.OnSize` Handles the ``wx.EVT_SIZE`` event for :class:`ExpandoTextCtrl`.
:meth:`~wx.lib.expando.ExpandoTextCtrl.OnTextChanged` Handles the ``wx.EVT_TEXT`` event for :class:`ExpandoTextCtrl`.
:meth:`~wx.lib.expando.ExpandoTextCtrl.SetFont` Sets the font for the :class:`ExpandoTextCtrl`.
:meth:`~wx.lib.expando.ExpandoTextCtrl.SetMaxHeight` Sets the maximum height that the control will expand to on its
:meth:`~wx.lib.expando.ExpandoTextCtrl.WriteText` Writes the text into the text control at the current insertion position.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: ExpandoTextCtrl(wx.TextCtrl)
The ExpandoTextCtrl is a multi-line wx.TextCtrl that will
adjust its height on the fly as needed to accomodate the number of
lines needed to display the current content of the control. It is
assumed that the width of the control will be a fixed value and
that only the height will be adjusted automatically. If the
control is used in a sizer then the width should be set as part of
the initial or min size of the control.
When the control resizes itself it will attempt to also make
necessary adjustments in the sizer hierarchy it is a member of (if
any) but if that is not suffiecient then the programmer can catch
the EVT_ETC_LAYOUT_NEEDED event in the container and make any
other layout adjustments that may be needed.
.. method:: __init__(self, parent, id=-1, value="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, validator=wx.DefaultValidator, name="expando")
Default class constructor.
:param `parent`: parent window, must not be ``None``;
:param integer `id`: window identifier. A value of -1 indicates a default value;
:param string `value`: the control text label;
:param `pos`: the control position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxPython, depending on platform;
:param `size`: the control size. A value of (-1, -1) indicates a default size,
chosen by either the windowing system or wxPython, depending on platform;
:param integer `style`: the underlying :class:`wx.Control` style;
:param wx.Validator `validator`: the window validator;
:param string `name`: the widget name.
:type parent: :class:`wx.Window`
:type pos: tuple or :class:`wx.Point`
:type size: tuple or :class:`wx.Size`
.. method:: AppendText(self, text)
Appends the text to the end of the text control.
:param string `text`: text to write to the text control.
.. seealso:: :meth:`WriteText`
.. method:: GetMaxHeight(self)
Returns the maximum height that the control will expand to on its own.
:rtype: int
.. method:: GetNumberOfLines(self)
.. method:: OnSize(self, evt)
Handles the ``wx.EVT_SIZE`` event for :class:`ExpandoTextCtrl`.
:param `event`: a :class:`wx.SizeEvent` event to be processed.
.. method:: OnTextChanged(self, evt)
Handles the ``wx.EVT_TEXT`` event for :class:`ExpandoTextCtrl`.
:param `event`: a :class:`CommandEvent` event to be processed.
.. method:: SetFont(self, font)
Sets the font for the :class:`ExpandoTextCtrl`.
:param wx.Font font: font to associate with the :class:`ExpandoTextCtrl`, pass
``NullFont`` to reset to the default font.
:rtype: bool
:returns: ``True`` if the font was really changed, ``False`` if it was already
set to this font and nothing was done.
.. method:: SetMaxHeight(self, h)
Sets the maximum height that the control will expand to on its
own, and adjusts it down if needed.
:param integer `h`: the maximum control height, in pixels.
.. method:: WriteText(self, text)
Writes the text into the text control at the current insertion position.
:param string `text`: text to write to the text control.
.. note::
Newlines in the text string are the only control characters allowed, and they
will cause appropriate line breaks. See :meth:`AppendText` for more convenient
ways of writing to the window. After the write operation, the insertion point
will be at the end of the inserted text, so subsequent write operations will
be appended. To append text after the user may have interacted with the control,
call :meth:`TextCtrl.SetInsertionPointEnd` before writing.
|