wx.richtext.RichTextEvent¶This is the event class for wx.richtext.RichTextCtrl notifications.
^^
Events Emitted by this Class¶Handlers bound for the following event types will receive a wx.richtext.RichTextEvent parameter.
EVT_RICHTEXT_LEFT_CLICK: Process a wxEVT_RICHTEXT_LEFT_CLICK event, generated when the user releases the left mouse button over an object.
EVT_RICHTEXT_RIGHT_CLICK: Process a wxEVT_RICHTEXT_RIGHT_CLICK event, generated when the user releases the right mouse button over an object.
EVT_RICHTEXT_MIDDLE_CLICK: Process a wxEVT_RICHTEXT_MIDDLE_CLICK event, generated when the user releases the middle mouse button over an object.
EVT_RICHTEXT_LEFT_DCLICK: Process a wxEVT_RICHTEXT_LEFT_DCLICK event, generated when the user double-clicks an object.
EVT_RICHTEXT_RETURN: Process a wxEVT_RICHTEXT_RETURN event, generated when the user presses the return key. Valid event functions: GetFlags, GetPosition.
EVT_RICHTEXT_CHARACTER: Process a wxEVT_RICHTEXT_CHARACTER event, generated when the user presses a character key. Valid event functions: GetFlags, GetPosition, GetCharacter.
EVT_RICHTEXT_CONSUMING_CHARACTER: Process a wxEVT_RICHTEXT_CONSUMING_CHARACTER event, generated when the user presses a character key but before it is processed and inserted into the control. Call Veto to prevent normal processing. Valid event functions: GetFlags, GetPosition, GetCharacter, Veto.
EVT_RICHTEXT_DELETE: Process a wxEVT_RICHTEXT_DELETE event, generated when the user presses the backspace or delete key. Valid event functions: GetFlags, GetPosition.
EVT_RICHTEXT_RETURN: Process a wxEVT_RICHTEXT_RETURN event, generated when the user presses the return key. Valid event functions: GetFlags, GetPosition.
EVT_RICHTEXT_STYLE_CHANGED: Process a wxEVT_RICHTEXT_STYLE_CHANGED event, generated when styling has been applied to the control. Valid event functions: GetPosition, GetRange.
EVT_RICHTEXT_STYLESHEET_CHANGED: Process a wxEVT_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: Process a wxEVT_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: Process a wxEVT_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_PROPERTIES_CHANGED: Process a wxEVT_RICHTEXT_PROPERTIES_CHANGED event, generated when properties have been applied to the control. Valid event functions: GetPosition, GetRange.
EVT_RICHTEXT_CONTENT_INSERTED: Process a wxEVT_RICHTEXT_CONTENT_INSERTED event, generated when content has been inserted into the control. Valid event functions: GetPosition, GetRange.
EVT_RICHTEXT_CONTENT_DELETED: Process a wxEVT_RICHTEXT_CONTENT_DELETED event, generated when content has been deleted from the control. Valid event functions: GetPosition, GetRange.
EVT_RICHTEXT_BUFFER_RESET: Process a wxEVT_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.
EVT_RICHTEXT_SELECTION_CHANGED: Process a wxEVT_RICHTEXT_SELECTION_CHANGED event, generated when the selection range has changed.
EVT_RICHTEXT_FOCUS_OBJECT_CHANGED: Process a wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED event, generated when the current focus object has changed. ^^
Class Hierarchy¶
Inheritance diagram for class RichTextEvent:

