.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.richtext.TextAttrDimensionConverter:

==========================================================================================================================================
|phoenix_title|  **wx.richtext.TextAttrDimensionConverter**
==========================================================================================================================================

A class to make it easier to convert dimensions.          







         



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







|

|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>TextAttrDimensionConverter</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.TextAttrDimensionConverter_inheritance.png" alt="Inheritance diagram of TextAttrDimensionConverter" 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.richtext.TextAttrDimensionConverter.html" title="wx.richtext.TextAttrDimensionConverter" alt="" coords="5,5,280,35"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.TextAttrDimensionConverter.__init__`                         Constructor.
:meth:`~wx.richtext.TextAttrDimensionConverter.ConvertPixelsToTenthsMM`          Converts pixels to tenths of a mm.
:meth:`~wx.richtext.TextAttrDimensionConverter.ConvertTenthsMMToPixels`          Converts tenths of a mm to pixels.
:meth:`~wx.richtext.TextAttrDimensionConverter.GetPixels`                        Gets the pixel size for the given dimension.
:meth:`~wx.richtext.TextAttrDimensionConverter.GetTenthsMM`                      Gets the mm size for the given dimension.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.richtext.TextAttrDimensionConverter.m_parentSize`                     A public C++ attribute of type :ref:`~wx.Size`.
:attr:`~wx.richtext.TextAttrDimensionConverter.m_ppi`                            A public C++ attribute of type ``int``.
:attr:`~wx.richtext.TextAttrDimensionConverter.m_scale`                          A public C++ attribute of type ``float``.
================================================================================ ================================================================================


|


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


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

   **Possible constructors**::

       TextAttrDimensionConverter(dc, scale=1.0, parentSize=DefaultSize)
       
       TextAttrDimensionConverter(ppi, scale=1.0, parentSize=DefaultSize)
       
   
   A class to make it easier to convert dimensions.



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

      Constructor.                   


      |overload| Overloaded Implementations:

      **~~~**

      
      **__init__** `(self, dc, scale=1.0, parentSize=DefaultSize)`
      
      
      
      
      :param `dc`: 
      :type `dc`: wx.DC
      :param `scale`: 
      :type `scale`: float
      :param `parentSize`: 
      :type `parentSize`: wx.Size
      
      
      
      
      
      
      **~~~**

      
      **__init__** `(self, ppi, scale=1.0, parentSize=DefaultSize)`
      
      
      
      
      :param `ppi`: 
      :type `ppi`: int
      :param `scale`: 
      :type `scale`: float
      :param `parentSize`: 
      :type `parentSize`: wx.Size
      
      
      
      
      
      
      **~~~**






   .. method:: ConvertPixelsToTenthsMM(self, pixels)

      Converts pixels to tenths of a mm.                  


      :param `pixels`: 
      :type `pixels`: int




      :rtype: `int`








   .. method:: ConvertTenthsMMToPixels(self, units)

      Converts tenths of a mm to pixels.                  


      :param `units`: 
      :type `units`: int




      :rtype: `int`








   .. method:: GetPixels(self, dim, direction=HORIZONTAL)

      Gets the pixel size for the given dimension.                  


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




      :rtype: `int`








   .. method:: GetTenthsMM(self, dim)

      Gets the mm size for the given dimension.                  


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




      :rtype: `int`








   .. attribute:: m_parentSize

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


   .. attribute:: m_ppi

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


   .. attribute:: m_scale

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

