************************* wx.richtext.RichTextEvent ************************* Inheritance diagram for `wx.richtext.RichTextEvent`: | .. inheritance-diagram:: wx.richtext.RichTextEvent | Description =========== This is the event class for `wx.richtext.RichTextCtrl <../richtext/wx.richtext.RichTextCtrl.html>`_ notifications. Derived From ^^^^^^^^^^^^^ * `wx.NotifyEvent `_ Event Handling ^^^^^^^^^^^^^^ All events are members of `wx.richtext` subpackage, so the `wx.richtext` string in front of the ``EVT`` and ``wxEVT`` is omitted for brevity: ======================================================= ================================================== Event Name Description ======================================================= ================================================== EVT_RICHTEXT_CHARACTER(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_CHARACTER`` event, generated when the user presses a character key. Valid event functions: `GetFlags <#GetFlags>`_, `GetPosition <#GetPosition>`_, `GetCharacter <#GetCharacter>`_. EVT_RICHTEXT_DELETE(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_DELETE`` event, generated when the user presses the backspace or delete key. Valid event functions: `GetFlags <#GetFlags>`_, `GetPosition <#GetPosition>`_. EVT_RICHTEXT_RETURN(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_RETURN`` event, generated when the user presses the return key. Valid event functions: `GetFlags <#GetFlags>`_, `GetPosition <#GetPosition>`_. EVT_RICHTEXT_STYLE_CHANGED(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED`` event, generated when styling has been applied to the control. Valid event functions: `GetPosition <#GetPosition>`_, `GetRange <#GetRange>`_. EVT_RICHTEXT_STYLESHEET_CHANGED(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING`` event, generated when the control's stylesheet has changed, for example the user added, edited or deleted a style. Valid event functions: `GetRange <#GetRange>`_, `GetPosition <#GetPosition>`_. EVT_RICHTEXT_STYLESHEET_REPLACING(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING`` event, generated when the control's stylesheet is about to be replaced, for example when a file is loaded into the control. Valid event functions: `Veto `_, `GetOldStyleSheet <#GetOldStyleSheet>`_, `GetNewStyleSheet <#GetNewStyleSheet>`_. EVT_RICHTEXT_STYLESHEET_REPLACED(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED`` event, generated when the control's stylesheet has been replaced, for example when a file is loaded into the control. Valid event functions: `GetOldStyleSheet <#GetOldStyleSheet>`_, `GetNewStyleSheet <#GetNewStyleSheet>`_. EVT_RICHTEXT_CONTENT_INSERTED(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED`` event, generated when content has been inserted into the control. Valid event functions: `GetPosition <#GetPosition>`_, `GetRange <#GetRange>`_. EVT_RICHTEXT_CONTENT_DELETED(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED`` event, generated when content has been deleted from the control. Valid event functions: `GetPosition <#GetPosition>`_, `GetRange <#GetRange>`_. EVT_RICHTEXT_BUFFER_RESET(id, func) Process a ``wxEVT_COMMAND_RICHTEXT_BUFFER_RESET`` event, generated when the buffer has been reset by deleting all content. You can use this to set a default style for the first new paragraph. ======================================================= ================================================== Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetCharacter <#GetCharacter>`_ * `GetFlags <#GetFlags>`_ * `GetNewStyleSheet <#GetNewStyleSheet>`_ * `GetOldStyleSheet <#GetOldStyleSheet>`_ * `GetPosition <#GetPosition>`_ * `GetRange <#GetRange>`_ * `SetCharacter <#SetCharacter>`_ * `SetFlags <#SetFlags>`_ * `SetNewStyleSheet <#SetNewStyleSheet>`_ * `SetOldStyleSheet <#SetOldStyleSheet>`_ * `SetPosition <#SetPosition>`_ * `SetRange <#SetRange>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Character <#Character>`_ * `Flags <#Flags>`_ * `Index <#Index>`_ * `NewStyleSheet <#NewStyleSheet>`_ * `OldStyleSheet <#OldStyleSheet>`_ * `Range <#Range>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(commandType=wx.EVT_NULL, winid=0) Constructor. **Parameters:** * `commandType` (eventtype) * `winid` (int) | **Returns:** `wx.richtext.RichTextEvent `_ -------- .. method:: GetCharacter() Returns the character pressed, within a ``wxEVT_COMMAND_RICHTEXT_CHARACTER`` event. | **Returns:** `string` -------- .. method:: GetFlags() Returns flags indicating modifier keys pressed. Possible values are ``wx.richtext.RICHTEXT_CTRL_DOWN``, ``wx.richtext.RICHTEXT_SHIFT_DOWN``, and ``wx.richtext.RICHTEXT_ALT_DOWN``. | **Returns:** `int` -------- .. method:: GetNewStyleSheet() Returns the new style sheet. Can be used in a ``wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING`` or ``wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED`` event handler. | **Returns:** `wx.richtext.RichTextStyleSheet <../richtext/wx.richtext.RichTextStyleSheet.html>`_ -------- .. method:: GetOldStyleSheet() Returns the old style sheet. Can be used in a ``wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING`` or ``wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED`` event handler. | **Returns:** `wx.richtext.RichTextStyleSheet <../richtext/wx.richtext.RichTextStyleSheet.html>`_ -------- .. method:: GetPosition() Returns the buffer position at which the event occured. | **Returns:** `long` -------- .. method:: GetRange() Gets the range for the current operation. | **Returns:** `wx.richtext.RichTextRange <../richtext/wx.richtext.RichTextRange.html>`_ -------- .. method:: SetCharacter(ch) Sets the character variable. **Parameters:** * `ch` (string) -------- .. method:: SetFlags(flags) Sets flags indicating modifier keys pressed. Possible values are ``wx.richtext.RICHTEXT_CTRL_DOWN``, ``wx.richtext.RICHTEXT_SHIFT_DOWN``, and ``wx.richtext.RICHTEXT_ALT_DOWN``. **Parameters:** * `flags` (int) -------- .. method:: SetNewStyleSheet(sheet) Sets the new style sheet variable. **Parameters:** * `sheet` (`wx.richtext.RichTextStyleSheet <../richtext/wx.richtext.RichTextStyleSheet.html>`_) -------- .. method:: SetOldStyleSheet(sheet) Sets the old style sheet variable. **Parameters:** * `sheet` (`wx.richtext.RichTextStyleSheet <../richtext/wx.richtext.RichTextStyleSheet.html>`_) -------- .. method:: SetPosition(pos) Sets the buffer position variable. **Parameters:** * `pos` (long) -------- .. method:: SetRange(range) Sets the range variable. **Parameters:** * `range` (`wx.richtext.RichTextRange <../richtext/wx.richtext.RichTextRange.html>`_) -------- Properties ^^^^^^^^^^ .. attribute:: Character See `GetCharacter`_ and `SetCharacter`_ .. attribute:: Flags See `GetFlags`_ and `SetFlags`_ .. attribute:: Index See `GetPosition`_ and `SetPosition`_ .. attribute:: NewStyleSheet See `GetNewStyleSheet`_ and `SetNewStyleSheet`_ .. attribute:: OldStyleSheet See `GetOldStyleSheet`_ and `SetOldStyleSheet`_ .. attribute:: Range See `GetRange`_ and `SetRange`_