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



.. _wx.richtext.TextAttrDimension:

==========================================================================================================================================
|phoenix_title|  **wx.richtext.TextAttrDimension**
==========================================================================================================================================

A class representing a rich text dimension, including units and position.          







         



.. seealso:: :ref:`wx.richtext.RichTextAttr`, :ref:`wx.richtext.RichTextCtrl`, :ref:`wx.richtext.TextAttrDimensions`    







|

|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>TextAttrDimension</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.richtext.TextAttrDimension_inheritance.png" alt="Inheritance diagram of TextAttrDimension" 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.richtext.TextAttrDimension.html" title="wx.richtext.TextAttrDimension" alt="" coords="5,5,225,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.TextAttrDimension.__init__`                                  Default constructor.
:meth:`~wx.richtext.TextAttrDimension.Apply`                                     Apply the dimension, but not those identical to `compareWith`  if present.
:meth:`~wx.richtext.TextAttrDimension.CollectCommonAttributes`                   Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects.
:meth:`~wx.richtext.TextAttrDimension.EqPartial`                                 Partial equality test.
:meth:`~wx.richtext.TextAttrDimension.GetFlags`                                  Gets the dimension flags.
:meth:`~wx.richtext.TextAttrDimension.GetPosition`                               Gets the position flags.
:meth:`~wx.richtext.TextAttrDimension.GetUnits`                                  Gets the units of the dimension.
:meth:`~wx.richtext.TextAttrDimension.GetValue`                                  Returns the integer value of the dimension.
:meth:`~wx.richtext.TextAttrDimension.GetValueMM`                                Returns the floating-pointing value of the dimension in mm.
:meth:`~wx.richtext.TextAttrDimension.IsValid`                                   Returns ``True`` if the dimension is valid.
:meth:`~wx.richtext.TextAttrDimension.Reset`                                     Resets the dimension value and flags.
:meth:`~wx.richtext.TextAttrDimension.SetFlags`                                  Sets the dimension flags.
:meth:`~wx.richtext.TextAttrDimension.SetPosition`                               Sets the position flags.
:meth:`~wx.richtext.TextAttrDimension.SetUnits`                                  Sets the units of the dimension.
:meth:`~wx.richtext.TextAttrDimension.SetValid`                                  Sets the valid flag.
:meth:`~wx.richtext.TextAttrDimension.SetValue`                                  Sets the integer value of the dimension.
:meth:`~wx.richtext.TextAttrDimension.SetValueMM`                                Sets the value of the dimension in mm.
:meth:`~wx.richtext.TextAttrDimension.__bool__`                                  
:meth:`~wx.richtext.TextAttrDimension.__nonzero__`                               
:meth:`~wx.richtext.TextAttrDimension.__eq__`                                    Equality operator.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.richtext.TextAttrDimension.Flags`                                     See :meth:`~wx.richtext.TextAttrDimension.GetFlags` and :meth:`~wx.richtext.TextAttrDimension.SetFlags`
:attr:`~wx.richtext.TextAttrDimension.Position`                                  See :meth:`~wx.richtext.TextAttrDimension.GetPosition` and :meth:`~wx.richtext.TextAttrDimension.SetPosition`
:attr:`~wx.richtext.TextAttrDimension.Units`                                     See :meth:`~wx.richtext.TextAttrDimension.GetUnits` and :meth:`~wx.richtext.TextAttrDimension.SetUnits`
:attr:`~wx.richtext.TextAttrDimension.Value`                                     See :meth:`~wx.richtext.TextAttrDimension.GetValue` and :meth:`~wx.richtext.TextAttrDimension.SetValue`
:attr:`~wx.richtext.TextAttrDimension.ValueMM`                                   See :meth:`~wx.richtext.TextAttrDimension.GetValueMM` and :meth:`~wx.richtext.TextAttrDimension.SetValueMM`
:attr:`~wx.richtext.TextAttrDimension.m_flags`                                   A public C++ attribute of type :ref:`~wx.richtext.TextAttrDimensionFlags`.
:attr:`~wx.richtext.TextAttrDimension.m_value`                                   A public C++ attribute of type ``int``.
================================================================================ ================================================================================


|


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


.. class:: wx.richtext.TextAttrDimension(object)

   **Possible constructors**::

       TextAttrDimension()
       
       TextAttrDimension(value, units=TEXT_ATTR_UNITS_TENTHS_MM)
       
   
   A class representing a rich text dimension, including units and
   position.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, value, units=TEXT_ATTR_UNITS_TENTHS_MM)`
      
      Constructor taking value and units flag.                  
      
      
      :param `value`: 
      :type `value`: int
      :param `units`: 
      :type `units`: wx.richtext.TextAttrUnits
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Apply(self, dim, compareWith=None)

      Apply the dimension, but not those identical to `compareWith`  if present.                  


      :param `dim`: 
      :type `dim`: wx.richtext.TextAttrDimension
      :param `compareWith`: 
      :type `compareWith`: wx.richtext.TextAttrDimension




      :rtype: `bool`








   .. method:: CollectCommonAttributes(self, attr, clashingAttr, absentAttr)

      Collects the attributes that are common to a range of content, building up a note of which attributes are absent in some objects and which clash in some objects.                  


      :param `attr`: 
      :type `attr`: wx.richtext.TextAttrDimension
      :param `clashingAttr`: 
      :type `clashingAttr`: wx.richtext.TextAttrDimension
      :param `absentAttr`: 
      :type `absentAttr`: wx.richtext.TextAttrDimension







   .. method:: EqPartial(self, dim, weakTest=True)

      Partial equality test.                  

      If `weakTest`  is ``True``, attributes of this object do not have to be present if those attributes of `dim`  are present. If `weakTest`  is ``False``, the function will fail if an attribute is present in `dim`  but not in this object.                  


      :param `dim`: 
      :type `dim`: wx.richtext.TextAttrDimension
      :param `weakTest`: 
      :type `weakTest`: bool




      :rtype: `bool`








   .. method:: GetFlags(self)

      Gets the dimension flags.                  

      :rtype: :ref:`wx.richtext.TextAttrDimensionFlags`








   .. method:: GetPosition(self)

      Gets the position flags.                  

      :rtype: :ref:`wx.richtext.TextBoxAttrPosition`








   .. method:: GetUnits(self)

      Gets the units of the dimension.                  

      :rtype: :ref:`wx.richtext.TextAttrUnits`








   .. method:: GetValue(self)

      Returns the integer value of the dimension.                  

      :rtype: `int`








   .. method:: GetValueMM(self)

      Returns the floating-pointing value of the dimension in mm.                  

      :rtype: `float`








   .. method:: IsValid(self)

      Returns ``True`` if the dimension is valid.                  

      :rtype: `bool`








   .. method:: Reset(self)

      Resets the dimension value and flags.                   





   .. method:: SetFlags(self, flags)

      Sets the dimension flags.                  


      :param `flags`: 
      :type `flags`: wx.richtext.TextAttrDimensionFlags







   .. method:: SetPosition(self, pos)

      Sets the position flags.                  


      :param `pos`: 
      :type `pos`: wx.richtext.TextBoxAttrPosition







   .. method:: SetUnits(self, units)

      Sets the units of the dimension.                  


      :param `units`: 
      :type `units`: wx.richtext.TextAttrUnits







   .. method:: SetValid(self, b)

      Sets the valid flag.                  


      :param `b`: 
      :type `b`: bool







   .. method:: SetValue(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **SetValue** `(self, value)`
      
      Sets the integer value of the dimension.                  
      
      
      :param `value`: 
      :type `value`: int
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **SetValue** `(self, value, flags)`
      
      Sets the integer value of the dimension, passing dimension flags.                  
      
      
      :param `value`: 
      :type `value`: int
      :param `flags`: 
      :type `flags`: wx.richtext.TextAttrDimensionFlags
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **SetValue** `(self, dim)`
      
      Sets the dimension.                  
      
      
      :param `dim`: 
      :type `dim`: wx.richtext.TextAttrDimension
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: SetValueMM(self, value)

      Sets the value of the dimension in mm.                  


      :param `value`: 
      :type `value`: float







   .. method:: __bool__(self)



      :rtype: `int`








   .. method:: __nonzero__(self)



      :rtype: `int`








   .. method:: __eq__(self)

      Equality operator.                  


      :param `dim`: 
      :type `dim`: wx.richtext.TextAttrDimension







   .. attribute:: Flags

      See :meth:`~wx.richtext.TextAttrDimension.GetFlags` and :meth:`~wx.richtext.TextAttrDimension.SetFlags`


   .. attribute:: Position

      See :meth:`~wx.richtext.TextAttrDimension.GetPosition` and :meth:`~wx.richtext.TextAttrDimension.SetPosition`


   .. attribute:: Units

      See :meth:`~wx.richtext.TextAttrDimension.GetUnits` and :meth:`~wx.richtext.TextAttrDimension.SetUnits`


   .. attribute:: Value

      See :meth:`~wx.richtext.TextAttrDimension.GetValue` and :meth:`~wx.richtext.TextAttrDimension.SetValue`


   .. attribute:: ValueMM

      See :meth:`~wx.richtext.TextAttrDimension.GetValueMM` and :meth:`~wx.richtext.TextAttrDimension.SetValueMM`


   .. attribute:: m_flags

      A public C++ attribute of type :ref:`~wx.richtext.TextAttrDimensionFlags`.


   .. attribute:: m_value

      A public C++ attribute of type ``int``.

