File: wx.richtext.RichTextEvent.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (494 lines) | stat: -rw-r--r-- 16,873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.richtext.RichTextEvent:

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextEvent**
==========================================================================================================================================

This is the event class for :ref:`wx.richtext.RichTextCtrl`  notifications.          







.. _RichTextEvent-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive a :ref:`wx.richtext.RichTextEvent` parameter.

Event macros: 

- 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| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>RichTextEvent</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.richtext.RichTextEvent_inheritance.png" alt="Inheritance diagram of RichTextEvent" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Event.html" title="wx.Event" alt="" coords="57,83,135,112"/> <area shape="rect" id="node3" href="wx.CommandEvent.html" title="wx.CommandEvent" alt="" coords="23,160,168,189"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="55,5,136,35"/> <area shape="rect" id="node5" href="wx.NotifyEvent.html" title="wx.NotifyEvent" alt="" coords="39,237,153,267"/> <area shape="rect" id="node4" href="wx.richtext.RichTextEvent.html" title="wx.richtext.RichTextEvent" alt="" coords="5,315,187,344"/> </map> 
   </p>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextEvent.__init__`                                      Constructor.
:meth:`~wx.richtext.RichTextEvent.Clone`                                         Returns a copy of the event.
:meth:`~wx.richtext.RichTextEvent.GetCharacter`                                  Returns the character pressed, within a  ``wxEVT_RICHTEXT_CHARACTER``   event.
:meth:`~wx.richtext.RichTextEvent.GetContainer`                                  Returns the container for which the event is relevant.
:meth:`~wx.richtext.RichTextEvent.GetFlags`                                      Returns flags indicating modifier keys pressed.
:meth:`~wx.richtext.RichTextEvent.GetNewStyleSheet`                              Returns the new style sheet.
:meth:`~wx.richtext.RichTextEvent.GetOldContainer`                               Returns the old container, for a focus change event.
:meth:`~wx.richtext.RichTextEvent.GetOldStyleSheet`                              Returns the old style sheet.
:meth:`~wx.richtext.RichTextEvent.GetPosition`                                   Returns the buffer position at which the event occurred.
:meth:`~wx.richtext.RichTextEvent.GetRange`                                      Gets the range for the current operation.
:meth:`~wx.richtext.RichTextEvent.SetCharacter`                                  Sets the character variable.
:meth:`~wx.richtext.RichTextEvent.SetContainer`                                  Sets the container for which the event is relevant.
:meth:`~wx.richtext.RichTextEvent.SetFlags`                                      Sets flags indicating modifier keys pressed.
:meth:`~wx.richtext.RichTextEvent.SetNewStyleSheet`                              Sets the new style sheet variable.
:meth:`~wx.richtext.RichTextEvent.SetOldContainer`                               Sets the old container, for a focus change event.
:meth:`~wx.richtext.RichTextEvent.SetOldStyleSheet`                              Sets the old style sheet variable.
:meth:`~wx.richtext.RichTextEvent.SetPosition`                                   Sets the buffer position variable.
:meth:`~wx.richtext.RichTextEvent.SetRange`                                      Sets the range variable.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextEvent.Character`                                     See :meth:`~wx.richtext.RichTextEvent.GetCharacter` and :meth:`~wx.richtext.RichTextEvent.SetCharacter`
:attr:`~wx.richtext.RichTextEvent.Container`                                     See :meth:`~wx.richtext.RichTextEvent.GetContainer` and :meth:`~wx.richtext.RichTextEvent.SetContainer`
:attr:`~wx.richtext.RichTextEvent.Flags`                                         See :meth:`~wx.richtext.RichTextEvent.GetFlags` and :meth:`~wx.richtext.RichTextEvent.SetFlags`
:attr:`~wx.richtext.RichTextEvent.NewStyleSheet`                                 See :meth:`~wx.richtext.RichTextEvent.GetNewStyleSheet` and :meth:`~wx.richtext.RichTextEvent.SetNewStyleSheet`
:attr:`~wx.richtext.RichTextEvent.OldContainer`                                  See :meth:`~wx.richtext.RichTextEvent.GetOldContainer` and :meth:`~wx.richtext.RichTextEvent.SetOldContainer`
:attr:`~wx.richtext.RichTextEvent.OldStyleSheet`                                 See :meth:`~wx.richtext.RichTextEvent.GetOldStyleSheet` and :meth:`~wx.richtext.RichTextEvent.SetOldStyleSheet`
:attr:`~wx.richtext.RichTextEvent.Position`                                      See :meth:`~wx.richtext.RichTextEvent.GetPosition` and :meth:`~wx.richtext.RichTextEvent.SetPosition`
:attr:`~wx.richtext.RichTextEvent.Range`                                         See :meth:`~wx.richtext.RichTextEvent.GetRange` and :meth:`~wx.richtext.RichTextEvent.SetRange`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.richtext.RichTextEvent(NotifyEvent)

   **Possible constructors**::

       RichTextEvent(commandType=wxEVT_NULL, winid=0)
       
       RichTextEvent(event)
       
   
   This is the event class for RichTextCtrl notifications.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **__init__** `(self, commandType=wxEVT_NULL, winid=0)`
      
      Constructor.                  
      
      
      
      
      :param `commandType`: The type of the event.   
      :type `commandType`: wx.EventType
      :param `winid`: Window identifier. The value  ``ID_ANY``   indicates a default value.    
      :type `winid`: int
      
      
      
      
      
      
                        
      
      
      
      
      **~~~**

      
      **__init__** `(self, event)`
      
      Copy constructor.                  
      
      
      :param `event`: 
      :type `event`: wx.richtext.RichTextEvent
      
      
      
      
      
      
      **~~~**






   .. method:: Clone(self)

      Returns a copy of the event.                  

      Any event that is posted to the wxWidgets event system for later action (via :meth:`wx.EvtHandler.AddPendingEvent` , :meth:`wx.EvtHandler.QueueEvent`   or :ref:`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()

                 

      :rtype: :ref:`Event`








   .. method:: GetCharacter(self)

      Returns the character pressed, within a  ``wxEVT_RICHTEXT_CHARACTER``   event.                   

      :rtype: :ref:`wx.Char`








   .. method:: GetContainer(self)

      Returns the container for which the event is relevant.                  

      :rtype: :ref:`wx.richtext.RichTextParagraphLayoutBox`








   .. method:: GetFlags(self)

      Returns flags indicating modifier keys pressed.                  

      Possible values are  ``RICHTEXT_CTRL_DOWN`` ,   ``RICHTEXT_SHIFT_DOWN`` , and   ``RICHTEXT_ALT_DOWN`` .                   

      :rtype: `int`








   .. method:: GetNewStyleSheet(self)

      Returns the new style sheet.                  

      Can be used in a  ``wxEVT_RICHTEXT_STYLESHEET_CHANGING``   or   ``wxEVT_RICHTEXT_STYLESHEET_CHANGED``   event handler.                   

      :rtype: :ref:`wx.richtext.RichTextStyleSheet`








   .. method:: GetOldContainer(self)

      Returns the old container, for a focus change event.                  

      :rtype: :ref:`wx.richtext.RichTextParagraphLayoutBox`








   .. method:: GetOldStyleSheet(self)

      Returns the old style sheet.                  

      Can be used in a  ``wxEVT_RICHTEXT_STYLESHEET_CHANGING``   or   ``wxEVT_RICHTEXT_STYLESHEET_CHANGED``   event handler.                   

      :rtype: :ref:`wx.richtext.RichTextStyleSheet`








   .. method:: GetPosition(self)

      Returns the buffer position at which the event occurred.                  

      :rtype: `long`








   .. method:: GetRange(self)

      Gets the range for the current operation.                  

      :rtype: :ref:`wx.richtext.RichTextRange`








   .. method:: SetCharacter(self, ch)

      Sets the character variable.                  


      :param `ch`: 
      :type `ch`: wx.Char







   .. method:: SetContainer(self, container)

      Sets the container for which the event is relevant.                  


      :param `container`: 
      :type `container`: wx.richtext.RichTextParagraphLayoutBox







   .. method:: SetFlags(self, flags)

      Sets flags indicating modifier keys pressed.                  

      Possible values are  ``RICHTEXT_CTRL_DOWN`` ,   ``RICHTEXT_SHIFT_DOWN`` , and   ``RICHTEXT_ALT_DOWN`` .                   


      :param `flags`: 
      :type `flags`: int







   .. method:: SetNewStyleSheet(self, sheet)

      Sets the new style sheet variable.                  


      :param `sheet`: 
      :type `sheet`: wx.richtext.RichTextStyleSheet







   .. method:: SetOldContainer(self, container)

      Sets the old container, for a focus change event.                  


      :param `container`: 
      :type `container`: wx.richtext.RichTextParagraphLayoutBox







   .. method:: SetOldStyleSheet(self, sheet)

      Sets the old style sheet variable.                  


      :param `sheet`: 
      :type `sheet`: wx.richtext.RichTextStyleSheet







   .. method:: SetPosition(self, pos)

      Sets the buffer position variable.                  


      :param `pos`: 
      :type `pos`: long







   .. method:: SetRange(self, range)

      Sets the range variable.                  


      :param `range`: 
      :type `range`: wx.richtext.RichTextRange







   .. attribute:: Character

      See :meth:`~wx.richtext.RichTextEvent.GetCharacter` and :meth:`~wx.richtext.RichTextEvent.SetCharacter`


   .. attribute:: Container

      See :meth:`~wx.richtext.RichTextEvent.GetContainer` and :meth:`~wx.richtext.RichTextEvent.SetContainer`


   .. attribute:: Flags

      See :meth:`~wx.richtext.RichTextEvent.GetFlags` and :meth:`~wx.richtext.RichTextEvent.SetFlags`


   .. attribute:: NewStyleSheet

      See :meth:`~wx.richtext.RichTextEvent.GetNewStyleSheet` and :meth:`~wx.richtext.RichTextEvent.SetNewStyleSheet`


   .. attribute:: OldContainer

      See :meth:`~wx.richtext.RichTextEvent.GetOldContainer` and :meth:`~wx.richtext.RichTextEvent.SetOldContainer`


   .. attribute:: OldStyleSheet

      See :meth:`~wx.richtext.RichTextEvent.GetOldStyleSheet` and :meth:`~wx.richtext.RichTextEvent.SetOldStyleSheet`


   .. attribute:: Position

      See :meth:`~wx.richtext.RichTextEvent.GetPosition` and :meth:`~wx.richtext.RichTextEvent.SetPosition`


   .. attribute:: Range

      See :meth:`~wx.richtext.RichTextEvent.GetRange` and :meth:`~wx.richtext.RichTextEvent.SetRange`