Methods Summary¶Constructor. |
|
Returns a copy of the event. |
|
Returns the character pressed, within a |
|
Returns the container for which the event is relevant. |
|
Returns flags indicating modifier keys pressed. |
|
Returns the new style sheet. |
|
Returns the old container, for a focus change event. |
|
Returns the old style sheet. |
|
Returns the buffer position at which the event occurred. |
|
Gets the range for the current operation. |
|
Sets the character variable. |
|
Sets the container for which the event is relevant. |
|
Sets flags indicating modifier keys pressed. |
|
Sets the new style sheet variable. |
|
Sets the old container, for a focus change event. |
|
Sets the old style sheet variable. |
|
Sets the buffer position variable. |
|
Sets the range variable. |
Properties Summary¶See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
Class API¶wx.richtext.RichTextEvent(NotifyEvent)¶Possible constructors:
RichTextEvent(commandType=wxEVT_NULL, winid=0)
RichTextEvent(event)
This is the event class for RichTextCtrl notifications.
__init__(self, *args, **kw)¶__init__ (self, commandType=wxEVT_NULL, winid=0)
Constructor.
commandType (wx.EventType) – The type of the event.
winid (int) – Window identifier. The value ID_ANY indicates a default value.
__init__ (self, event)
Copy constructor.
event (wx.richtext.RichTextEvent) –
Clone(self)¶Returns a copy of the event.
Any event that is posted to the wxWidgets event system for later action (via wx.EvtHandler.AddPendingEvent , wx.EvtHandler.QueueEvent or wx.PostEvent ) must implement this method.
All wxWidgets events fully implement this method, but any derived events implemented by the user should also implement this method just in case they (or some event derived from them) are ever posted.
All wxWidgets events implement a copy constructor, so the easiest way of implementing the Clone function is to implement a copy constructor for a new event (call it MyEvent) and then define the Clone function like this:
def Clone(self):
return MyEvent()
Event
GetCharacter(self)¶Returns the character pressed, within a wxEVT_RICHTEXT_CHARACTER event.
wx.Char
GetContainer(self)¶Returns the container for which the event is relevant.
GetFlags(self)¶Returns flags indicating modifier keys pressed.
Possible values are RICHTEXT_CTRL_DOWN , RICHTEXT_SHIFT_DOWN , and RICHTEXT_ALT_DOWN .
int
GetNewStyleSheet(self)¶Returns the new style sheet.
Can be used in a wxEVT_RICHTEXT_STYLESHEET_CHANGING or wxEVT_RICHTEXT_STYLESHEET_CHANGED event handler.
GetOldContainer(self)¶Returns the old container, for a focus change event.
GetOldStyleSheet(self)¶Returns the old style sheet.
Can be used in a wxEVT_RICHTEXT_STYLESHEET_CHANGING or wxEVT_RICHTEXT_STYLESHEET_CHANGED event handler.
GetPosition(self)¶Returns the buffer position at which the event occurred.
long
GetRange(self)¶Gets the range for the current operation.
SetCharacter(self, ch)¶Sets the character variable.
ch (wx.Char) –
SetContainer(self, container)¶Sets the container for which the event is relevant.
container (wx.richtext.RichTextParagraphLayoutBox) –
SetFlags(self, flags)¶Sets flags indicating modifier keys pressed.
Possible values are RICHTEXT_CTRL_DOWN , RICHTEXT_SHIFT_DOWN , and RICHTEXT_ALT_DOWN .
flags (int) –
SetNewStyleSheet(self, sheet)¶Sets the new style sheet variable.
sheet (wx.richtext.RichTextStyleSheet) –
SetOldContainer(self, container)¶Sets the old container, for a focus change event.
container (wx.richtext.RichTextParagraphLayoutBox) –
SetOldStyleSheet(self, sheet)¶Sets the old style sheet variable.
sheet (wx.richtext.RichTextStyleSheet) –
SetPosition(self, pos)¶Sets the buffer position variable.
pos (long) –
SetRange(self, range)¶Sets the range variable.
range (wx.richtext.RichTextRange) –
Character¶See GetCharacter and SetCharacter
Container¶See GetContainer and SetContainer
NewStyleSheet¶See GetNewStyleSheet and SetNewStyleSheet
OldContainer¶See GetOldContainer and SetOldContainer
OldStyleSheet¶See GetOldStyleSheet and SetOldStyleSheet
Position¶See GetPosition and SetPosition