.. include:: headings.inc .. _ClipboardTextEvent: ========================================================================================================================================== |phoenix_title| **ClipboardTextEvent** ========================================================================================================================================== This class represents the events generated by a control (typically a :ref:`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_COMMAND_TEXT_COPY`` , ``wxEVT_COMMAND_TEXT_CUT`` and ``wxEVT_COMMAND_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 to prevent 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 -- for example, changing its case or removing invalid characters. Finally notice that a ``CUT`` event is always preceded by the ``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:`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:`TextCtrl` under GTK+. They are generated by all controls under Windows. .. seealso:: :ref:`Clipboard` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **ClipboardTextEvent** .. raw:: html

Inheritance diagram of ClipboardTextEvent

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~ClipboardTextEvent.__init__` Constructor. ================================================================================ ================================================================================ | |api| Class API =============== .. class:: ClipboardTextEvent(CommandEvent) 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. **Possible constructors**:: ClipboardTextEvent(commandType=wxEVT_NULL, id=0) .. method:: __init__(self, commandType=wxEVT_NULL, id=0) Constructor. :param `commandType`: :type `commandType`: EventType :param `id`: :type `id`: int