forked from wxWidgets/wxPython-Classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_richtextctrl.i
More file actions
1075 lines (726 loc) · 31.6 KB
/
_richtextctrl.i
File metadata and controls
1075 lines (726 loc) · 31.6 KB
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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/////////////////////////////////////////////////////////////////////////////
// Name: _richtextctrl.i
// Purpose: wxRichTextCtrl and related classes
//
// Author: Robin Dunn
//
// Created: 11-April-2006
// RCS-ID: $Id$
// Copyright: (c) 2006 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%{
%}
//---------------------------------------------------------------------------
%newgroup
enum {
wxRE_READONLY,
wxRE_MULTILINE,
wxRICHTEXT_SHIFT_DOWN,
wxRICHTEXT_CTRL_DOWN,
wxRICHTEXT_ALT_DOWN,
wxRICHTEXT_SELECTED,
wxRICHTEXT_TAGGED,
wxRICHTEXT_FOCUSSED,
wxRICHTEXT_IS_FOCUS,
};
//---------------------------------------------------------------------------
MAKE_CONST_WXSTRING2(RichTextCtrlNameStr, wxT("richText"));
MustHaveApp(wxRichTextCtrl);
DocStr(wxRichTextCtrl,
"", "");
class wxRichTextCtrl : public wxControl,
public wxTextCtrlIface,
public wxScrollHelper
{
public:
%pythonAppend wxRichTextCtrl "self._setOORInfo(self)"
%pythonAppend wxRichTextCtrl() ""
wxRichTextCtrl( wxWindow* parent,
wxWindowID id = -1,
const wxString& value = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxRE_MULTILINE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyRichTextCtrlNameStr );
%RenameCtor(PreRichTextCtrl, wxRichTextCtrl());
bool Create( wxWindow* parent,
wxWindowID id = -1,
const wxString& value = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxRE_MULTILINE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyRichTextCtrlNameStr );
DocDeclStr(
virtual wxString , GetValue() const,
"", "");
DocDeclStr(
virtual void , SetValue(const wxString& value),
"", "");
DocDeclStr(
virtual wxString , GetRange(long from, long to) const,
"", "");
DocDeclStr(
virtual int , GetLineLength(long lineNo) const ,
"", "");
DocDeclStr(
virtual wxString , GetLineText(long lineNo) const ,
"", "");
DocDeclStr(
virtual int , GetNumberOfLines() const ,
"", "");
DocDeclStr(
virtual bool , IsModified() const ,
"", "");
DocDeclStr(
virtual bool , IsEditable() const ,
"", "");
// more readable flag testing methods
DocDeclStr(
bool , IsSingleLine() const,
"", "");
DocDeclStr(
bool , IsMultiLine() const,
"", "");
DocDeclAStr(
virtual void , GetSelection(long* OUTPUT, long* OUTPUT) const,
"GetSelection() --> (start, end)",
"Returns the start and end positions of the current selection. If the
values are the same then there is no selection.", "");
DocDeclStr(
virtual wxString , GetStringSelection() const,
"", "");
DocDeclStr(
wxString , GetFilename() const,
"", "");
DocDeclStr(
void , SetFilename(const wxString& filename),
"", "");
DocDeclStr(
void , SetDelayedLayoutThreshold(long threshold),
"Set the threshold in character positions for doing layout optimization
during sizing.", "");
DocDeclStr(
long , GetDelayedLayoutThreshold() const,
"Get the threshold in character positions for doing layout optimization
during sizing.", "");
DocDeclStr(
void , SetTextCursor(const wxCursor& cursor ),
"Set text cursor", "");
DocDeclStr(
wxCursor , GetTextCursor() const,
"Get text cursor", "");
DocDeclStr(
void , SetURLCursor(const wxCursor& cursor ),
"Set URL cursor", "");
DocDeclStr(
wxCursor , GetURLCursor() const,
"Get URL cursor", "");
DocDeclStr(
virtual void , Clear(),
"", "");
DocDeclStr(
virtual void , Replace(long from, long to, const wxString& value),
"", "");
DocDeclStr(
virtual void , Remove(long from, long to),
"", "");
DocDeclStr(
virtual bool , LoadFile(const wxString& file, int type = wxRICHTEXT_TYPE_ANY),
"Load the contents of the document from the given filename.", "");
DocDeclStr(
virtual bool , SaveFile(const wxString& file = wxPyEmptyString,
int type = wxRICHTEXT_TYPE_ANY),
"Save the contents of the document to the given filename, or if the
empty string is passed then to the filename set with `SetFilename`.", "");
DocDeclStr(
void , SetHandlerFlags(int flags),
"Set the handler flags, controlling loading and saving.", "");
DocDeclStr(
int , GetHandlerFlags() const,
"Get the handler flags, controlling loading and saving.", "");
// sets/clears the dirty flag
DocDeclStr(
virtual void , MarkDirty(),
"Sets the dirty flag, meaning that the contents of the control have
changed and need to be saved.", "");
DocDeclStr(
virtual void , DiscardEdits(),
"Clears the dirty flag.
:see: `MarkDirty`", "");
DocDeclStr(
virtual void , SetMaxLength(unsigned long len),
"Set the max number of characters which may be entered in a single line
text control.", "");
DocDeclStr(
virtual void , WriteText(const wxString& text),
"Insert text at the current position.", "");
DocDeclStr(
virtual void , AppendText(const wxString& text),
"Append text to the end of the document.", "");
DocDeclStr(
virtual bool , SetStyle(const wxRichTextRange& range, const wxTextAttr& style),
"Set the style for the text in ``range`` to ``style``", "");
DocDeclStr(
virtual bool , GetStyle(long position, wxTextAttr& style),
"Retrieve the style used at the given position. Copies the style
values at ``position`` into the ``style`` parameter and returns ``True``
if successful. Returns ``False`` otherwise.", "");
DocDeclStr(
virtual bool , GetStyleForRange(const wxRichTextRange& range, wxTextAttr& style),
"Get the common set of styles for the range", "");
DocDeclStr(
virtual bool , SetStyleEx(const wxRichTextRange& range, const wxTextAttr& style,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO),
"Extended style setting operation with flags including:
RICHTEXT_SETSTYLE_WITH_UNDO, RICHTEXT_SETSTYLE_OPTIMIZE,
RICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, RICHTEXT_SETSTYLE_CHARACTERS_ONLY", "");
DocDeclStr(
virtual bool , GetUncombinedStyle(long position, wxTextAttr& style),
"Get the content (uncombined) attributes for this position. Copies the
style values at ``position`` into the ``style`` parameter and returns
``True`` if successful. Returns ``False`` otherwise.", "");
DocDeclStr(
virtual bool , SetDefaultStyle(const wxTextAttr& style),
"Set the style used by default for the rich text document.", "");
DocDeclStrName(
virtual const wxTextAttr , GetDefaultStyleEx() const,
"Retrieves a copy of the default style object.", "",
GetDefaultStyle);
// TODO: Select which of these to keep or rename
/// Set list style
// virtual bool SetListStyle(const wxRichTextRange& range,
// wxRichTextListStyleDefinition* def,
// int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO,
// int startFrom = 1, int specifiedLevel = -1);
virtual bool SetListStyle(const wxRichTextRange& range,
const wxString& defName,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO,
int startFrom = 1, int specifiedLevel = -1);
/// Clear list for given range
virtual bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO);
/// Number/renumber any list elements in the given range
/// def/defName can be NULL/empty to indicate that the existing list style should be used.
// virtual bool NumberList(const wxRichTextRange& range,
// wxRichTextListStyleDefinition* def = NULL,
// int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO,
// int startFrom = 1, int specifiedLevel = -1);
virtual bool NumberList(const wxRichTextRange& range,
const wxString& defName,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO,
int startFrom = 1, int specifiedLevel = -1);
/// Promote the list items within the given range. promoteBy can be a positive or negative number, e.g. 1 or -1
/// def/defName can be NULL/empty to indicate that the existing list style should be used.
// virtual bool PromoteList(int promoteBy, const wxRichTextRange& range,
// wxRichTextListStyleDefinition* def = NULL,
// int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO,
// int specifiedLevel = -1);
virtual bool PromoteList(int promoteBy, const wxRichTextRange& range,
const wxString& defName,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO,
int specifiedLevel = -1);
/// Deletes the content in the given range
virtual bool Delete(const wxRichTextRange& range);
DocDeclStr(
virtual long , XYToPosition(long x, long y) const,
"Translate a col,row coordinants into a document position.", "");
DocDeclAStr(
virtual void , PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const,
"PositionToXY(self, long pos) --> (x, y)",
"Retrieves the col,row for the given position within the document", "");
DocDeclStr(
virtual void , ShowPosition(long position),
"Ensure that the given position in the document is visible.", "");
DocDeclAStr(
virtual wxTextCtrlHitTestResult , HitTest(const wxPoint& pt, long *OUTPUT) const,
"HitTest(self, Point pt) --> (result, pos)",
"Returns the character position at the given point in pixels. Note
that ``pt`` should be given in device coordinates, and not be adjusted
for the client area origin nor for scrolling. The return value is a
tuple of the hit test result and the position.", "
Possible result values are a bitmask of these flags:
========================= ====================================
RICHTEXT_HITTEST_NONE The point was not on this object.
RICHTEXT_HITTEST_BEFORE The point was before the position
returned from HitTest.
RICHTEXT_HITTEST_AFTER The point was after the position
returned from HitTest.
RICHTEXT_HITTEST_ON The point was on the position
returned from HitTest
========================= ====================================
");
DocDeclAStrName(
virtual wxTextCtrlHitTestResult , HitTest(const wxPoint& pt,
wxTextCoord *OUTPUT,
wxTextCoord *OUTPUT) const,
"HitTestRC(self, Point pt) --> (result, col, row)",
"Returns the column and row of the given point in pixels. Note that
``pt`` should be given in device coordinates, and not be adjusted for
the client area origin nor for scrolling. The return value is a tuple
of the hit test result and the column and row values.", "
:see: `HitTest`",
HitTestXY);
// Clipboard operations
DocDeclStr(
virtual void , Copy(),
"Copies the selected text to the clipboard.", "");
DocDeclStr(
virtual void , Cut(),
"Copies the selected text to the clipboard and removes the selection.", "");
DocDeclStr(
virtual void , Paste(),
"Pastes text from the clipboard into the document at the current
insertion point.", "");
DocDeclStr(
virtual void , DeleteSelection(),
"Remove the current selection.", "");
DocDeclStr(
virtual bool , CanCopy() const,
"Returns ``True`` if the selection can be copied to the clipboard.", "");
DocDeclStr(
virtual bool , CanCut() const,
"Returns ``True`` if the selection can be cut to the clipboard.", "");
DocDeclStr(
virtual bool , CanPaste() const,
"Returns ``True`` if the current contents of the clipboard can be
pasted into the document.", "");
DocDeclStr(
virtual bool , CanDeleteSelection() const,
"Returns ``True`` if the selection can be removed from the document.", "");
// Undo/redo
DocDeclStr(
virtual void , Undo(),
"If the last operation can be undone, undoes the last operation.", "");
DocDeclStr(
virtual void , Redo(),
"If the last operation can be redone, redoes the last operation.", "");
DocDeclStr(
virtual bool , CanUndo() const,
"Returns ``True`` if the last operation can be undone.", "");
DocDeclStr(
virtual bool , CanRedo() const,
"Returns ``True`` if the last operation can be redone.", "");
// Insertion point
DocDeclStr(
virtual void , SetInsertionPoint(long pos),
"Sets the insertion point at the given position.", "");
DocDeclStr(
virtual void , SetInsertionPointEnd(),
"Moves the insertion point to the end of the document.", "");
DocDeclStr(
virtual long , GetInsertionPoint() const,
"Returns the insertion point. This is defined as the zero based index
of the character position to the right of the insertion point.", "");
DocDeclStr(
virtual long , GetLastPosition() const,
"Returns the zero based index of the last position in the document.", "");
DocDeclStr(
virtual void , SetSelection(long from, long to),
"Selects the text starting at the first position up to (but not
including) the character at the last position. If both parameters are
equal to -1 then all text in the control is selected.", "");
DocDeclStr(
virtual void , SelectAll(),
"Select all text in the document.", "");
DocDeclStr(
virtual void , SetEditable(bool editable),
"Makes the document editable or read-only, overriding the RE_READONLY
flag.", "");
DocDeclStr(
virtual bool , HasSelection() const,
"", "");
///// Functionality specific to wxRichTextCtrl
DocDeclStr(
virtual bool , WriteImage(const wxImage& image,
wxBitmapType bitmapType = wxBITMAP_TYPE_PNG),
"Write an image at the current insertion point. Supply optional type to
use for internal and file storage of the raw data.
", "");
DocDeclStrName(
virtual bool , WriteImage(const wxBitmap& bitmap,
wxBitmapType bitmapType = wxBITMAP_TYPE_PNG),
"Write a bitmap at the current insertion point. Supply optional type to
use for internal and file storage of the raw data.", "",
WriteBitmap);
DocDeclStrName(
virtual bool , WriteImage(const wxString& filename,
wxBitmapType bitmapType),
"Load an image from file and write at the current insertion point.", "",
WriteImageFile);
DocDeclStrName(
virtual bool , WriteImage(const wxRichTextImageBlock& imageBlock),
"Write an image block at the current insertion point.", "",
WriteImageBlock);
DocDeclStr(
virtual bool , Newline(),
"Insert a newline (actually paragraph) at the current insertion point.", "");
DocDeclStr(
virtual bool , LineBreak(),
"Insert a line break at the current insertion point.", "");
DocDeclStr(
virtual void , SetBasicStyle(const wxTextAttr& style),
"", "");
DocDeclStr(
virtual const wxTextAttr , GetBasicStyle() const,
"Get basic (overall) style", "");
DocDeclStr(
virtual bool , BeginStyle(const wxTextAttr& style),
"Begin using a style", "");
DocDeclStr(
virtual bool , EndStyle(),
"End the style", "");
DocDeclStr(
virtual bool , EndAllStyles(),
"End all styles", "");
DocDeclStr(
bool , BeginBold(),
"Begin using bold", "");
DocDeclStr(
bool , EndBold(),
"End using bold", "");
DocDeclStr(
bool , BeginItalic(),
"Begin using italic", "");
DocDeclStr(
bool , EndItalic(),
"End using italic", "");
DocDeclStr(
bool , BeginUnderline(),
"Begin using underline", "");
DocDeclStr(
bool , EndUnderline(),
"End using underline", "");
DocDeclStr(
bool , BeginFontSize(int pointSize),
"Begin using point size", "");
DocDeclStr(
bool , EndFontSize(),
"End using point size", "");
DocDeclStr(
bool , BeginFont(const wxFont& font),
"Begin using this font", "");
DocDeclStr(
bool , EndFont(),
"End using a font", "");
DocDeclStr(
bool , BeginTextColour(const wxColour& colour),
"Begin using this colour", "");
DocDeclStr(
bool , EndTextColour(),
"End using a colour", "");
DocDeclStr(
bool , BeginAlignment(wxTextAttrAlignment alignment),
"Begin using alignment", "");
DocDeclStr(
bool , EndAlignment(),
"End alignment", "");
DocDeclStr(
bool , BeginLeftIndent(int leftIndent, int leftSubIndent = 0),
"Begin left indent", "");
DocDeclStr(
bool , EndLeftIndent(),
"End left indent", "");
DocDeclStr(
bool , BeginRightIndent(int rightIndent),
"Begin right indent", "");
DocDeclStr(
bool , EndRightIndent(),
"End right indent", "");
DocDeclStr(
bool , BeginParagraphSpacing(int before, int after),
"Begin paragraph spacing", "");
DocDeclStr(
bool , EndParagraphSpacing(),
"End paragraph spacing", "");
DocDeclStr(
bool , BeginLineSpacing(int lineSpacing),
"Begin line spacing", "");
DocDeclStr(
bool , EndLineSpacing(),
"End line spacing", "");
DocDeclStr(
bool , BeginNumberedBullet(int bulletNumber,
int leftIndent,
int leftSubIndent,
int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD),
"Begin numbered bullet", "");
DocDeclStr(
bool , EndNumberedBullet(),
"End numbered bullet", "");
DocDeclStr(
bool , BeginSymbolBullet(const wxString& symbol,
int leftIndent,
int leftSubIndent,
int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL),
"Begin symbol bullet", "");
DocDeclStr(
bool , EndSymbolBullet(),
"End symbol bullet", "");
DocDeclStr(
bool , BeginStandardBullet(const wxString& bulletName,
int leftIndent,
int leftSubIndent,
int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD),
"Begin standard bullet", "");
DocDeclStr(
bool , EndStandardBullet(),
"End standard bullet", "");
DocDeclStr(
bool , BeginCharacterStyle(const wxString& characterStyle),
"Begin named character style", "");
DocDeclStr(
bool , EndCharacterStyle(),
"End named character style", "");
DocDeclStr(
bool , BeginParagraphStyle(const wxString& paragraphStyle),
"Begin named paragraph style", "");
DocDeclStr(
bool , EndParagraphStyle(),
"End named character style", "");
DocDeclStr(
bool , BeginListStyle(const wxString& listStyle, int level = 1, int number = 1),
"Begin named list style.", "");
DocDeclStr(
bool , EndListStyle(), "End named list style.", "");
DocDeclStr(
bool , BeginURL(const wxString& url, const wxString& characterStyle = wxEmptyString),
"Begin URL.", "");
DocDeclStr(
bool , EndURL(), "End URL.", "");
DocDeclStr(
bool , SetDefaultStyleToCursorStyle(),
"Sets the default style to the style under the cursor", "");
DocDeclStr(
virtual void , SelectNone(),
"Clear the selection", "");
DocDeclStr(
virtual bool , SelectWord(long position),
"Select the word at the given character position", "");
DocDeclStr(
wxRichTextRange , GetSelectionRange() const,
"Get the selection range in character positions.", "");
DocDeclStr(
void , SetSelectionRange(const wxRichTextRange& range),
"Set the selection range in character positions. -1, -1 means no selection.", "");
DocDeclStr(
const wxRichTextRange& , GetInternalSelectionRange() const,
"Get the selection range in character positions. -1, -1 means no
selection. The range is in internal format, i.e. a single character
selection is denoted by (n, n).
", "");
DocDeclStr(
void , SetInternalSelectionRange(const wxRichTextRange& range),
"Set the selection range in character positions. -1, -1 means no
selection. The range is in internal format, i.e. a single character
selection is denoted by (n, n).", "");
DocDeclStr(
virtual wxRichTextRange , AddParagraph(const wxString& text),
"Add a new paragraph of text to the end of the buffer", "");
DocDeclStr(
virtual wxRichTextRange , AddImage(const wxImage& image),
"Add an image", "");
DocDeclStr(
virtual bool , LayoutContent(bool onlyVisibleRect = false),
"Layout the buffer: which we must do before certain operations, such as
setting the caret position.", "");
DocDeclStr(
virtual bool , MoveCaret(long pos, bool showAtLineStart = false),
"Move the caret to the given character position", "");
DocDeclStr(
virtual bool , MoveRight(int noPositions = 1, int flags = 0),
"Move right", "");
DocDeclStr(
virtual bool , MoveLeft(int noPositions = 1, int flags = 0),
"Move left", "");
DocDeclStr(
virtual bool , MoveUp(int noLines = 1, int flags = 0),
"Move up", "");
DocDeclStr(
virtual bool , MoveDown(int noLines = 1, int flags = 0),
"Move down", "");
DocDeclStr(
virtual bool , MoveToLineEnd(int flags = 0),
"Move to the end of the line", "");
DocDeclStr(
virtual bool , MoveToLineStart(int flags = 0),
"Move to the start of the line", "");
DocDeclStr(
virtual bool , MoveToParagraphEnd(int flags = 0),
"Move to the end of the paragraph", "");
DocDeclStr(
virtual bool , MoveToParagraphStart(int flags = 0),
"Move to the start of the paragraph", "");
DocDeclStr(
virtual bool , MoveHome(int flags = 0),
"Move to the start of the buffer", "");
DocDeclStr(
virtual bool , MoveEnd(int flags = 0),
"Move to the end of the buffer", "");
DocDeclStr(
virtual bool , PageUp(int noPages = 1, int flags = 0),
"Move n pages up", "");
DocDeclStr(
virtual bool , PageDown(int noPages = 1, int flags = 0),
"Move n pages down", "");
DocDeclStr(
virtual bool , WordLeft(int noPages = 1, int flags = 0),
"Move n words left", "");
DocDeclStr(
virtual bool , WordRight(int noPages = 1, int flags = 0),
"Move n words right", "");
DocDeclStr(
wxRichTextBuffer& , GetBuffer(),
"Returns the buffer associated with the control.
", "");
DocDeclStr(
virtual bool , BeginBatchUndo(const wxString& cmdName),
"Start batching undo history for commands", "");
DocDeclStr(
virtual bool , EndBatchUndo(),
"End batching undo history for commands.", "");
DocDeclStr(
virtual bool , BatchingUndo() const,
"Are we batching undo history for commands?", "");
DocDeclStr(
virtual bool , BeginSuppressUndo(),
"Start suppressing undo history for commands.", "");
DocDeclStr(
virtual bool , EndSuppressUndo(),
"End suppressing undo history for commands.", "");
DocDeclStr(
virtual bool , SuppressingUndo() const,
"Are we suppressing undo history for commands?", "");
DocDeclStr(
virtual bool , HasCharacterAttributes(const wxRichTextRange& range,
const wxTextAttr& style) const,
"Test if this whole range has character attributes of the specified
kind. If any of the attributes are different within the range, the
test fails. You can use this to implement, for example, bold button
updating. ``style`` must have flags indicating which attributes are of
interest.
", "");
DocDeclStr(
virtual bool , HasParagraphAttributes(const wxRichTextRange& range,
const wxTextAttr& style) const,
"Test if this whole range has paragraph attributes of the specified
kind. If any of the attributes are different within the range, the
test fails. You can use this to implement, for example, centering
button updating. style must have flags indicating which attributes are
of interest.
", "");
DocDeclStr(
virtual bool , IsSelectionBold(),
"Is all of the selection bold?", "");
DocDeclStr(
virtual bool , IsSelectionItalics(),
"Is all of the selection italics?", "");
DocDeclStr(
virtual bool , IsSelectionUnderlined(),
"Is all of the selection underlined?", "");
DocDeclStr(
virtual bool , IsSelectionAligned(wxTextAttrAlignment alignment),
"Is all of the selection aligned according to the specified flag?", "");
DocDeclStr(
virtual bool , ApplyBoldToSelection(),
"Apply bold to the selection", "");
DocDeclStr(
virtual bool , ApplyItalicToSelection(),
"Apply italic to the selection", "");
DocDeclStr(
virtual bool , ApplyUnderlineToSelection(),
"Apply underline to the selection", "");
DocDeclStr(
virtual bool , ApplyAlignmentToSelection(wxTextAttrAlignment alignment),
"Apply alignment to the selection", "");
DocDeclStr(
virtual bool , ApplyStyle(wxRichTextStyleDefinition* def),
"Apply a named style to the selection", "");
DocDeclStr(
void , SetStyleSheet(wxRichTextStyleSheet* styleSheet),
"Set style sheet, if any.", "");
DocDeclStr(
wxRichTextStyleSheet* , GetStyleSheet() const,
"", "");
DocDeclStr(
bool , PushStyleSheet(wxRichTextStyleSheet* styleSheet),
"Push style sheet to top of stack", "");
DocDeclStr(
wxRichTextStyleSheet* , PopStyleSheet(),
"Pop style sheet from top of stack", "");
DocDeclStr(
bool , ApplyStyleSheet(wxRichTextStyleSheet* styleSheet = NULL),
"Apply the style sheet to the buffer, for example if the styles have
changed.", "");
%property(Buffer, GetBuffer);
%property(DelayedLayoutThreshold, GetDelayedLayoutThreshold, SetDelayedLayoutThreshold);
%property(Filename, GetFilename, SetFilename);
%property(InternalSelectionRange, GetInternalSelectionRange, SetInternalSelectionRange);
%property(SelectionRange, GetSelectionRange, SetSelectionRange);
%property(StyleSheet, GetStyleSheet, SetStyleSheet);
%property(TextCursor, GetTextCursor, SetTextCursor);
%property(URLCursor, GetURLCursor, SetURLCursor);
};
//---------------------------------------------------------------------------
%newgroup