1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _richtext.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13const int wxRE_READONLY; 14const int wxRE_MULTILINE; 15const int wxRE_CENTRE_CARET; 16const int wxRE_CENTER_CARET; 17const int wxRICHTEXT_SHIFT_DOWN; 18const int wxRICHTEXT_CTRL_DOWN; 19const int wxRICHTEXT_ALT_DOWN; 20const int wxRICHTEXT_EX_NO_GUIDELINES; 21const int wxID_RICHTEXT_PROPERTIES1; 22const int wxID_RICHTEXT_PROPERTIES2; 23const int wxID_RICHTEXT_PROPERTIES3; 24enum wxRichTextCtrlSelectionState 25{ 26 wxRichTextCtrlSelectionState_Normal, 27 wxRichTextCtrlSelectionState_CommonAncestor 28}; 29 30wxEventType wxEVT_RICHTEXT_LEFT_CLICK /PyName=wxEVT_RICHTEXT_LEFT_CLICK/; 31 32wxEventType wxEVT_RICHTEXT_RIGHT_CLICK /PyName=wxEVT_RICHTEXT_RIGHT_CLICK/; 33 34wxEventType wxEVT_RICHTEXT_MIDDLE_CLICK /PyName=wxEVT_RICHTEXT_MIDDLE_CLICK/; 35 36wxEventType wxEVT_RICHTEXT_LEFT_DCLICK /PyName=wxEVT_RICHTEXT_LEFT_DCLICK/; 37 38wxEventType wxEVT_RICHTEXT_RETURN /PyName=wxEVT_RICHTEXT_RETURN/; 39 40wxEventType wxEVT_RICHTEXT_CHARACTER /PyName=wxEVT_RICHTEXT_CHARACTER/; 41 42wxEventType wxEVT_RICHTEXT_CONSUMING_CHARACTER /PyName=wxEVT_RICHTEXT_CONSUMING_CHARACTER/; 43 44wxEventType wxEVT_RICHTEXT_DELETE /PyName=wxEVT_RICHTEXT_DELETE/; 45 46wxEventType wxEVT_RICHTEXT_STYLESHEET_CHANGING /PyName=wxEVT_RICHTEXT_STYLESHEET_CHANGING/; 47 48wxEventType wxEVT_RICHTEXT_STYLESHEET_CHANGED /PyName=wxEVT_RICHTEXT_STYLESHEET_CHANGED/; 49 50wxEventType wxEVT_RICHTEXT_STYLESHEET_REPLACING /PyName=wxEVT_RICHTEXT_STYLESHEET_REPLACING/; 51 52wxEventType wxEVT_RICHTEXT_STYLESHEET_REPLACED /PyName=wxEVT_RICHTEXT_STYLESHEET_REPLACED/; 53 54wxEventType wxEVT_RICHTEXT_CONTENT_INSERTED /PyName=wxEVT_RICHTEXT_CONTENT_INSERTED/; 55 56wxEventType wxEVT_RICHTEXT_CONTENT_DELETED /PyName=wxEVT_RICHTEXT_CONTENT_DELETED/; 57 58wxEventType wxEVT_RICHTEXT_STYLE_CHANGED /PyName=wxEVT_RICHTEXT_STYLE_CHANGED/; 59 60wxEventType wxEVT_RICHTEXT_PROPERTIES_CHANGED /PyName=wxEVT_RICHTEXT_PROPERTIES_CHANGED/; 61 62wxEventType wxEVT_RICHTEXT_SELECTION_CHANGED /PyName=wxEVT_RICHTEXT_SELECTION_CHANGED/; 63 64wxEventType wxEVT_RICHTEXT_BUFFER_RESET /PyName=wxEVT_RICHTEXT_BUFFER_RESET/; 65 66wxEventType wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED /PyName=wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED/; 67 68class wxRichTextContextMenuPropertiesInfo 69{ 70 %Docstring 71 RichTextContextMenuPropertiesInfo() 72 73 wxRichTextContextMenuPropertiesInfo keeps track of objects that appear 74 in the context menu, whose properties are available to be edited. 75 %End 76 %TypeHeaderCode 77 #include <wx/richtext/richtextctrl.h> 78 %End 79 80public: 81 wxRichTextContextMenuPropertiesInfo(); 82 83 wxRichTextObjectPtrArray m_objects; 84 85 wxArrayString m_labels; 86 87 void Init(); 88 %Docstring 89 Init() 90 91 Initialisation. 92 %End 93 94 bool AddItem( 95 const wxString & label, 96 wxRichTextObject * obj 97 ); 98 %Docstring 99 AddItem(label, obj) -> bool 100 101 Adds an item. 102 %End 103 104 int AddMenuItems( 105 wxMenu * menu, 106 int startCmd = wxID_RICHTEXT_PROPERTIES1 107 ) const; 108 %Docstring 109 AddMenuItems(menu, startCmd=ID_RICHTEXT_PROPERTIES1) -> int 110 111 Returns the number of menu items that were added. 112 %End 113 114 int AddItems( 115 wxRichTextCtrl * ctrl, 116 wxRichTextObject * container, 117 wxRichTextObject * obj 118 ); 119 %Docstring 120 AddItems(ctrl, container, obj) -> int 121 122 Adds appropriate menu items for the current container and clicked on 123 object (and container's parent, if appropriate). 124 %End 125 126 void Clear(); 127 %Docstring 128 Clear() 129 130 Clears the items. 131 %End 132 133 wxString GetLabel( 134 int n 135 ) const; 136 %Docstring 137 GetLabel(n) -> String 138 139 Returns the nth label. 140 %End 141 142 wxRichTextObject * GetObject( 143 int n 144 ) const; 145 %Docstring 146 GetObject(n) -> RichTextObject 147 148 Returns the nth object. 149 %End 150 151 wxRichTextObjectPtrArray & GetObjects(); 152 %Docstring 153 GetObjects() -> RichTextObjectPtrArray 154 155 Returns the array of objects. 156 %End 157 158 wxArrayString & GetLabels(); 159 %Docstring 160 GetLabels() -> ArrayString 161 162 Returns the array of labels. 163 %End 164 165 int GetCount() const; 166 %Docstring 167 GetCount() -> int 168 169 Returns the number of items. 170 %End 171 172 public: 173 174 175 %Property(name=Count, get=GetCount) 176 %Property(name=Labels, get=GetLabels) 177 %Property(name=Objects, get=GetObjects) 178}; // end of class wxRichTextContextMenuPropertiesInfo 179 180 181class wxRichTextCtrl : wxControl 182{ 183 %Docstring 184 RichTextCtrl() 185 RichTextCtrl(parent, id=-1, value=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=RE_MULTILINE, validator=wx.DefaultValidator, name=wx.TextCtrlNameStr) 186 187 wxRichTextCtrl provides a generic, ground-up implementation of a text 188 control capable of showing multiple styles and images. 189 %End 190 %TypeHeaderCode 191 #include <wx/richtext/richtextctrl.h> 192 %End 193 194public: 195 wxRichTextCtrl(); 196 %PreMethodCode 197 if (!wxPyCheckForApp()) return NULL; 198 %End 199 200 wxRichTextCtrl( 201 wxWindow * parent /TransferThis/, 202 wxWindowID id = -1, 203 const wxString & value = wxEmptyString, 204 const wxPoint & pos = wxDefaultPosition, 205 const wxSize & size = wxDefaultSize, 206 long style = wxRE_MULTILINE, 207 const wxValidator & validator = wxDefaultValidator, 208 const wxString & name = wxTextCtrlNameStr 209 ); 210 %PreMethodCode 211 if (!wxPyCheckForApp()) return NULL; 212 %End 213 214 ~wxRichTextCtrl(); 215 216 wxRichTextSelection & GetSelection(); 217 %Docstring 218 GetSelection() -> RichTextSelection 219 220 Returns the range of the current selection. 221 %End 222 223 wxRichTextContextMenuPropertiesInfo & GetContextMenuPropertiesInfo(); 224 %Docstring 225 GetContextMenuPropertiesInfo() -> RichTextContextMenuPropertiesInfo 226 227 Returns an object that stores information about context menu property 228 item(s), in order to communicate between the context menu event 229 handler and the code that responds to it. 230 %End 231 232 bool GetStyle( 233 long position, 234 wxTextAttr & style 235 ); 236 %Docstring 237 GetStyle(position, style) -> bool 238 GetStyle(position, style) -> bool 239 GetStyle(position, style, container) -> bool 240 241 Gets the attributes at the given position. 242 %End 243 244 bool GetStyle( 245 long position, 246 wxRichTextAttr & style 247 ); 248 249 bool GetStyle( 250 long position, 251 wxRichTextAttr & style, 252 wxRichTextParagraphLayoutBox * container 253 ); 254 255 bool SetStyle( 256 long start, 257 long end, 258 const wxTextAttr & style 259 ); 260 %Docstring 261 SetStyle(start, end, style) -> bool 262 SetStyle(start, end, style) -> bool 263 SetStyle(range, style) -> bool 264 SetStyle(range, style) -> bool 265 SetStyle(obj, textAttr, flags=RICHTEXT_SETSTYLE_WITH_UNDO) 266 267 Sets the attributes for the given range. 268 %End 269 270 bool SetStyle( 271 long start, 272 long end, 273 const wxRichTextAttr & style 274 ); 275 276 bool SetStyle( 277 const wxRichTextRange & range, 278 const wxTextAttr & style 279 ); 280 281 bool SetStyle( 282 const wxRichTextRange & range, 283 const wxRichTextAttr & style 284 ); 285 286 void SetStyle( 287 wxRichTextObject * obj, 288 const wxRichTextAttr & textAttr, 289 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO 290 ); 291 292 bool GetStyleForRange( 293 const wxRichTextRange & range, 294 wxTextAttr & style 295 ); 296 %Docstring 297 GetStyleForRange(range, style) -> bool 298 GetStyleForRange(range, style) -> bool 299 GetStyleForRange(range, style, container) -> bool 300 301 Gets the attributes common to the specified range. 302 %End 303 304 bool GetStyleForRange( 305 const wxRichTextRange & range, 306 wxRichTextAttr & style 307 ); 308 309 bool GetStyleForRange( 310 const wxRichTextRange & range, 311 wxRichTextAttr & style, 312 wxRichTextParagraphLayoutBox * container 313 ); 314 315 bool GetUncombinedStyle( 316 long position, 317 wxRichTextAttr & style 318 ); 319 %Docstring 320 GetUncombinedStyle(position, style) -> bool 321 GetUncombinedStyle(position, style, container) -> bool 322 323 Gets the attributes at the given position. 324 %End 325 326 bool GetUncombinedStyle( 327 long position, 328 wxRichTextAttr & style, 329 wxRichTextParagraphLayoutBox * container 330 ); 331 332 bool SetDefaultStyle( 333 const wxTextAttr & style 334 ); 335 %Docstring 336 SetDefaultStyle(style) -> bool 337 SetDefaultStyle(style) -> bool 338 339 Sets the current default style, which can be used to change how 340 subsequently inserted text is displayed. 341 %End 342 343 bool SetDefaultStyle( 344 const wxRichTextAttr & style 345 ); 346 347 bool SetListStyle( 348 const wxRichTextRange & range, 349 wxRichTextListStyleDefinition * styleDef, 350 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, 351 int startFrom = 1, 352 int specifiedLevel = -1 353 ); 354 %Docstring 355 SetListStyle(range, styleDef, flags=RICHTEXT_SETSTYLE_WITH_UNDO, startFrom=1, specifiedLevel=-1) -> bool 356 SetListStyle(range, defName, flags=RICHTEXT_SETSTYLE_WITH_UNDO, startFrom=1, specifiedLevel=-1) -> bool 357 358 Sets the list attributes for the given range, passing flags to 359 determine how the attributes are set. 360 %End 361 362 bool SetListStyle( 363 const wxRichTextRange & range, 364 const wxString & defName, 365 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, 366 int startFrom = 1, 367 int specifiedLevel = -1 368 ); 369 370 bool NumberList( 371 const wxRichTextRange & range, 372 wxRichTextListStyleDefinition * def = NULL, 373 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, 374 int startFrom = 1, 375 int specifiedLevel = -1 376 ); 377 %Docstring 378 NumberList(range, def=None, flags=RICHTEXT_SETSTYLE_WITH_UNDO, startFrom=1, specifiedLevel=-1) -> bool 379 NumberList(range, defName, flags=RICHTEXT_SETSTYLE_WITH_UNDO, startFrom=1, specifiedLevel=-1) -> bool 380 381 Numbers the paragraphs in the given range. 382 %End 383 384 bool NumberList( 385 const wxRichTextRange & range, 386 const wxString & defName, 387 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, 388 int startFrom = 1, 389 int specifiedLevel = -1 390 ); 391 392 bool PromoteList( 393 int promoteBy, 394 const wxRichTextRange & range, 395 wxRichTextListStyleDefinition * def = NULL, 396 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, 397 int specifiedLevel = -1 398 ); 399 %Docstring 400 PromoteList(promoteBy, range, def=None, flags=RICHTEXT_SETSTYLE_WITH_UNDO, specifiedLevel=-1) -> bool 401 PromoteList(promoteBy, range, defName, flags=RICHTEXT_SETSTYLE_WITH_UNDO, specifiedLevel=-1) -> bool 402 403 Promotes or demotes the paragraphs in the given range. 404 %End 405 406 bool PromoteList( 407 int promoteBy, 408 const wxRichTextRange & range, 409 const wxString & defName, 410 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, 411 int specifiedLevel = -1 412 ); 413 414 wxTextCtrlHitTestResult HitTest( 415 const wxPoint & pt, 416 long * pos /Out/ 417 ) const; 418 %Docstring 419 HitTest(pt) -> (TextCtrlHitTestResult, pos) 420 421 Finds the character at the given position in pixels. 422 %End 423 424 wxTextCtrlHitTestResult HitTest( 425 const wxPoint & pt, 426 wxTextCoord * col /Out/, 427 wxTextCoord * row /Out/ 428 ) const /PyName=HitTestXY/; 429 %Docstring 430 HitTestXY(pt) -> (TextCtrlHitTestResult, col, row) 431 432 Finds the character at the given position in pixels. 433 %End 434 435 wxRichTextParagraphLayoutBox * FindContainerAtPoint( 436 const wxPoint pt, 437 long & position, 438 int & hit, 439 wxRichTextObject * hitObj, 440 int flags = 0 441 ); 442 %Docstring 443 FindContainerAtPoint(pt, position, hit, hitObj, flags=0) -> RichTextParagraphLayoutBox 444 445 Finds the container at the given point, which is assumed to be in 446 client coordinates. 447 %End 448 449 void SetSelection( 450 long from_, 451 long to_ 452 ); 453 %Docstring 454 SetSelection(from_, to_) 455 SetSelection(sel) 456 457 Sets the selection to the given range. 458 %End 459 460 void SetSelection( 461 const wxRichTextSelection & sel 462 ); 463 464 bool WriteImage( 465 const wxImage & image, 466 wxBitmapType bitmapType = wxBITMAP_TYPE_PNG, 467 const wxRichTextAttr & textAttr = wxRichTextAttr() 468 ); 469 %Docstring 470 WriteImage(image, bitmapType=wx.BITMAP_TYPE_PNG, textAttr=RichTextAttr()) -> bool 471 WriteImage(bitmap, bitmapType=wx.BITMAP_TYPE_PNG, textAttr=RichTextAttr()) -> bool 472 WriteImage(filename, bitmapType, textAttr=RichTextAttr()) -> bool 473 WriteImage(imageBlock, textAttr=RichTextAttr()) -> bool 474 475 Write a bitmap or image at the current insertion point. 476 %End 477 478 bool WriteImage( 479 const wxBitmap & bitmap, 480 wxBitmapType bitmapType = wxBITMAP_TYPE_PNG, 481 const wxRichTextAttr & textAttr = wxRichTextAttr() 482 ); 483 484 bool WriteImage( 485 const wxString & filename, 486 wxBitmapType bitmapType, 487 const wxRichTextAttr & textAttr = wxRichTextAttr() 488 ); 489 490 bool WriteImage( 491 const wxRichTextImageBlock & imageBlock, 492 const wxRichTextAttr & textAttr = wxRichTextAttr() 493 ); 494 495 wxRichTextBuffer & GetBuffer(); 496 %Docstring 497 GetBuffer() -> RichTextBuffer 498 499 Returns the buffer associated with the control. 500 %End 501 502 bool Create( 503 wxWindow * parent /TransferThis/, 504 wxWindowID id = -1, 505 const wxString & value = wxEmptyString, 506 const wxPoint & pos = wxDefaultPosition, 507 const wxSize & size = wxDefaultSize, 508 long style = wxRE_MULTILINE, 509 const wxValidator & validator = wxDefaultValidator, 510 const wxString & name = wxTextCtrlNameStr 511 ); 512 %Docstring 513 Create(parent, id=-1, value=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=RE_MULTILINE, validator=wx.DefaultValidator, name=wx.TextCtrlNameStr) -> bool 514 515 Creates the underlying window. 516 %End 517 518 void Init(); 519 %Docstring 520 Init() 521 522 Initialises the members of the control. 523 %End 524 525 wxString GetRange( 526 long from_, 527 long to_ 528 ) const; 529 %Docstring 530 GetRange(from_, to_) -> String 531 532 Gets the text for the given range. 533 %End 534 535 int GetLineLength( 536 long lineNo 537 ) const; 538 %Docstring 539 GetLineLength(lineNo) -> int 540 541 Returns the length of the specified line in characters. 542 %End 543 544 wxString GetLineText( 545 long lineNo 546 ) const; 547 %Docstring 548 GetLineText(lineNo) -> String 549 550 Returns the text for the given line. 551 %End 552 553 int GetNumberOfLines() const; 554 %Docstring 555 GetNumberOfLines() -> int 556 557 Returns the number of lines in the buffer. 558 %End 559 560 bool IsModified() const; 561 %Docstring 562 IsModified() -> bool 563 564 Returns true if the buffer has been modified. 565 %End 566 567 bool IsEditable() const; 568 %Docstring 569 IsEditable() -> bool 570 571 Returns true if the control is editable. 572 %End 573 574 bool IsSingleLine() const; 575 %Docstring 576 IsSingleLine() -> bool 577 578 Returns true if the control is single-line. 579 %End 580 581 bool IsMultiLine() const; 582 %Docstring 583 IsMultiLine() -> bool 584 585 Returns true if the control is multiline. 586 %End 587 588 wxString GetStringSelection() const; 589 %Docstring 590 GetStringSelection() -> String 591 592 Returns the text within the current selection range, if any. 593 %End 594 595 wxString GetFilename() const; 596 %Docstring 597 GetFilename() -> String 598 599 Gets the current filename associated with the control. 600 %End 601 602 void SetFilename( 603 const wxString & filename 604 ); 605 %Docstring 606 SetFilename(filename) 607 608 Sets the current filename. 609 %End 610 611 void SetDelayedLayoutThreshold( 612 long threshold 613 ); 614 %Docstring 615 SetDelayedLayoutThreshold(threshold) 616 617 Sets the size of the buffer beyond which layout is delayed during 618 resizing. 619 %End 620 621 long GetDelayedLayoutThreshold() const; 622 %Docstring 623 GetDelayedLayoutThreshold() -> long 624 625 Gets the size of the buffer beyond which layout is delayed during 626 resizing. 627 %End 628 629 bool GetFullLayoutRequired() const; 630 %Docstring 631 GetFullLayoutRequired() -> bool 632 %End 633 634 void SetFullLayoutRequired( 635 bool b 636 ); 637 %Docstring 638 SetFullLayoutRequired(b) 639 %End 640 641 wxLongLong GetFullLayoutTime() const; 642 %Docstring 643 GetFullLayoutTime() -> LongLong 644 %End 645 646 void SetFullLayoutTime( 647 wxLongLong t 648 ); 649 %Docstring 650 SetFullLayoutTime(t) 651 %End 652 653 long GetFullLayoutSavedPosition() const; 654 %Docstring 655 GetFullLayoutSavedPosition() -> long 656 %End 657 658 void SetFullLayoutSavedPosition( 659 long p 660 ); 661 %Docstring 662 SetFullLayoutSavedPosition(p) 663 %End 664 665 void ForceDelayedLayout(); 666 %Docstring 667 ForceDelayedLayout() 668 %End 669 670 void SetTextCursor( 671 const wxCursor & cursor 672 ); 673 %Docstring 674 SetTextCursor(cursor) 675 676 Sets the text (normal) cursor. 677 %End 678 679 wxCursor GetTextCursor() const; 680 %Docstring 681 GetTextCursor() -> wx.Cursor 682 683 Returns the text (normal) cursor. 684 %End 685 686 void SetURLCursor( 687 const wxCursor & cursor 688 ); 689 %Docstring 690 SetURLCursor(cursor) 691 692 Sets the cursor to be used over URLs. 693 %End 694 695 wxCursor GetURLCursor() const; 696 %Docstring 697 GetURLCursor() -> wx.Cursor 698 699 Returns the cursor to be used over URLs. 700 %End 701 702 bool GetCaretAtLineStart() const; 703 %Docstring 704 GetCaretAtLineStart() -> bool 705 706 Returns true if we are showing the caret position at the start of a 707 line instead of at the end of the previous one. 708 %End 709 710 void SetCaretAtLineStart( 711 bool atStart 712 ); 713 %Docstring 714 SetCaretAtLineStart(atStart) 715 716 Sets a flag to remember that we are showing the caret position at the 717 start of a line instead of at the end of the previous one. 718 %End 719 720 bool GetDragging() const; 721 %Docstring 722 GetDragging() -> bool 723 724 Returns true if we are extending a selection. 725 %End 726 727 void SetDragging( 728 bool dragging 729 ); 730 %Docstring 731 SetDragging(dragging) 732 733 Sets a flag to remember if we are extending a selection. 734 %End 735 736 bool GetPreDrag() const; 737 %Docstring 738 GetPreDrag() -> bool 739 740 Are we trying to start Drag'n'Drop? 741 %End 742 743 void SetPreDrag( 744 bool pd 745 ); 746 %Docstring 747 SetPreDrag(pd) 748 749 Set if we're trying to start Drag'n'Drop. 750 %End 751 752 const wxPoint GetDragStartPoint() const; 753 %Docstring 754 GetDragStartPoint() -> wx.Point 755 756 Get the possible Drag'n'Drop start point. 757 %End 758 759 void SetDragStartPoint( 760 wxPoint sp 761 ); 762 %Docstring 763 SetDragStartPoint(sp) 764 765 Set the possible Drag'n'Drop start point. 766 %End 767 768 const wxDateTime GetDragStartTime() const; 769 %Docstring 770 GetDragStartTime() -> wx.DateTime 771 772 Get the possible Drag'n'Drop start time. 773 %End 774 775 void SetDragStartTime( 776 wxDateTime st 777 ); 778 %Docstring 779 SetDragStartTime(st) 780 781 Set the possible Drag'n'Drop start time. 782 %End 783 784 wxMenu * GetContextMenu() const; 785 %Docstring 786 GetContextMenu() -> wx.Menu 787 788 Returns the current context menu. 789 %End 790 791 void SetContextMenu( 792 wxMenu * menu 793 ); 794 %Docstring 795 SetContextMenu(menu) 796 797 Sets the current context menu. 798 %End 799 800 long GetSelectionAnchor() const; 801 %Docstring 802 GetSelectionAnchor() -> long 803 804 Returns an anchor so we know how to extend the selection. 805 %End 806 807 void SetSelectionAnchor( 808 long anchor 809 ); 810 %Docstring 811 SetSelectionAnchor(anchor) 812 813 Sets an anchor so we know how to extend the selection. 814 %End 815 816 wxRichTextObject * GetSelectionAnchorObject() const; 817 %Docstring 818 GetSelectionAnchorObject() -> RichTextObject 819 820 Returns the anchor object if selecting multiple containers. 821 %End 822 823 void SetSelectionAnchorObject( 824 wxRichTextObject * anchor 825 ); 826 %Docstring 827 SetSelectionAnchorObject(anchor) 828 829 Sets the anchor object if selecting multiple containers. 830 %End 831 832 wxRichTextParagraphLayoutBox * GetFocusObject() const; 833 %Docstring 834 GetFocusObject() -> RichTextParagraphLayoutBox 835 836 Returns the wxRichTextObject object that currently has the editing 837 focus. 838 %End 839 840 void StoreFocusObject( 841 wxRichTextParagraphLayoutBox * obj 842 ); 843 %Docstring 844 StoreFocusObject(obj) 845 846 Setter for m_focusObject. 847 %End 848 849 bool SetFocusObject( 850 wxRichTextParagraphLayoutBox * obj, 851 bool setCaretPosition = true 852 ); 853 %Docstring 854 SetFocusObject(obj, setCaretPosition=True) -> bool 855 856 Sets the wxRichTextObject object that currently has the editing focus. 857 %End 858 859 void Invalidate(); 860 %Docstring 861 Invalidate() 862 863 Invalidates the whole buffer to trigger painting later. 864 %End 865 866 void Clear(); 867 %Docstring 868 Clear() 869 870 Clears the buffer content, leaving a single empty paragraph. 871 %End 872 873 void Replace( 874 long from_, 875 long to_, 876 const wxString & value 877 ); 878 %Docstring 879 Replace(from_, to_, value) 880 881 Replaces the content in the specified range with the string specified 882 by value. 883 %End 884 885 void Remove( 886 long from_, 887 long to_ 888 ); 889 %Docstring 890 Remove(from_, to_) 891 892 Removes the content in the specified range. 893 %End 894 895 bool LoadFile( 896 const wxString & file, 897 int type = wxRICHTEXT_TYPE_ANY 898 ); 899 %Docstring 900 LoadFile(file, type=RICHTEXT_TYPE_ANY) -> bool 901 902 Loads content into the control's buffer using the given type. 903 %End 904 905 bool DoLoadFile( 906 const wxString & file, 907 int fileType 908 ); 909 %Docstring 910 DoLoadFile(file, fileType) -> bool 911 912 Helper function for LoadFile(). 913 %End 914 915 bool SaveFile( 916 const wxString & file = wxEmptyString, 917 int type = wxRICHTEXT_TYPE_ANY 918 ); 919 %Docstring 920 SaveFile(file=wx.EmptyString, type=RICHTEXT_TYPE_ANY) -> bool 921 922 Saves the buffer content using the given type. 923 %End 924 925 bool DoSaveFile( 926 const wxString & file = wxEmptyString, 927 int fileType = wxRICHTEXT_TYPE_ANY 928 ); 929 %Docstring 930 DoSaveFile(file=wx.EmptyString, fileType=RICHTEXT_TYPE_ANY) -> bool 931 932 Helper function for SaveFile(). 933 %End 934 935 void SetHandlerFlags( 936 int flags 937 ); 938 %Docstring 939 SetHandlerFlags(flags) 940 941 Sets flags that change the behaviour of loading or saving. 942 %End 943 944 int GetHandlerFlags() const; 945 %Docstring 946 GetHandlerFlags() -> int 947 948 Returns flags that change the behaviour of loading or saving. 949 %End 950 951 void MarkDirty(); 952 %Docstring 953 MarkDirty() 954 955 Marks the buffer as modified. 956 %End 957 958 void DiscardEdits(); 959 %Docstring 960 DiscardEdits() 961 962 Sets the buffer's modified status to false, and clears the buffer's 963 command history. 964 %End 965 966 void SetModified( 967 bool modified 968 ); 969 %Docstring 970 SetModified(modified) 971 %End 972 973 void SetMaxLength( 974 unsigned long len 975 ); 976 %Docstring 977 SetMaxLength(len) 978 979 Sets the maximum number of characters that may be entered in a single 980 line text control. 981 %End 982 983 void WriteText( 984 const wxString & text 985 ); 986 %Docstring 987 WriteText(text) 988 989 Writes text at the current position. 990 %End 991 992 void AppendText( 993 const wxString & text 994 ); 995 %Docstring 996 AppendText(text) 997 998 Sets the insertion point to the end of the buffer and writes the text. 999 %End 1000 1001 bool SetStyleEx( 1002 const wxRichTextRange & range, 1003 const wxRichTextAttr & style, 1004 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO 1005 ); 1006 %Docstring 1007 SetStyleEx(range, style, flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool 1008 1009 Sets the attributes for the given range, passing flags to determine 1010 how the attributes are set. 1011 %End 1012 1013 const wxRichTextAttr & GetDefaultStyleEx() const; 1014 %Docstring 1015 GetDefaultStyleEx() -> RichTextAttr 1016 1017 Returns the current default style, which can be used to change how 1018 subsequently inserted text is displayed. 1019 %End 1020 1021 bool ClearListStyle( 1022 const wxRichTextRange & range, 1023 int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO 1024 ); 1025 %Docstring 1026 ClearListStyle(range, flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool 1027 1028 Clears the list style from the given range, clearing list-related 1029 attributes and applying any named paragraph style associated with each 1030 paragraph. 1031 %End 1032 1033 bool SetProperties( 1034 const wxRichTextRange & range, 1035 const wxRichTextProperties & properties, 1036 int flags = wxRICHTEXT_SETPROPERTIES_WITH_UNDO 1037 ); 1038 %Docstring 1039 SetProperties(range, properties, flags=RICHTEXT_SETPROPERTIES_WITH_UNDO) -> bool 1040 1041 Sets the properties for the given range, passing flags to determine 1042 how the attributes are set. 1043 %End 1044 1045 bool Delete( 1046 const wxRichTextRange & range 1047 ); 1048 %Docstring 1049 Delete(range) -> bool 1050 1051 Deletes the content within the given range. 1052 %End 1053 1054 long XYToPosition( 1055 long x, 1056 long y 1057 ) const; 1058 %Docstring 1059 XYToPosition(x, y) -> long 1060 1061 Translates from column and line number to position. 1062 %End 1063 1064 bool PositionToXY( 1065 long pos, 1066 long * x /Out/, 1067 long * y /Out/ 1068 ) const; 1069 %Docstring 1070 PositionToXY(pos) -> (bool, x, y) 1071 1072 Converts a text position to zero-based column and line numbers. 1073 %End 1074 1075 void ShowPosition( 1076 long pos 1077 ); 1078 %Docstring 1079 ShowPosition(pos) 1080 1081 Scrolls the buffer so that the given position is in view. 1082 %End 1083 1084 virtual 1085 void Copy(); 1086 %Docstring 1087 Copy() 1088 1089 Copies the selected content (if any) to the clipboard. 1090 %End 1091 1092 virtual 1093 void Cut(); 1094 %Docstring 1095 Cut() 1096 1097 Copies the selected content (if any) to the clipboard and deletes the 1098 selection. 1099 %End 1100 1101 virtual 1102 void Paste(); 1103 %Docstring 1104 Paste() 1105 1106 Pastes content from the clipboard to the buffer. 1107 %End 1108 1109 void DeleteSelection(); 1110 %Docstring 1111 DeleteSelection() 1112 1113 Deletes the content in the selection, if any. 1114 %End 1115 1116 virtual 1117 bool CanCopy() const; 1118 %Docstring 1119 CanCopy() -> bool 1120 1121 Returns true if selected content can be copied to the clipboard. 1122 %End 1123 1124 virtual 1125 bool CanCut() const; 1126 %Docstring 1127 CanCut() -> bool 1128 1129 Returns true if selected content can be copied to the clipboard and 1130 deleted. 1131 %End 1132 1133 virtual 1134 bool CanPaste() const; 1135 %Docstring 1136 CanPaste() -> bool 1137 1138 Returns true if the clipboard content can be pasted to the buffer. 1139 %End 1140 1141 bool CanDeleteSelection() const; 1142 %Docstring 1143 CanDeleteSelection() -> bool 1144 1145 Returns true if selected content can be deleted. 1146 %End 1147 1148 virtual 1149 void Undo(); 1150 %Docstring 1151 Undo() 1152 1153 Undoes the command at the top of the command history, if there is one. 1154 %End 1155 1156 virtual 1157 void Redo(); 1158 %Docstring 1159 Redo() 1160 1161 Redoes the current command. 1162 %End 1163 1164 virtual 1165 bool CanUndo() const; 1166 %Docstring 1167 CanUndo() -> bool 1168 1169 Returns true if there is a command in the command history that can be 1170 undone. 1171 %End 1172 1173 virtual 1174 bool CanRedo() const; 1175 %Docstring 1176 CanRedo() -> bool 1177 1178 Returns true if there is a command in the command history that can be 1179 redone. 1180 %End 1181 1182 void SetInsertionPoint( 1183 long pos 1184 ); 1185 %Docstring 1186 SetInsertionPoint(pos) 1187 1188 Sets the insertion point and causes the current editing style to be 1189 taken from the new position (unlike wxRichTextCtrl::SetCaretPosition). 1190 %End 1191 1192 void SetInsertionPointEnd(); 1193 %Docstring 1194 SetInsertionPointEnd() 1195 1196 Sets the insertion point to the end of the text control. 1197 %End 1198 1199 long GetInsertionPoint() const; 1200 %Docstring 1201 GetInsertionPoint() -> long 1202 1203 Returns the current insertion point. 1204 %End 1205 1206 wxTextPos GetLastPosition() const; 1207 %Docstring 1208 GetLastPosition() -> TextPos 1209 1210 Returns the last position in the buffer. 1211 %End 1212 1213 void SelectAll(); 1214 %Docstring 1215 SelectAll() 1216 1217 Selects all the text in the buffer. 1218 %End 1219 1220 void SetEditable( 1221 bool editable 1222 ); 1223 %Docstring 1224 SetEditable(editable) 1225 1226 Makes the control editable, or not. 1227 %End 1228 1229 bool HasSelection() const; 1230 %Docstring 1231 HasSelection() -> bool 1232 1233 Returns true if there is a selection and the object containing the 1234 selection was the same as the current focus object. 1235 %End 1236 1237 bool HasUnfocusedSelection() const; 1238 %Docstring 1239 HasUnfocusedSelection() -> bool 1240 1241 Returns true if there was a selection, whether or not the current 1242 focus object is the same as the selection's container object. 1243 %End 1244 1245 wxRichTextBox * WriteTextBox( 1246 const wxRichTextAttr & textAttr = wxRichTextAttr() 1247 ); 1248 %Docstring 1249 WriteTextBox(textAttr=RichTextAttr()) -> RichTextBox 1250 1251 Write a text box at the current insertion point, returning the text 1252 box. 1253 %End 1254 1255 wxRichTextField * WriteField( 1256 const wxString & fieldType, 1257 const wxRichTextProperties & properties, 1258 const wxRichTextAttr & textAttr = wxRichTextAttr() 1259 ); 1260 %Docstring 1261 WriteField(fieldType, properties, textAttr=RichTextAttr()) -> RichTextField 1262 1263 Writes a field at the current insertion point. 1264 %End 1265 1266 wxRichTextTable * WriteTable( 1267 int rows, 1268 int cols, 1269 const wxRichTextAttr & tableAttr = wxRichTextAttr(), 1270 const wxRichTextAttr & cellAttr = wxRichTextAttr() 1271 ); 1272 %Docstring 1273 WriteTable(rows, cols, tableAttr=RichTextAttr(), cellAttr=RichTextAttr()) -> RichTextTable 1274 1275 Write a table at the current insertion point, returning the table. 1276 %End 1277 1278 bool Newline(); 1279 %Docstring 1280 Newline() -> bool 1281 1282 Inserts a new paragraph at the current insertion point. 1283 %End 1284 1285 bool LineBreak(); 1286 %Docstring 1287 LineBreak() -> bool 1288 1289 Inserts a line break at the current insertion point. 1290 %End 1291 1292 void SetBasicStyle( 1293 const wxRichTextAttr & style 1294 ); 1295 %Docstring 1296 SetBasicStyle(style) 1297 1298 Sets the basic (overall) style. 1299 %End 1300 1301 const wxRichTextAttr & GetBasicStyle() const; 1302 %Docstring 1303 GetBasicStyle() -> RichTextAttr 1304 1305 Gets the basic (overall) style. 1306 %End 1307 1308 bool BeginStyle( 1309 const wxRichTextAttr & style 1310 ); 1311 %Docstring 1312 BeginStyle(style) -> bool 1313 1314 Begins applying a style. 1315 %End 1316 1317 bool EndStyle(); 1318 %Docstring 1319 EndStyle() -> bool 1320 1321 Ends the current style. 1322 %End 1323 1324 bool EndAllStyles(); 1325 %Docstring 1326 EndAllStyles() -> bool 1327 1328 Ends application of all styles in the current style stack. 1329 %End 1330 1331 bool BeginBold(); 1332 %Docstring 1333 BeginBold() -> bool 1334 1335 Begins using bold. 1336 %End 1337 1338 bool EndBold(); 1339 %Docstring 1340 EndBold() -> bool 1341 1342 Ends using bold. 1343 %End 1344 1345 bool BeginItalic(); 1346 %Docstring 1347 BeginItalic() -> bool 1348 1349 Begins using italic. 1350 %End 1351 1352 bool EndItalic(); 1353 %Docstring 1354 EndItalic() -> bool 1355 1356 Ends using italic. 1357 %End 1358 1359 bool BeginUnderline(); 1360 %Docstring 1361 BeginUnderline() -> bool 1362 1363 Begins using underlining. 1364 %End 1365 1366 bool EndUnderline(); 1367 %Docstring 1368 EndUnderline() -> bool 1369 1370 End applying underlining. 1371 %End 1372 1373 bool BeginFontSize( 1374 int pointSize 1375 ); 1376 %Docstring 1377 BeginFontSize(pointSize) -> bool 1378 1379 Begins using the given point size. 1380 %End 1381 1382 bool EndFontSize(); 1383 %Docstring 1384 EndFontSize() -> bool 1385 1386 Ends using a point size. 1387 %End 1388 1389 bool BeginFont( 1390 const wxFont & font 1391 ); 1392 %Docstring 1393 BeginFont(font) -> bool 1394 1395 Begins using this font. 1396 %End 1397 1398 bool EndFont(); 1399 %Docstring 1400 EndFont() -> bool 1401 1402 Ends using a font. 1403 %End 1404 1405 bool BeginTextColour( 1406 const wxColour & colour 1407 ); 1408 %Docstring 1409 BeginTextColour(colour) -> bool 1410 1411 Begins using this colour. 1412 %End 1413 1414 bool EndTextColour(); 1415 %Docstring 1416 EndTextColour() -> bool 1417 1418 Ends applying a text colour. 1419 %End 1420 1421 bool BeginAlignment( 1422 wxTextAttrAlignment alignment 1423 ); 1424 %Docstring 1425 BeginAlignment(alignment) -> bool 1426 1427 Begins using alignment. 1428 %End 1429 1430 bool EndAlignment(); 1431 %Docstring 1432 EndAlignment() -> bool 1433 1434 Ends alignment. 1435 %End 1436 1437 bool BeginLeftIndent( 1438 int leftIndent, 1439 int leftSubIndent = 0 1440 ); 1441 %Docstring 1442 BeginLeftIndent(leftIndent, leftSubIndent=0) -> bool 1443 1444 Begins applying a left indent and subindent in tenths of a millimetre. 1445 %End 1446 1447 bool EndLeftIndent(); 1448 %Docstring 1449 EndLeftIndent() -> bool 1450 1451 Ends left indent. 1452 %End 1453 1454 bool BeginRightIndent( 1455 int rightIndent 1456 ); 1457 %Docstring 1458 BeginRightIndent(rightIndent) -> bool 1459 1460 Begins a right indent, specified in tenths of a millimetre. 1461 %End 1462 1463 bool EndRightIndent(); 1464 %Docstring 1465 EndRightIndent() -> bool 1466 1467 Ends right indent. 1468 %End 1469 1470 bool BeginParagraphSpacing( 1471 int before, 1472 int after 1473 ); 1474 %Docstring 1475 BeginParagraphSpacing(before, after) -> bool 1476 1477 Begins paragraph spacing; pass the before-paragraph and after- 1478 paragraph spacing in tenths of a millimetre. 1479 %End 1480 1481 bool EndParagraphSpacing(); 1482 %Docstring 1483 EndParagraphSpacing() -> bool 1484 1485 Ends paragraph spacing. 1486 %End 1487 1488 bool BeginLineSpacing( 1489 int lineSpacing 1490 ); 1491 %Docstring 1492 BeginLineSpacing(lineSpacing) -> bool 1493 1494 Begins appling line spacing. 1495 %End 1496 1497 bool EndLineSpacing(); 1498 %Docstring 1499 EndLineSpacing() -> bool 1500 1501 Ends line spacing. 1502 %End 1503 1504 bool BeginNumberedBullet( 1505 int bulletNumber, 1506 int leftIndent, 1507 int leftSubIndent, 1508 int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD 1509 ); 1510 %Docstring 1511 BeginNumberedBullet(bulletNumber, leftIndent, leftSubIndent, bulletStyle=wx.TEXT_ATTR_BULLET_STYLE_ARABIC|wx.TEXT_ATTR_BULLET_STYLE_PERIOD) -> bool 1512 1513 Begins a numbered bullet. 1514 %End 1515 1516 bool EndNumberedBullet(); 1517 %Docstring 1518 EndNumberedBullet() -> bool 1519 1520 Ends application of a numbered bullet. 1521 %End 1522 1523 bool BeginSymbolBullet( 1524 const wxString & symbol, 1525 int leftIndent, 1526 int leftSubIndent, 1527 int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL 1528 ); 1529 %Docstring 1530 BeginSymbolBullet(symbol, leftIndent, leftSubIndent, bulletStyle=wx.TEXT_ATTR_BULLET_STYLE_SYMBOL) -> bool 1531 1532 Begins applying a symbol bullet, using a character from the current 1533 font. 1534 %End 1535 1536 bool EndSymbolBullet(); 1537 %Docstring 1538 EndSymbolBullet() -> bool 1539 1540 Ends applying a symbol bullet. 1541 %End 1542 1543 bool BeginStandardBullet( 1544 const wxString & bulletName, 1545 int leftIndent, 1546 int leftSubIndent, 1547 int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD 1548 ); 1549 %Docstring 1550 BeginStandardBullet(bulletName, leftIndent, leftSubIndent, bulletStyle=wx.TEXT_ATTR_BULLET_STYLE_STANDARD) -> bool 1551 1552 Begins applying a symbol bullet. 1553 %End 1554 1555 bool EndStandardBullet(); 1556 %Docstring 1557 EndStandardBullet() -> bool 1558 1559 Begins applying a standard bullet. 1560 %End 1561 1562 bool BeginCharacterStyle( 1563 const wxString & characterStyle 1564 ); 1565 %Docstring 1566 BeginCharacterStyle(characterStyle) -> bool 1567 1568 Begins using the named character style. 1569 %End 1570 1571 bool EndCharacterStyle(); 1572 %Docstring 1573 EndCharacterStyle() -> bool 1574 1575 Ends application of a named character style. 1576 %End 1577 1578 bool BeginParagraphStyle( 1579 const wxString & paragraphStyle 1580 ); 1581 %Docstring 1582 BeginParagraphStyle(paragraphStyle) -> bool 1583 1584 Begins applying the named paragraph style. 1585 %End 1586 1587 bool EndParagraphStyle(); 1588 %Docstring 1589 EndParagraphStyle() -> bool 1590 1591 Ends application of a named paragraph style. 1592 %End 1593 1594 bool BeginListStyle( 1595 const wxString & listStyle, 1596 int level = 1, 1597 int number = 1 1598 ); 1599 %Docstring 1600 BeginListStyle(listStyle, level=1, number=1) -> bool 1601 1602 Begins using a specified list style. 1603 %End 1604 1605 bool EndListStyle(); 1606 %Docstring 1607 EndListStyle() -> bool 1608 1609 Ends using a specified list style. 1610 %End 1611 1612 bool BeginURL( 1613 const wxString & url, 1614 const wxString & characterStyle = wxEmptyString 1615 ); 1616 %Docstring 1617 BeginURL(url, characterStyle=wx.EmptyString) -> bool 1618 1619 Begins applying wxTEXT_ATTR_URL to the content. 1620 %End 1621 1622 bool EndURL(); 1623 %Docstring 1624 EndURL() -> bool 1625 1626 Ends applying a URL. 1627 %End 1628 1629 bool SetDefaultStyleToCursorStyle(); 1630 %Docstring 1631 SetDefaultStyleToCursorStyle() -> bool 1632 1633 Sets the default style to the style under the cursor. 1634 %End 1635 1636 void SelectNone(); 1637 %Docstring 1638 SelectNone() 1639 1640 Cancels any selection. 1641 %End 1642 1643 bool SelectWord( 1644 long position 1645 ); 1646 %Docstring 1647 SelectWord(position) -> bool 1648 1649 Selects the word at the given character position. 1650 %End 1651 1652 wxRichTextRange GetSelectionRange() const; 1653 %Docstring 1654 GetSelectionRange() -> RichTextRange 1655 1656 Returns the selection range in character positions. 1657 %End 1658 1659 void SetSelectionRange( 1660 const wxRichTextRange & range 1661 ); 1662 %Docstring 1663 SetSelectionRange(range) 1664 1665 Sets the selection to the given range. 1666 %End 1667 1668 wxRichTextRange GetInternalSelectionRange() const; 1669 %Docstring 1670 GetInternalSelectionRange() -> RichTextRange 1671 1672 Returns the selection range in character positions. 1673 %End 1674 1675 void SetInternalSelectionRange( 1676 const wxRichTextRange & range 1677 ); 1678 %Docstring 1679 SetInternalSelectionRange(range) 1680 1681 Sets the selection range in character positions. 1682 %End 1683 1684 wxRichTextRange AddParagraph( 1685 const wxString & text 1686 ); 1687 %Docstring 1688 AddParagraph(text) -> RichTextRange 1689 1690 Adds a new paragraph of text to the end of the buffer. 1691 %End 1692 1693 wxRichTextRange AddImage( 1694 const wxImage & image 1695 ); 1696 %Docstring 1697 AddImage(image) -> RichTextRange 1698 1699 Adds an image to the control's buffer. 1700 %End 1701 1702 bool LayoutContent( 1703 bool onlyVisibleRect = false 1704 ); 1705 %Docstring 1706 LayoutContent(onlyVisibleRect=False) -> bool 1707 1708 Lays out the buffer, which must be done before certain operations, 1709 such as setting the caret position. 1710 %End 1711 1712 bool MoveCaret( 1713 long pos, 1714 bool showAtLineStart = false, 1715 wxRichTextParagraphLayoutBox * container = NULL 1716 ); 1717 %Docstring 1718 MoveCaret(pos, showAtLineStart=False, container=None) -> bool 1719 1720 Move the caret to the given character position. 1721 %End 1722 1723 bool MoveRight( 1724 int noPositions = 1, 1725 int flags = 0 1726 ); 1727 %Docstring 1728 MoveRight(noPositions=1, flags=0) -> bool 1729 1730 Moves right. 1731 %End 1732 1733 bool MoveLeft( 1734 int noPositions = 1, 1735 int flags = 0 1736 ); 1737 %Docstring 1738 MoveLeft(noPositions=1, flags=0) -> bool 1739 1740 Moves left. 1741 %End 1742 1743 bool MoveUp( 1744 int noLines = 1, 1745 int flags = 0 1746 ); 1747 %Docstring 1748 MoveUp(noLines=1, flags=0) -> bool 1749 1750 Moves to the start of the paragraph. 1751 %End 1752 1753 bool MoveDown( 1754 int noLines = 1, 1755 int flags = 0 1756 ); 1757 %Docstring 1758 MoveDown(noLines=1, flags=0) -> bool 1759 1760 Moves the caret down. 1761 %End 1762 1763 bool MoveToLineEnd( 1764 int flags = 0 1765 ); 1766 %Docstring 1767 MoveToLineEnd(flags=0) -> bool 1768 1769 Moves to the end of the line. 1770 %End 1771 1772 bool MoveToLineStart( 1773 int flags = 0 1774 ); 1775 %Docstring 1776 MoveToLineStart(flags=0) -> bool 1777 1778 Moves to the start of the line. 1779 %End 1780 1781 bool MoveToParagraphEnd( 1782 int flags = 0 1783 ); 1784 %Docstring 1785 MoveToParagraphEnd(flags=0) -> bool 1786 1787 Moves to the end of the paragraph. 1788 %End 1789 1790 bool MoveToParagraphStart( 1791 int flags = 0 1792 ); 1793 %Docstring 1794 MoveToParagraphStart(flags=0) -> bool 1795 1796 Moves to the start of the paragraph. 1797 %End 1798 1799 bool MoveHome( 1800 int flags = 0 1801 ); 1802 %Docstring 1803 MoveHome(flags=0) -> bool 1804 1805 Moves to the start of the buffer. 1806 %End 1807 1808 bool MoveEnd( 1809 int flags = 0 1810 ); 1811 %Docstring 1812 MoveEnd(flags=0) -> bool 1813 1814 Moves to the end of the buffer. 1815 %End 1816 1817 bool PageUp( 1818 int noPages = 1, 1819 int flags = 0 1820 ); 1821 %Docstring 1822 PageUp(noPages=1, flags=0) -> bool 1823 1824 Moves one or more pages up. 1825 %End 1826 1827 bool PageDown( 1828 int noPages = 1, 1829 int flags = 0 1830 ); 1831 %Docstring 1832 PageDown(noPages=1, flags=0) -> bool 1833 1834 Moves one or more pages down. 1835 %End 1836 1837 bool WordLeft( 1838 int noPages = 1, 1839 int flags = 0 1840 ); 1841 %Docstring 1842 WordLeft(noPages=1, flags=0) -> bool 1843 1844 Moves a number of words to the left. 1845 %End 1846 1847 bool WordRight( 1848 int noPages = 1, 1849 int flags = 0 1850 ); 1851 %Docstring 1852 WordRight(noPages=1, flags=0) -> bool 1853 1854 Move a nuber of words to the right. 1855 %End 1856 1857 bool BeginBatchUndo( 1858 const wxString & cmdName 1859 ); 1860 %Docstring 1861 BeginBatchUndo(cmdName) -> bool 1862 1863 Starts batching undo history for commands. 1864 %End 1865 1866 bool EndBatchUndo(); 1867 %Docstring 1868 EndBatchUndo() -> bool 1869 1870 Ends batching undo command history. 1871 %End 1872 1873 bool BatchingUndo() const; 1874 %Docstring 1875 BatchingUndo() -> bool 1876 1877 Returns true if undo commands are being batched. 1878 %End 1879 1880 bool BeginSuppressUndo(); 1881 %Docstring 1882 BeginSuppressUndo() -> bool 1883 1884 Starts suppressing undo history for commands. 1885 %End 1886 1887 bool EndSuppressUndo(); 1888 %Docstring 1889 EndSuppressUndo() -> bool 1890 1891 Ends suppressing undo command history. 1892 %End 1893 1894 bool SuppressingUndo() const; 1895 %Docstring 1896 SuppressingUndo() -> bool 1897 1898 Returns true if undo history suppression is on. 1899 %End 1900 1901 bool HasCharacterAttributes( 1902 const wxRichTextRange & range, 1903 const wxRichTextAttr & style 1904 ) const; 1905 %Docstring 1906 HasCharacterAttributes(range, style) -> bool 1907 1908 Test if this whole range has character attributes of the specified 1909 kind. 1910 %End 1911 1912 bool HasParagraphAttributes( 1913 const wxRichTextRange & range, 1914 const wxRichTextAttr & style 1915 ) const; 1916 %Docstring 1917 HasParagraphAttributes(range, style) -> bool 1918 1919 Test if this whole range has paragraph attributes of the specified 1920 kind. 1921 %End 1922 1923 bool IsSelectionBold(); 1924 %Docstring 1925 IsSelectionBold() -> bool 1926 1927 Returns true if all of the selection, or the content at the caret 1928 position, is bold. 1929 %End 1930 1931 bool IsSelectionItalics(); 1932 %Docstring 1933 IsSelectionItalics() -> bool 1934 1935 Returns true if all of the selection, or the content at the caret 1936 position, is italic. 1937 %End 1938 1939 bool IsSelectionUnderlined(); 1940 %Docstring 1941 IsSelectionUnderlined() -> bool 1942 1943 Returns true if all of the selection, or the content at the caret 1944 position, is underlined. 1945 %End 1946 1947 bool DoesSelectionHaveTextEffectFlag( 1948 int flag 1949 ); 1950 %Docstring 1951 DoesSelectionHaveTextEffectFlag(flag) -> bool 1952 1953 Returns true if all of the selection, or the content at the current 1954 caret position, has the supplied wxTextAttrEffects flag(s). 1955 %End 1956 1957 bool IsSelectionAligned( 1958 wxTextAttrAlignment alignment 1959 ); 1960 %Docstring 1961 IsSelectionAligned(alignment) -> bool 1962 1963 Returns true if all of the selection is aligned according to the 1964 specified flag. 1965 %End 1966 1967 bool ApplyBoldToSelection(); 1968 %Docstring 1969 ApplyBoldToSelection() -> bool 1970 1971 Apples bold to the selection or the default style (undoable). 1972 %End 1973 1974 bool ApplyItalicToSelection(); 1975 %Docstring 1976 ApplyItalicToSelection() -> bool 1977 1978 Applies italic to the selection or the default style (undoable). 1979 %End 1980 1981 bool ApplyUnderlineToSelection(); 1982 %Docstring 1983 ApplyUnderlineToSelection() -> bool 1984 1985 Applies underline to the selection or the default style (undoable). 1986 %End 1987 1988 bool ApplyTextEffectToSelection( 1989 int flags 1990 ); 1991 %Docstring 1992 ApplyTextEffectToSelection(flags) -> bool 1993 1994 Applies one or more wxTextAttrEffects flags to the selection 1995 (undoable). 1996 %End 1997 1998 bool ApplyAlignmentToSelection( 1999 wxTextAttrAlignment alignment 2000 ); 2001 %Docstring 2002 ApplyAlignmentToSelection(alignment) -> bool 2003 2004 Applies the given alignment to the selection or the default style 2005 (undoable). 2006 %End 2007 2008 bool ApplyStyle( 2009 wxRichTextStyleDefinition * styleDef 2010 ); 2011 %Docstring 2012 ApplyStyle(styleDef) -> bool 2013 2014 Applies the style sheet to the buffer, matching paragraph styles in 2015 the sheet against named styles in the buffer. 2016 %End 2017 2018 void SetStyleSheet( 2019 wxRichTextStyleSheet * styleSheet 2020 ); 2021 %Docstring 2022 SetStyleSheet(styleSheet) 2023 2024 Sets the style sheet associated with the control. 2025 %End 2026 2027 wxRichTextStyleSheet * GetStyleSheet() const; 2028 %Docstring 2029 GetStyleSheet() -> RichTextStyleSheet 2030 2031 Returns the style sheet associated with the control, if any. 2032 %End 2033 2034 bool PushStyleSheet( 2035 wxRichTextStyleSheet * styleSheet 2036 ); 2037 %Docstring 2038 PushStyleSheet(styleSheet) -> bool 2039 2040 Push the style sheet to top of stack. 2041 %End 2042 2043 wxRichTextStyleSheet * PopStyleSheet(); 2044 %Docstring 2045 PopStyleSheet() -> RichTextStyleSheet 2046 2047 Pops the style sheet from top of stack. 2048 %End 2049 2050 bool ApplyStyleSheet( 2051 wxRichTextStyleSheet * styleSheet = NULL 2052 ); 2053 %Docstring 2054 ApplyStyleSheet(styleSheet=None) -> bool 2055 2056 Applies the style sheet to the buffer, for example if the styles have 2057 changed. 2058 %End 2059 2060 bool ShowContextMenu( 2061 wxMenu * menu, 2062 const wxPoint & pt, 2063 bool addPropertyCommands 2064 ); 2065 %Docstring 2066 ShowContextMenu(menu, pt, addPropertyCommands) -> bool 2067 2068 Shows the given context menu, optionally adding appropriate property- 2069 editing commands for the current position in the object hierarchy. 2070 %End 2071 2072 int PrepareContextMenu( 2073 wxMenu * menu, 2074 const wxPoint & pt, 2075 bool addPropertyCommands 2076 ); 2077 %Docstring 2078 PrepareContextMenu(menu, pt, addPropertyCommands) -> int 2079 2080 Prepares the context menu, optionally adding appropriate property- 2081 editing commands. 2082 %End 2083 2084 bool CanEditProperties( 2085 wxRichTextObject * obj 2086 ) const; 2087 %Docstring 2088 CanEditProperties(obj) -> bool 2089 2090 Returns true if we can edit the object's properties via a GUI. 2091 %End 2092 2093 bool EditProperties( 2094 wxRichTextObject * obj, 2095 wxWindow * parent 2096 ); 2097 %Docstring 2098 EditProperties(obj, parent) -> bool 2099 2100 Edits the object's properties via a GUI. 2101 %End 2102 2103 wxString GetPropertiesMenuLabel( 2104 wxRichTextObject * obj 2105 ); 2106 %Docstring 2107 GetPropertiesMenuLabel(obj) -> String 2108 2109 Gets the object's properties menu label. 2110 %End 2111 2112 void PrepareContent( 2113 wxRichTextParagraphLayoutBox & container 2114 ); 2115 %Docstring 2116 PrepareContent(container) 2117 2118 Prepares the content just before insertion (or after buffer reset). 2119 %End 2120 2121 bool CanDeleteRange( 2122 wxRichTextParagraphLayoutBox & container, 2123 const wxRichTextRange & range 2124 ) const; 2125 %Docstring 2126 CanDeleteRange(container, range) -> bool 2127 2128 Can we delete this range? Sends an event to the control. 2129 %End 2130 2131 bool CanInsertContent( 2132 wxRichTextParagraphLayoutBox & container, 2133 long pos 2134 ) const; 2135 %Docstring 2136 CanInsertContent(container, pos) -> bool 2137 2138 Can we insert content at this position? Sends an event to the control. 2139 %End 2140 2141 void EnableVerticalScrollbar( 2142 bool enable 2143 ); 2144 %Docstring 2145 EnableVerticalScrollbar(enable) 2146 2147 Enable or disable the vertical scrollbar. 2148 %End 2149 2150 bool GetVerticalScrollbarEnabled() const; 2151 %Docstring 2152 GetVerticalScrollbarEnabled() -> bool 2153 2154 Returns true if the vertical scrollbar is enabled. 2155 %End 2156 2157 void SetFontScale( 2158 double fontScale, 2159 bool refresh = false 2160 ); 2161 %Docstring 2162 SetFontScale(fontScale, refresh=False) 2163 2164 Sets the scale factor for displaying fonts, for example for more 2165 comfortable editing. 2166 %End 2167 2168 double GetFontScale() const; 2169 %Docstring 2170 GetFontScale() -> double 2171 2172 Returns the scale factor for displaying fonts, for example for more 2173 comfortable editing. 2174 %End 2175 2176 void SetDimensionScale( 2177 double dimScale, 2178 bool refresh = false 2179 ); 2180 %Docstring 2181 SetDimensionScale(dimScale, refresh=False) 2182 2183 Sets the scale factor for displaying certain dimensions such as 2184 indentation and inter-paragraph spacing. 2185 %End 2186 2187 double GetDimensionScale() const; 2188 %Docstring 2189 GetDimensionScale() -> double 2190 2191 Returns the scale factor for displaying certain dimensions such as 2192 indentation and inter-paragraph spacing. 2193 %End 2194 2195 void SetScale( 2196 double scale, 2197 bool refresh = false 2198 ); 2199 %Docstring 2200 SetScale(scale, refresh=False) 2201 2202 Sets an overall scale factor for displaying and editing the content. 2203 %End 2204 2205 double GetScale() const; 2206 %Docstring 2207 GetScale() -> double 2208 2209 Returns an overall scale factor for displaying and editing the 2210 content. 2211 %End 2212 2213 wxPoint GetUnscaledPoint( 2214 const wxPoint & pt 2215 ) const; 2216 %Docstring 2217 GetUnscaledPoint(pt) -> wx.Point 2218 2219 Returns an unscaled point. 2220 %End 2221 2222 wxPoint GetScaledPoint( 2223 const wxPoint & pt 2224 ) const; 2225 %Docstring 2226 GetScaledPoint(pt) -> wx.Point 2227 2228 Returns a scaled point. 2229 %End 2230 2231 wxSize GetUnscaledSize( 2232 const wxSize & sz 2233 ) const; 2234 %Docstring 2235 GetUnscaledSize(sz) -> wx.Size 2236 2237 Returns an unscaled size. 2238 %End 2239 2240 wxSize GetScaledSize( 2241 const wxSize & sz 2242 ) const; 2243 %Docstring 2244 GetScaledSize(sz) -> wx.Size 2245 2246 Returns a scaled size. 2247 %End 2248 2249 wxRect GetUnscaledRect( 2250 const wxRect & rect 2251 ) const; 2252 %Docstring 2253 GetUnscaledRect(rect) -> wx.Rect 2254 2255 Returns an unscaled rectangle. 2256 %End 2257 2258 wxRect GetScaledRect( 2259 const wxRect & rect 2260 ) const; 2261 %Docstring 2262 GetScaledRect(rect) -> wx.Rect 2263 2264 Returns a scaled rectangle. 2265 %End 2266 2267 bool GetVirtualAttributesEnabled() const; 2268 %Docstring 2269 GetVirtualAttributesEnabled() -> bool 2270 2271 Returns true if this control can use virtual attributes and virtual 2272 text. 2273 %End 2274 2275 void EnableVirtualAttributes( 2276 bool b 2277 ); 2278 %Docstring 2279 EnableVirtualAttributes(b) 2280 2281 Pass true to let the control use virtual attributes. 2282 %End 2283 2284 void Command( 2285 wxCommandEvent & event 2286 ); 2287 %Docstring 2288 Command(event) 2289 2290 Sends the event to the control. 2291 %End 2292 2293 void OnDropFiles( 2294 wxDropFilesEvent & event 2295 ); 2296 %Docstring 2297 OnDropFiles(event) 2298 2299 Loads the first dropped file. 2300 %End 2301 2302 void OnCaptureLost( 2303 wxMouseCaptureLostEvent & event 2304 ); 2305 %Docstring 2306 OnCaptureLost(event) 2307 %End 2308 2309 void OnSysColourChanged( 2310 wxSysColourChangedEvent & event 2311 ); 2312 %Docstring 2313 OnSysColourChanged(event) 2314 %End 2315 2316 void OnCut( 2317 wxCommandEvent & event 2318 ); 2319 %Docstring 2320 OnCut(event) 2321 2322 Standard handler for the wxID_CUT command. 2323 %End 2324 2325 void OnCopy( 2326 wxCommandEvent & event 2327 ); 2328 %Docstring 2329 OnCopy(event) 2330 2331 Standard handler for the wxID_COPY command. 2332 %End 2333 2334 void OnPaste( 2335 wxCommandEvent & event 2336 ); 2337 %Docstring 2338 OnPaste(event) 2339 2340 Standard handler for the wxID_PASTE command. 2341 %End 2342 2343 void OnUndo( 2344 wxCommandEvent & event 2345 ); 2346 %Docstring 2347 OnUndo(event) 2348 2349 Standard handler for the wxID_UNDO command. 2350 %End 2351 2352 void OnRedo( 2353 wxCommandEvent & event 2354 ); 2355 %Docstring 2356 OnRedo(event) 2357 2358 Standard handler for the wxID_REDO command. 2359 %End 2360 2361 void OnSelectAll( 2362 wxCommandEvent & event 2363 ); 2364 %Docstring 2365 OnSelectAll(event) 2366 2367 Standard handler for the wxID_SELECTALL command. 2368 %End 2369 2370 void OnProperties( 2371 wxCommandEvent & event 2372 ); 2373 %Docstring 2374 OnProperties(event) 2375 2376 Standard handler for property commands. 2377 %End 2378 2379 void OnClear( 2380 wxCommandEvent & event 2381 ); 2382 %Docstring 2383 OnClear(event) 2384 2385 Standard handler for the wxID_CLEAR command. 2386 %End 2387 2388 void OnUpdateCut( 2389 wxUpdateUIEvent & event 2390 ); 2391 %Docstring 2392 OnUpdateCut(event) 2393 2394 Standard update handler for the wxID_CUT command. 2395 %End 2396 2397 void OnUpdateCopy( 2398 wxUpdateUIEvent & event 2399 ); 2400 %Docstring 2401 OnUpdateCopy(event) 2402 2403 Standard update handler for the wxID_COPY command. 2404 %End 2405 2406 void OnUpdatePaste( 2407 wxUpdateUIEvent & event 2408 ); 2409 %Docstring 2410 OnUpdatePaste(event) 2411 2412 Standard update handler for the wxID_PASTE command. 2413 %End 2414 2415 void OnUpdateUndo( 2416 wxUpdateUIEvent & event 2417 ); 2418 %Docstring 2419 OnUpdateUndo(event) 2420 2421 Standard update handler for the wxID_UNDO command. 2422 %End 2423 2424 void OnUpdateRedo( 2425 wxUpdateUIEvent & event 2426 ); 2427 %Docstring 2428 OnUpdateRedo(event) 2429 2430 Standard update handler for the wxID_REDO command. 2431 %End 2432 2433 void OnUpdateSelectAll( 2434 wxUpdateUIEvent & event 2435 ); 2436 %Docstring 2437 OnUpdateSelectAll(event) 2438 2439 Standard update handler for the wxID_SELECTALL command. 2440 %End 2441 2442 void OnUpdateProperties( 2443 wxUpdateUIEvent & event 2444 ); 2445 %Docstring 2446 OnUpdateProperties(event) 2447 2448 Standard update handler for property commands. 2449 %End 2450 2451 void OnUpdateClear( 2452 wxUpdateUIEvent & event 2453 ); 2454 %Docstring 2455 OnUpdateClear(event) 2456 2457 Standard update handler for the wxID_CLEAR command. 2458 %End 2459 2460 void OnContextMenu( 2461 wxContextMenuEvent & event 2462 ); 2463 %Docstring 2464 OnContextMenu(event) 2465 2466 Shows a standard context menu with undo, redo, cut, copy, paste, 2467 clear, and select all commands. 2468 %End 2469 2470 void OnPaint( 2471 wxPaintEvent & event 2472 ); 2473 %Docstring 2474 OnPaint(event) 2475 %End 2476 2477 void OnEraseBackground( 2478 wxEraseEvent & event 2479 ); 2480 %Docstring 2481 OnEraseBackground(event) 2482 %End 2483 2484 void OnLeftClick( 2485 wxMouseEvent & event 2486 ); 2487 %Docstring 2488 OnLeftClick(event) 2489 %End 2490 2491 void OnLeftUp( 2492 wxMouseEvent & event 2493 ); 2494 %Docstring 2495 OnLeftUp(event) 2496 %End 2497 2498 void OnMoveMouse( 2499 wxMouseEvent & event 2500 ); 2501 %Docstring 2502 OnMoveMouse(event) 2503 %End 2504 2505 void OnLeftDClick( 2506 wxMouseEvent & event 2507 ); 2508 %Docstring 2509 OnLeftDClick(event) 2510 %End 2511 2512 void OnMiddleClick( 2513 wxMouseEvent & event 2514 ); 2515 %Docstring 2516 OnMiddleClick(event) 2517 %End 2518 2519 void OnRightClick( 2520 wxMouseEvent & event 2521 ); 2522 %Docstring 2523 OnRightClick(event) 2524 %End 2525 2526 void OnChar( 2527 wxKeyEvent & event 2528 ); 2529 %Docstring 2530 OnChar(event) 2531 %End 2532 2533 void OnSize( 2534 wxSizeEvent & event 2535 ); 2536 %Docstring 2537 OnSize(event) 2538 %End 2539 2540 void OnSetFocus( 2541 wxFocusEvent & event 2542 ); 2543 %Docstring 2544 OnSetFocus(event) 2545 %End 2546 2547 void OnKillFocus( 2548 wxFocusEvent & event 2549 ); 2550 %Docstring 2551 OnKillFocus(event) 2552 %End 2553 2554 void OnIdle( 2555 wxIdleEvent & event 2556 ); 2557 %Docstring 2558 OnIdle(event) 2559 %End 2560 2561 void OnScroll( 2562 wxScrollWinEvent & event 2563 ); 2564 %Docstring 2565 OnScroll(event) 2566 %End 2567 2568 bool SetFont( 2569 const wxFont & font 2570 ); 2571 %Docstring 2572 SetFont(font) -> bool 2573 2574 Sets the font, and also the basic and default attributes (see 2575 wxRichTextCtrl::SetDefaultStyle). 2576 %End 2577 2578 void SetupScrollbars( 2579 bool atTop = false 2580 ); 2581 %Docstring 2582 SetupScrollbars(atTop=False) 2583 2584 A helper function setting up scrollbars, for example after a resize. 2585 %End 2586 2587 bool KeyboardNavigate( 2588 int keyCode, 2589 int flags 2590 ); 2591 %Docstring 2592 KeyboardNavigate(keyCode, flags) -> bool 2593 2594 Helper function implementing keyboard navigation. 2595 %End 2596 2597 void PaintBackground( 2598 wxDC & dc 2599 ); 2600 %Docstring 2601 PaintBackground(dc) 2602 2603 Paints the background. 2604 %End 2605 2606 void PaintAboveContent( 2607 wxDC & WXUNUSED 2608 ); 2609 %Docstring 2610 PaintAboveContent(WXUNUSED) 2611 2612 Other user defined painting after everything else (i.e. all text) is 2613 painted. 2614 %End 2615 2616 void DoWriteText( 2617 const wxString & value, 2618 int flags = 0 2619 ); 2620 %Docstring 2621 DoWriteText(value, flags=0) 2622 %End 2623 2624 virtual 2625 bool ShouldInheritColours() const; 2626 %Docstring 2627 ShouldInheritColours() -> bool 2628 2629 Return true from here to allow the colours of this window to be 2630 changed by InheritAttributes(). 2631 %End 2632 2633 void PositionCaret( 2634 wxRichTextParagraphLayoutBox * container = NULL 2635 ); 2636 %Docstring 2637 PositionCaret(container=None) 2638 2639 Internal function to position the visible caret according to the 2640 current caret position. 2641 %End 2642 2643 bool ExtendSelection( 2644 long oldPosition, 2645 long newPosition, 2646 int flags 2647 ); 2648 %Docstring 2649 ExtendSelection(oldPosition, newPosition, flags) -> bool 2650 2651 Helper function for extending the selection, returning true if the 2652 selection was changed. 2653 %End 2654 2655 bool ScrollIntoView( 2656 long position, 2657 int keyCode 2658 ); 2659 %Docstring 2660 ScrollIntoView(position, keyCode) -> bool 2661 2662 Scrolls position into view. 2663 %End 2664 2665 bool RefreshForSelectionChange( 2666 const wxRichTextSelection & oldSelection, 2667 const wxRichTextSelection & newSelection 2668 ); 2669 %Docstring 2670 RefreshForSelectionChange(oldSelection, newSelection) -> bool 2671 2672 Refreshes the area affected by a selection change. 2673 %End 2674 2675 void SetCaretPosition( 2676 long position, 2677 bool showAtLineStart = false 2678 ); 2679 %Docstring 2680 SetCaretPosition(position, showAtLineStart=False) 2681 2682 Sets the caret position. 2683 %End 2684 2685 long GetCaretPosition() const; 2686 %Docstring 2687 GetCaretPosition() -> long 2688 2689 Returns the current caret position. 2690 %End 2691 2692 long GetAdjustedCaretPosition( 2693 long caretPos 2694 ) const; 2695 %Docstring 2696 GetAdjustedCaretPosition(caretPos) -> long 2697 2698 The adjusted caret position is the character position adjusted to take 2699 into account whether we're at the start of a paragraph, in which case 2700 style information should be taken from the next position, not current 2701 one. 2702 %End 2703 2704 void MoveCaretForward( 2705 long oldPosition 2706 ); 2707 %Docstring 2708 MoveCaretForward(oldPosition) 2709 2710 Move the caret one visual step forward: this may mean setting a flag 2711 and keeping the same position if we're going from the end of one line 2712 to the start of the next, which may be the exact same caret position. 2713 %End 2714 2715 void MoveCaretBack( 2716 long oldPosition 2717 ); 2718 %Docstring 2719 MoveCaretBack(oldPosition) 2720 2721 Move the caret one visual step forward: this may mean setting a flag 2722 and keeping the same position if we're going from the end of one line 2723 to the start of the next, which may be the exact same caret position. 2724 %End 2725 2726 bool GetCaretPositionForIndex( 2727 long position, 2728 wxRect & rect, 2729 wxRichTextParagraphLayoutBox * container = NULL 2730 ); 2731 %Docstring 2732 GetCaretPositionForIndex(position, rect, container=None) -> bool 2733 2734 Returns the caret height and position for the given character 2735 position. 2736 %End 2737 2738 wxRichTextLine * GetVisibleLineForCaretPosition( 2739 long caretPosition 2740 ) const; 2741 %Docstring 2742 GetVisibleLineForCaretPosition(caretPosition) -> RichTextLine 2743 2744 Internal helper function returning the line for the visible caret 2745 position. 2746 %End 2747 2748 wxCommandProcessor * GetCommandProcessor() const; 2749 %Docstring 2750 GetCommandProcessor() -> wx.CommandProcessor 2751 2752 Gets the command processor associated with the control's buffer. 2753 %End 2754 2755 bool DeleteSelectedContent( 2756 long * newPos = NULL 2757 ); 2758 %Docstring 2759 DeleteSelectedContent(newPos=None) -> bool 2760 2761 Deletes content if there is a selection, e.g. 2762 %End 2763 2764 wxPoint GetPhysicalPoint( 2765 const wxPoint & ptLogical 2766 ) const; 2767 %Docstring 2768 GetPhysicalPoint(ptLogical) -> wx.Point 2769 2770 Transforms logical (unscrolled) position to physical window position. 2771 %End 2772 2773 wxPoint GetLogicalPoint( 2774 const wxPoint & ptPhysical 2775 ) const; 2776 %Docstring 2777 GetLogicalPoint(ptPhysical) -> wx.Point 2778 2779 Transforms physical window position to logical (unscrolled) position. 2780 %End 2781 2782 long FindNextWordPosition( 2783 int direction = 1 2784 ) const; 2785 %Docstring 2786 FindNextWordPosition(direction=1) -> long 2787 2788 Helper function for finding the caret position for the next word. 2789 %End 2790 2791 bool IsPositionVisible( 2792 long pos 2793 ) const; 2794 %Docstring 2795 IsPositionVisible(pos) -> bool 2796 2797 Returns true if the given position is visible on the screen. 2798 %End 2799 2800 long GetFirstVisiblePosition() const; 2801 %Docstring 2802 GetFirstVisiblePosition() -> long 2803 2804 Returns the first visible position in the current view. 2805 %End 2806 2807 long GetCaretPositionForDefaultStyle() const; 2808 %Docstring 2809 GetCaretPositionForDefaultStyle() -> long 2810 2811 Returns the caret position since the default formatting was changed. 2812 %End 2813 2814 void SetCaretPositionForDefaultStyle( 2815 long pos 2816 ); 2817 %Docstring 2818 SetCaretPositionForDefaultStyle(pos) 2819 2820 Set the caret position for the default style that the user is 2821 selecting. 2822 %End 2823 2824 bool IsDefaultStyleShowing() const; 2825 %Docstring 2826 IsDefaultStyleShowing() -> bool 2827 2828 Returns true if the user has recently set the default style without 2829 moving the caret, and therefore the UI needs to reflect the default 2830 style and not the style at the caret. 2831 %End 2832 2833 void SetAndShowDefaultStyle( 2834 const wxRichTextAttr & attr 2835 ); 2836 %Docstring 2837 SetAndShowDefaultStyle(attr) 2838 2839 Sets attr as the default style and tells the control that the UI 2840 should reflect this attribute until the user moves the caret. 2841 %End 2842 2843 wxPoint GetFirstVisiblePoint() const; 2844 %Docstring 2845 GetFirstVisiblePoint() -> wx.Point 2846 2847 Returns the first visible point in the window. 2848 %End 2849 2850 wxString GetValue() const; 2851 %Docstring 2852 GetValue() -> String 2853 2854 Returns the content of the entire control as a string. 2855 %End 2856 2857 void SetValue( 2858 const wxString & value 2859 ); 2860 %Docstring 2861 SetValue(value) 2862 2863 Replaces existing content with the given text. 2864 %End 2865 2866 bool ProcessBackKey( 2867 wxKeyEvent & event, 2868 int flags 2869 ); 2870 %Docstring 2871 ProcessBackKey(event, flags) -> bool 2872 2873 Processes the back key. 2874 %End 2875 2876 wxRichTextRange FindRangeForList( 2877 long pos, 2878 bool & isNumberedList 2879 ); 2880 %Docstring 2881 FindRangeForList(pos, isNumberedList) -> RichTextRange 2882 2883 Given a character position at which there is a list style, find the 2884 range encompassing the same list style by looking backwards and 2885 forwards. 2886 %End 2887 2888 bool SetCaretPositionAfterClick( 2889 wxRichTextParagraphLayoutBox * container, 2890 long position, 2891 int hitTestFlags, 2892 bool extendSelection = false 2893 ); 2894 %Docstring 2895 SetCaretPositionAfterClick(container, position, hitTestFlags, extendSelection=False) -> bool 2896 2897 Sets up the caret for the given position and container, after a mouse 2898 click. 2899 %End 2900 2901 long FindCaretPositionForCharacterPosition( 2902 long position, 2903 int hitTestFlags, 2904 wxRichTextParagraphLayoutBox * container, 2905 bool & caretLineStart 2906 ); 2907 %Docstring 2908 FindCaretPositionForCharacterPosition(position, hitTestFlags, container, caretLineStart) -> long 2909 2910 Find the caret position for the combination of hit-test flags and 2911 character position. 2912 %End 2913 2914 bool ProcessMouseMovement( 2915 wxRichTextParagraphLayoutBox * container, 2916 wxRichTextObject * obj, 2917 long position, 2918 const wxPoint & pos 2919 ); 2920 %Docstring 2921 ProcessMouseMovement(container, obj, position, pos) -> bool 2922 2923 Processes mouse movement in order to change the cursor. 2924 %End 2925 2926 wxString DoGetValue() const; 2927 %Docstring 2928 DoGetValue() -> String 2929 %End 2930 2931 static 2932 const wxArrayString & GetAvailableFontNames(); 2933 %Docstring 2934 GetAvailableFontNames() -> ArrayString 2935 2936 Font names take a long time to retrieve, so cache them (on demand). 2937 %End 2938 2939 static 2940 void ClearAvailableFontNames(); 2941 %Docstring 2942 ClearAvailableFontNames() 2943 2944 Clears the cache of available font names. 2945 %End 2946 2947 public: 2948 virtual wxPoint GetClientAreaOrigin() const; 2949 virtual bool Validate(); 2950 virtual bool TransferDataToWindow(); 2951 virtual bool TransferDataFromWindow(); 2952 virtual void InitDialog(); 2953 virtual bool AcceptsFocus() const; 2954 virtual bool AcceptsFocusRecursively() const; 2955 virtual bool AcceptsFocusFromKeyboard() const; 2956 virtual void AddChild( wxWindowBase *child ); 2957 virtual void RemoveChild( wxWindowBase *child ); 2958 virtual void InheritAttributes(); 2959 virtual void OnInternalIdle(); 2960 virtual wxWindow *GetMainWindowOfCompositeControl(); 2961 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 2962 virtual void SetCanFocus(bool canFocus); 2963 virtual bool Destroy(); 2964 virtual void SetValidator( const wxValidator &validator ); 2965 virtual wxValidator* GetValidator(); 2966 2967 2968 protected: 2969 virtual bool ProcessEvent(wxEvent & event); 2970 virtual void DoEnable(bool enable); 2971 virtual void DoGetPosition(int *x, int *y) const; 2972 virtual void DoGetSize(int *width, int *height) const; 2973 virtual void DoGetClientSize(int *width, int *height) const; 2974 virtual wxSize DoGetBestClientSize() const; 2975 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 2976 virtual void DoSetClientSize(int width, int height); 2977 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 2978 virtual wxSize DoGetBorderSize() const; 2979 virtual void DoMoveWindow(int x, int y, int width, int height); 2980 virtual void DoSetWindowVariant( wxWindowVariant variant); 2981 virtual wxBorder GetDefaultBorder() const; 2982 virtual wxBorder GetDefaultBorderForControl() const; 2983 virtual void DoFreeze(); 2984 virtual bool HasTransparentBackground(); 2985 virtual bool TryBefore(wxEvent& event); 2986 virtual bool TryAfter(wxEvent& event); 2987 2988 2989 public: 2990 2991 2992 static 2993 wxVisualAttributes GetClassDefaultAttributes( 2994 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 2995 ); 2996 %Docstring 2997 GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes 2998 %End 2999 %PreMethodCode 3000 if (!wxPyCheckForApp()) return NULL; 3001 %End 3002 3003 bool SetMargins( 3004 const wxPoint & pt 3005 ); 3006 %Docstring 3007 SetMargins(pt) -> bool 3008 SetMargins(left, top=-1) -> bool 3009 3010 Attempts to set the control margins. 3011 %End 3012 3013 bool SetMargins( 3014 wxCoord left, 3015 wxCoord top = -1 3016 ); 3017 3018 bool AutoComplete( 3019 const wxArrayString & choices 3020 ); 3021 %Docstring 3022 AutoComplete(choices) -> bool 3023 AutoComplete(completer) -> bool 3024 3025 Call this function to enable auto-completion of the text typed in a 3026 single-line text control using the given choices. 3027 %End 3028 3029 bool AutoComplete( 3030 wxTextCompleter * completer /Transfer/ 3031 ); 3032 3033 bool AutoCompleteFileNames(); 3034 %Docstring 3035 AutoCompleteFileNames() -> bool 3036 3037 Call this function to enable auto-completion of the text typed in a 3038 single-line text control using all valid file system paths. 3039 %End 3040 3041 bool AutoCompleteDirectories(); 3042 %Docstring 3043 AutoCompleteDirectories() -> bool 3044 3045 Call this function to enable auto-completion of the text using the 3046 file system directories. 3047 %End 3048 3049 void ChangeValue( 3050 const wxString & value 3051 ); 3052 %Docstring 3053 ChangeValue(value) 3054 3055 Sets the new text control value. 3056 %End 3057 3058 bool IsEmpty() const; 3059 %Docstring 3060 IsEmpty() -> bool 3061 3062 Returns true if the control is currently empty. 3063 %End 3064 3065 bool SetHint( 3066 const wxString & hint 3067 ); 3068 %Docstring 3069 SetHint(hint) -> bool 3070 3071 Sets a hint shown in an empty unfocused text control. 3072 %End 3073 3074 wxString GetHint() const; 3075 %Docstring 3076 GetHint() -> String 3077 3078 Returns the current hint string. 3079 %End 3080 3081 wxPoint GetMargins() const; 3082 %Docstring 3083 GetMargins() -> Point 3084 3085 Returns the margins used by the control. 3086 %End 3087 3088 public: 3089 3090 3091 %Property(name=BasicStyle, get=GetBasicStyle, set=SetBasicStyle) 3092 %Property(name=Buffer, get=GetBuffer) 3093 %Property(name=CaretAtLineStart, get=GetCaretAtLineStart, set=SetCaretAtLineStart) 3094 %Property(name=CaretPosition, get=GetCaretPosition, set=SetCaretPosition) 3095 %Property(name=CaretPositionForDefaultStyle, get=GetCaretPositionForDefaultStyle, set=SetCaretPositionForDefaultStyle) 3096 %Property(name=CommandProcessor, get=GetCommandProcessor) 3097 %Property(name=ContextMenu, get=GetContextMenu, set=SetContextMenu) 3098 %Property(name=ContextMenuPropertiesInfo, get=GetContextMenuPropertiesInfo) 3099 %Property(name=DefaultStyleEx, get=GetDefaultStyleEx) 3100 %Property(name=DelayedLayoutThreshold, get=GetDelayedLayoutThreshold, set=SetDelayedLayoutThreshold) 3101 %Property(name=DimensionScale, get=GetDimensionScale, set=SetDimensionScale) 3102 %Property(name=DragStartPoint, get=GetDragStartPoint, set=SetDragStartPoint) 3103 %Property(name=DragStartTime, get=GetDragStartTime, set=SetDragStartTime) 3104 %Property(name=Dragging, get=GetDragging, set=SetDragging) 3105 %Property(name=Filename, get=GetFilename, set=SetFilename) 3106 %Property(name=FirstVisiblePoint, get=GetFirstVisiblePoint) 3107 %Property(name=FirstVisiblePosition, get=GetFirstVisiblePosition) 3108 %Property(name=FocusObject, get=GetFocusObject, set=SetFocusObject) 3109 %Property(name=FontScale, get=GetFontScale, set=SetFontScale) 3110 %Property(name=FullLayoutRequired, get=GetFullLayoutRequired, set=SetFullLayoutRequired) 3111 %Property(name=FullLayoutSavedPosition, get=GetFullLayoutSavedPosition, set=SetFullLayoutSavedPosition) 3112 %Property(name=FullLayoutTime, get=GetFullLayoutTime, set=SetFullLayoutTime) 3113 %Property(name=HandlerFlags, get=GetHandlerFlags, set=SetHandlerFlags) 3114 %Property(name=Hint, get=GetHint, set=SetHint) 3115 %Property(name=InsertionPoint, get=GetInsertionPoint, set=SetInsertionPoint) 3116 %Property(name=InternalSelectionRange, get=GetInternalSelectionRange, set=SetInternalSelectionRange) 3117 %Property(name=LastPosition, get=GetLastPosition) 3118 %Property(name=Margins, get=GetMargins, set=SetMargins) 3119 %Property(name=NumberOfLines, get=GetNumberOfLines) 3120 %Property(name=PreDrag, get=GetPreDrag, set=SetPreDrag) 3121 %Property(name=Scale, get=GetScale, set=SetScale) 3122 %Property(name=Selection, get=GetSelection, set=SetSelection) 3123 %Property(name=SelectionAnchor, get=GetSelectionAnchor, set=SetSelectionAnchor) 3124 %Property(name=SelectionAnchorObject, get=GetSelectionAnchorObject, set=SetSelectionAnchorObject) 3125 %Property(name=SelectionRange, get=GetSelectionRange, set=SetSelectionRange) 3126 %Property(name=StringSelection, get=GetStringSelection) 3127 %Property(name=StyleSheet, get=GetStyleSheet, set=SetStyleSheet) 3128 %Property(name=TextCursor, get=GetTextCursor, set=SetTextCursor) 3129 %Property(name=URLCursor, get=GetURLCursor, set=SetURLCursor) 3130 %Property(name=Value, get=GetValue, set=SetValue) 3131 %Property(name=VerticalScrollbarEnabled, get=GetVerticalScrollbarEnabled) 3132 %Property(name=VirtualAttributesEnabled, get=GetVirtualAttributesEnabled) 3133 3134protected: 3135 virtual 3136 wxSize DoGetBestSize() const; 3137 %Docstring 3138 DoGetBestSize() -> wx.Size 3139 3140 Currently this simply returns wxSize(10, 10). 3141 %End 3142 3143 virtual 3144 void DoThaw(); 3145 %Docstring 3146 DoThaw() 3147 %End 3148 3149}; // end of class wxRichTextCtrl 3150 3151 3152%Extract(id=pycode_richtext) 3153def _RichTextCtrl_GetDefaultStyle(self): 3154 return self.GetDefaultStyleEx() 3155RichTextCtrl.GetDefaultStyle = wx.deprecated(_RichTextCtrl_GetDefaultStyle, "Use GetDefaultStyleEx instead") 3156del _RichTextCtrl_GetDefaultStyle 3157%End 3158 3159%Extract(id=pycode_richtext) 3160RichTextCtrl.DefaultStyle = property(RichTextCtrl.GetDefaultStyle, RichTextCtrl.SetDefaultStyle) 3161%End 3162 3163class wxRichTextEvent : wxNotifyEvent 3164{ 3165 %Docstring 3166 RichTextEvent(commandType=wx.wxEVT_NULL, winid=0) 3167 RichTextEvent(event) 3168 3169 This is the event class for wxRichTextCtrl notifications. 3170 %End 3171 %TypeHeaderCode 3172 #include <wx/richtext/richtextctrl.h> 3173 %End 3174 3175public: 3176 wxRichTextEvent( 3177 wxEventType commandType = wxEVT_NULL, 3178 int winid = 0 3179 ); 3180 3181 wxRichTextEvent( 3182 const wxRichTextEvent & event 3183 ); 3184 3185 long GetPosition() const; 3186 %Docstring 3187 GetPosition() -> long 3188 3189 Returns the buffer position at which the event occurred. 3190 %End 3191 3192 void SetPosition( 3193 long pos 3194 ); 3195 %Docstring 3196 SetPosition(pos) 3197 3198 Sets the buffer position variable. 3199 %End 3200 3201 int GetFlags() const; 3202 %Docstring 3203 GetFlags() -> int 3204 3205 Returns flags indicating modifier keys pressed. 3206 %End 3207 3208 void SetFlags( 3209 int flags 3210 ); 3211 %Docstring 3212 SetFlags(flags) 3213 3214 Sets flags indicating modifier keys pressed. 3215 %End 3216 3217 wxRichTextStyleSheet * GetOldStyleSheet() const; 3218 %Docstring 3219 GetOldStyleSheet() -> RichTextStyleSheet 3220 3221 Returns the old style sheet. 3222 %End 3223 3224 void SetOldStyleSheet( 3225 wxRichTextStyleSheet * sheet 3226 ); 3227 %Docstring 3228 SetOldStyleSheet(sheet) 3229 3230 Sets the old style sheet variable. 3231 %End 3232 3233 wxRichTextStyleSheet * GetNewStyleSheet() const; 3234 %Docstring 3235 GetNewStyleSheet() -> RichTextStyleSheet 3236 3237 Returns the new style sheet. 3238 %End 3239 3240 void SetNewStyleSheet( 3241 wxRichTextStyleSheet * sheet 3242 ); 3243 %Docstring 3244 SetNewStyleSheet(sheet) 3245 3246 Sets the new style sheet variable. 3247 %End 3248 3249 const wxRichTextRange & GetRange() const; 3250 %Docstring 3251 GetRange() -> RichTextRange 3252 3253 Gets the range for the current operation. 3254 %End 3255 3256 void SetRange( 3257 const wxRichTextRange & range 3258 ); 3259 %Docstring 3260 SetRange(range) 3261 3262 Sets the range variable. 3263 %End 3264 3265 wxChar GetCharacter() const; 3266 %Docstring 3267 GetCharacter() -> Char 3268 3269 Returns the character pressed, within a wxEVT_RICHTEXT_CHARACTER 3270 event. 3271 %End 3272 3273 void SetCharacter( 3274 wxChar ch 3275 ); 3276 %Docstring 3277 SetCharacter(ch) 3278 3279 Sets the character variable. 3280 %End 3281 3282 wxRichTextParagraphLayoutBox * GetContainer() const; 3283 %Docstring 3284 GetContainer() -> RichTextParagraphLayoutBox 3285 3286 Returns the container for which the event is relevant. 3287 %End 3288 3289 void SetContainer( 3290 wxRichTextParagraphLayoutBox * container 3291 ); 3292 %Docstring 3293 SetContainer(container) 3294 3295 Sets the container for which the event is relevant. 3296 %End 3297 3298 wxRichTextParagraphLayoutBox * GetOldContainer() const; 3299 %Docstring 3300 GetOldContainer() -> RichTextParagraphLayoutBox 3301 3302 Returns the old container, for a focus change event. 3303 %End 3304 3305 void SetOldContainer( 3306 wxRichTextParagraphLayoutBox * container 3307 ); 3308 %Docstring 3309 SetOldContainer(container) 3310 3311 Sets the old container, for a focus change event. 3312 %End 3313 3314 virtual 3315 wxEvent * Clone() const /Factory/; 3316 %Docstring 3317 Clone() -> wx.Event 3318 3319 Returns a copy of the event. 3320 %End 3321 3322 private: 3323 wxRichTextEvent& operator=(const wxRichTextEvent&); 3324 3325 3326 public: 3327 3328 3329 %Property(name=Character, get=GetCharacter, set=SetCharacter) 3330 %Property(name=Container, get=GetContainer, set=SetContainer) 3331 %Property(name=Flags, get=GetFlags, set=SetFlags) 3332 %Property(name=NewStyleSheet, get=GetNewStyleSheet, set=SetNewStyleSheet) 3333 %Property(name=OldContainer, get=GetOldContainer, set=SetOldContainer) 3334 %Property(name=OldStyleSheet, get=GetOldStyleSheet, set=SetOldStyleSheet) 3335 %Property(name=Position, get=GetPosition, set=SetPosition) 3336 %Property(name=Range, get=GetRange, set=SetRange) 3337}; // end of class wxRichTextEvent 3338 3339 3340%Extract(id=pycode_richtext) 3341EVT_RICHTEXT_LEFT_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_LEFT_CLICK) 3342EVT_RICHTEXT_RIGHT_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_RIGHT_CLICK) 3343EVT_RICHTEXT_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_MIDDLE_CLICK) 3344EVT_RICHTEXT_LEFT_DCLICK = wx.PyEventBinder(wxEVT_RICHTEXT_LEFT_DCLICK) 3345EVT_RICHTEXT_RETURN = wx.PyEventBinder(wxEVT_RICHTEXT_RETURN) 3346EVT_RICHTEXT_CHARACTER = wx.PyEventBinder(wxEVT_RICHTEXT_CHARACTER) 3347EVT_RICHTEXT_DELETE = wx.PyEventBinder(wxEVT_RICHTEXT_DELETE) 3348 3349EVT_RICHTEXT_STYLESHEET_CHANGING = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_CHANGING) 3350EVT_RICHTEXT_STYLESHEET_CHANGED = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_CHANGED) 3351EVT_RICHTEXT_STYLESHEET_REPLACING = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_REPLACING) 3352EVT_RICHTEXT_STYLESHEET_REPLACED = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_REPLACED) 3353 3354EVT_RICHTEXT_CONTENT_INSERTED = wx.PyEventBinder(wxEVT_RICHTEXT_CONTENT_INSERTED) 3355EVT_RICHTEXT_CONTENT_DELETED = wx.PyEventBinder(wxEVT_RICHTEXT_CONTENT_DELETED) 3356EVT_RICHTEXT_STYLE_CHANGED = wx.PyEventBinder(wxEVT_RICHTEXT_STYLE_CHANGED) 3357EVT_RICHTEXT_STYLE_CHANGED = wx.PyEventBinder(wxEVT_RICHTEXT_PROPERTIES_CHANGED) 3358EVT_RICHTEXT_SELECTION_CHANGED = wx.PyEventBinder(wxEVT_RICHTEXT_SELECTION_CHANGED) 3359EVT_RICHTEXT_BUFFER_RESET = wx.PyEventBinder(wxEVT_RICHTEXT_BUFFER_RESET) 3360EVT_RICHTEXT_FOCUS_OBJECT_CHANGED = wx.PyEventBinder(wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED) 3361 3362%End 3363 3364 3365//--------------------------------------------------------------------------- 3366 3367