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_CLICKevent, generated when the user releases the left mouse button over an object.EVT_RICHTEXT_RIGHT_CLICK: Process a
wxEVT_RICHTEXT_RIGHT_CLICKevent, generated when the user releases the right mouse button over an object.EVT_RICHTEXT_MIDDLE_CLICK: Process a
wxEVT_RICHTEXT_MIDDLE_CLICKevent, generated when the user releases the middle mouse button over an object.EVT_RICHTEXT_LEFT_DCLICK: Process a
wxEVT_RICHTEXT_LEFT_DCLICKevent, generated when the user double-clicks an object.EVT_RICHTEXT_RETURN: Process a
wxEVT_RICHTEXT_RETURNevent, generated when the user presses the return key. Valid event functions: GetFlags, GetPosition.EVT_RICHTEXT_CHARACTER: Process a
wxEVT_RICHTEXT_CHARACTERevent, generated when the user presses a character key. Valid event functions: GetFlags, GetPosition, GetCharacter.EVT_RICHTEXT_CONSUMING_CHARACTER: Process a
wxEVT_RICHTEXT_CONSUMING_CHARACTERevent, 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_DELETEevent, generated when the user presses the backspace or delete key. Valid event functions: GetFlags, GetPosition.EVT_RICHTEXT_RETURN: Process a
wxEVT_RICHTEXT_RETURNevent, generated when the user presses the return key. Valid event functions: GetFlags, GetPosition.EVT_RICHTEXT_STYLE_CHANGED: Process a
wxEVT_RICHTEXT_STYLE_CHANGEDevent, generated when styling has been applied to the control. Valid event functions: GetPosition, GetRange.EVT_RICHTEXT_STYLESHEET_CHANGED: Process a
wxEVT_RICHTEXT_STYLESHEET_CHANGINGevent, 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_REPLACINGevent, 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_REPLACEDevent, 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_CHANGEDevent, generated when properties have been applied to the control. Valid event functions: GetPosition, GetRange.EVT_RICHTEXT_CONTENT_INSERTED: Process a
wxEVT_RICHTEXT_CONTENT_INSERTEDevent, generated when content has been inserted into the control. Valid event functions: GetPosition, GetRange.EVT_RICHTEXT_CONTENT_DELETED: Process a
wxEVT_RICHTEXT_CONTENT_DELETEDevent, generated when content has been deleted from the control. Valid event functions: GetPosition, GetRange.EVT_RICHTEXT_BUFFER_RESET: Process a
wxEVT_RICHTEXT_BUFFER_RESETevent, 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_CHANGEDevent, generated when the selection range has changed.EVT_RICHTEXT_FOCUS_OBJECT_CHANGED: Process a
wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGEDevent, generated when the current focus object has changed.
Class Hierarchy¶
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¶
- class wx.richtext.RichTextEvent(NotifyEvent)¶
Possible constructors:
RichTextEvent(commandType=wxEVT_NULL, winid=0) -> None RichTextEvent(event) -> None
This is the event class for RichTextCtrl notifications.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, commandType=wxEVT_NULL, winid=0)
Constructor.
- Parameters:
commandType (wx.EventType) – The type of the event.
winid (int) – Window identifier. The value
ID_ANYindicates a default value.
- Return type:
None
__init__ (self, event)
Copy constructor.
- Parameters:
event (wx.richtext.RichTextEvent)
- Return type:
None
- 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.QueueEventorwx.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()
- Return type:
Event
- GetCharacter(self)¶
Returns the character pressed, within a
wxEVT_RICHTEXT_CHARACTERevent.- Return type:
str
- GetContainer(self)¶
Returns the container for which the event is relevant.
- Return type:
- GetFlags(self)¶
Returns flags indicating modifier keys pressed.
Possible values are
RICHTEXT_CTRL_DOWN,RICHTEXT_SHIFT_DOWN, andRICHTEXT_ALT_DOWN.- Return type:
int
- GetNewStyleSheet(self)¶
Returns the new style sheet.
Can be used in a
wxEVT_RICHTEXT_STYLESHEET_CHANGINGorwxEVT_RICHTEXT_STYLESHEET_CHANGEDevent handler.- Return type:
- GetOldContainer(self)¶
Returns the old container, for a focus change event.
- Return type:
- GetOldStyleSheet(self)¶
Returns the old style sheet.
Can be used in a
wxEVT_RICHTEXT_STYLESHEET_CHANGINGorwxEVT_RICHTEXT_STYLESHEET_CHANGEDevent handler.- Return type:
- GetPosition(self)¶
Returns the buffer position at which the event occurred.
- Return type:
int
- GetRange(self)¶
Gets the range for the current operation.
- Return type:
- SetCharacter(self, ch)¶
Sets the character variable.
- Parameters:
ch (wx.Char)
- Return type:
None
- SetContainer(self, container)¶
Sets the container for which the event is relevant.
- Parameters:
container (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
- SetFlags(self, flags)¶
Sets flags indicating modifier keys pressed.
Possible values are
RICHTEXT_CTRL_DOWN,RICHTEXT_SHIFT_DOWN, andRICHTEXT_ALT_DOWN.- Parameters:
flags (int)
- Return type:
None
- SetNewStyleSheet(self, sheet)¶
Sets the new style sheet variable.
- Parameters:
sheet (wx.richtext.RichTextStyleSheet)
- Return type:
None
- SetOldContainer(self, container)¶
Sets the old container, for a focus change event.
- Parameters:
container (wx.richtext.RichTextParagraphLayoutBox)
- Return type:
None
- SetOldStyleSheet(self, sheet)¶
Sets the old style sheet variable.
- Parameters:
sheet (wx.richtext.RichTextStyleSheet)
- Return type:
None
- SetPosition(self, pos)¶
Sets the buffer position variable.
- Parameters:
pos (long)
- Return type:
None
- SetRange(self, range)¶
Sets the range variable.
- Parameters:
range (wx.richtext.RichTextRange)
- Return type:
None
Properties¶
- Character¶
See
GetCharacterandSetCharacter
- Container¶
See
GetContainerandSetContainer
- NewStyleSheet¶
See
GetNewStyleSheetandSetNewStyleSheet
- OldContainer¶
See
GetOldContainerandSetOldContainer
- OldStyleSheet¶
See
GetOldStyleSheetandSetOldStyleSheet
- Position¶
See
GetPositionandSetPosition
