wx.richtext.RichTextEvent

Inheritance diagram for wx.richtext.RichTextEvent:



Description

This is the event class for wx.richtext.RichTextCtrl notifications.

Derived From

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

Class API

Methods

__init__(commandType=wx.EVT_NULL, winid=0)

Constructor.

Parameters:

  • commandType (eventtype)
  • winid (int)

Returns:

wx.richtext.RichTextEvent


GetCharacter()

Returns the character pressed, within a wxEVT_COMMAND_RICHTEXT_CHARACTER event.


Returns:

string


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


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


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


GetPosition()

Returns the buffer position at which the event occured.


Returns:

long


GetRange()

Gets the range for the current operation.


Returns:

wx.richtext.RichTextRange


SetCharacter(ch)

Sets the character variable.

Parameters:

  • ch (string)

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)

SetNewStyleSheet(sheet)

Sets the new style sheet variable.

Parameters:


SetOldStyleSheet(sheet)

Sets the old style sheet variable.

Parameters:


SetPosition(pos)

Sets the buffer position variable.

Parameters:

  • pos (long)

SetRange(range)

Sets the range variable.

Parameters:


Properties

Character
See GetCharacter and SetCharacter
Flags
See GetFlags and SetFlags
Index
See GetPosition and SetPosition
NewStyleSheet
See GetNewStyleSheet and SetNewStyleSheet
OldStyleSheet
See GetOldStyleSheet and SetOldStyleSheet
Range
See GetRange and SetRange