.. 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.grid.GridFitMode:

==========================================================================================================================================
|phoenix_title|  **wx.grid.GridFitMode**
==========================================================================================================================================

Allows to specify the behaviour when the cell contents doesn't fit into its allotted space. 
         

Objects of this class are used with :meth:`wx.grid.GridCellAttr.SetFitMode`   and :meth:`wx.grid.Grid.SetDefaultCellFitMode`   and :meth:`wx.grid.Grid.SetCellFitMode`   functions and allow to specify what should happen if the cell contents doesn't fit into the available space. The possibilities are: 



- Overflow into the cell to the right if it is empty, or possibly several cells, if the cell contents still doesn't fit after overflowing into the immediately neighbouring cell. 
- Clip the cell contents, discarding the part which doesn't fit. 
- Ellipsize the cell contents, i.e. replace the non-fitting part with ellipsis ( 




The default behaviour is to overflow, use :meth:`wx.grid.Grid.SetDefaultCellFitMode`   to change this, for example: ::

    grid.SetDefaultCellFitMode(wx.grid.GridFitMode.Clip())



Objects of this class are created using static functions instead of constructors for better readability and can't be changed after creating them except by using the assignment operator. 








         



.. versionadded:: 4.1/wxWidgets-3.1.4  
     







|

|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>GridFitMode</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.grid.GridFitMode_inheritance.svg" alt="Inheritance diagram of GridFitMode" 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.grid.GridFitMode.html" title="Allows to specify the behaviour when the cell contents doesn't fit into its allotted space." alt="" coords="5,5,177,34"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.grid.GridFitMode.__init__`                                            Default constructor creates an object not specifying any behaviour.
:meth:`~wx.grid.GridFitMode.Clip`                                                Pseudo-constructor for object specifying clipping behaviour.
:meth:`~wx.grid.GridFitMode.Ellipsize`                                           Pseudo-constructor for object specifying ellipsize behaviour.
:meth:`~wx.grid.GridFitMode.GetEllipsizeMode`                                    Return ellipsize mode, possibly  ``ELLIPSIZE_NONE`` .
:meth:`~wx.grid.GridFitMode.IsClip`                                              Return ``True`` if the object specifies clipping behaviour.
:meth:`~wx.grid.GridFitMode.IsOverflow`                                          Return ``True`` if the object specifies overflow behaviour.
:meth:`~wx.grid.GridFitMode.IsSpecified`                                         Return ``True`` if the object specifies some particular behaviour.
:meth:`~wx.grid.GridFitMode.Overflow`                                            Pseudo-constructor for object specifying overflow behaviour.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.grid.GridFitMode.EllipsizeMode`                                       See :meth:`~wx.grid.GridFitMode.GetEllipsizeMode`
================================================================================ ================================================================================


|


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


.. class:: wx.grid.GridFitMode(object)

   **Possible constructors**::

       GridFitMode() -> None
       
   
   Allows to specify the behaviour when the cell contents doesn't fit
   into its allotted space.



   .. method:: __init__(self)

      Default constructor creates an object not specifying any behaviour. 
                 

      This constructor is not very useful, use static methods :meth:`Clip`   and :meth:`Overflow`   below to create objects of this class instead. 
                 

      :rtype: `None`     








   .. staticmethod:: Clip()

      Pseudo-constructor for object specifying clipping behaviour. 
                 

      :rtype: :ref:`wx.grid.GridFitMode`








   .. staticmethod:: Ellipsize(ellipsize=ELLIPSIZE_END)

      Pseudo-constructor for object specifying ellipsize behaviour. 
                 


      :param `ellipsize`: 
      :type `ellipsize`: wx.EllipsizeMode




      :rtype: :ref:`wx.grid.GridFitMode`








   .. method:: GetEllipsizeMode(self)

      Return ellipsize mode, possibly  ``ELLIPSIZE_NONE`` .  
                 

      For the objects constructed using :meth:`Ellipsize` , the same ellipsization mode as was passed to it is returned. For all the other objects, ``ELLIPSIZE_NONE``  is. 
                 

      :rtype: `EllipsizeMode`     








   .. method:: IsClip(self)

      Return ``True`` if the object specifies clipping behaviour. 
                 

      This method returns ``True`` only for the objects returned by :meth:`Clip` . 
                 

      :rtype: `bool`








   .. method:: IsOverflow(self)

      Return ``True`` if the object specifies overflow behaviour. 
                 

      This method returns ``True`` only for the objects returned by :meth:`Overflow` . 
                 

      :rtype: `bool`








   .. method:: IsSpecified(self)

      Return ``True`` if the object specifies some particular behaviour. 
                 

      This method returns ``False`` for default-constructed objects of this type only. 
                 

      :rtype: `bool`








   .. staticmethod:: Overflow()

      Pseudo-constructor for object specifying overflow behaviour. 
                 

      :rtype: :ref:`wx.grid.GridFitMode`








   .. attribute:: EllipsizeMode

      See :meth:`~wx.grid.GridFitMode.GetEllipsizeMode`

