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



.. _wx.ClipboardTextEvent:

==========================================================================================================================================
|phoenix_title|  **wx.ClipboardTextEvent**
==========================================================================================================================================

This class represents the events generated by a control (typically a :ref:`wx.TextCtrl`  but other windows can generate these events as well) when its content gets copied or cut to, or pasted from the clipboard.          

There are three types of corresponding events  ``wxEVT_TEXT_COPY`` ,   ``wxEVT_TEXT_CUT``   and   ``wxEVT_TEXT_PASTE`` . 

If any of these events is processed (without being skipped) by an event handler, the corresponding operation doesn't take place which allows preventing the text from being copied from or pasted to a control. It is also possible to examine the clipboard contents in the ``PASTE`` event handler and transform it in some way before inserting in a control  

Finally notice that a ``CUT`` event is always preceded by the ``wx.COPY`` event which makes it possible to only process the latter if it doesn't matter if the text was copied or cut. 







.. _ClipboardTextEvent-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive a :ref:`wx.ClipboardTextEvent` parameter.

 

- EVT_TEXT_COPY: Some or all of the controls content was copied to the clipboard.  
- EVT_TEXT_CUT: Some or all of the controls content was cut (i.e. copied and deleted).  
- EVT_TEXT_PASTE: Clipboard content was pasted into the control.  








         



.. note:: 

   These events are currently only generated by :ref:`wx.TextCtrl`  in wxGTK and wxOSX but are also generated by :ref:`wx.ComboBox`  without ``wx.CB_READONLY`` style in wxMSW.  







.. seealso:: :ref:`wx.Clipboard`    







|

|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>ClipboardTextEvent</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.ClipboardTextEvent_inheritance.png" alt="Inheritance diagram of ClipboardTextEvent" 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.ClipboardTextEvent.html" title="This class represents the events generated by a control (typically a wx.TextCtrl  but other windows can generate these events as well) when its content gets copied or cut to, or pasted from the clipboard." alt="" coords="5,237,181,267"/> <area shape="rect" id="node2" href="wx.CommandEvent.html" title="This event class contains information about command events, which originate from a variety of simple controls." alt="" coords="17,160,169,189"/> <area shape="rect" id="node3" href="wx.Event.html" title="An event is a structure holding information about an event passed to a callback or member function." alt="" coords="52,83,135,112"/> <area shape="rect" id="node4" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="49,5,137,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.ClipboardTextEvent.__init__`                                          Constructor.
================================================================================ ================================================================================


|


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


.. class:: wx.ClipboardTextEvent(CommandEvent)

   **Possible constructors**::

       ClipboardTextEvent(commandType=wxEVT_NULL, id=0)
       
   
   This class represents the events generated by a control (typically a
   TextCtrl but other windows can generate these events as well) when
   its content gets copied or cut to, or pasted from the clipboard.



   .. method:: __init__(self, commandType=wxEVT_NULL, id=0)

      Constructor.                  


      :param `commandType`: 
      :type `commandType`: wx.EventType
      :param `id`: 
      :type `id`: int