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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505
|
\section{\class{wxRichTextCtrl}}\label{wxrichtextctrl}
wxRichTextCtrl provides a generic, ground-up implementation of a text control
capable of showing multiple styles and images.
wxRichTextCtrl sends notification events: see \helpref{wxRichTextEvent}{wxrichtextevent}.
It also sends the standard wxTextCtrl events wxEVT\_COMMAND\_TEXT\_ENTER and wxEVT\_COMMAND\_TEXT\_UPDATED,
and wxTextUrlEvent when URL content is clicked.
For more information, see the \helpref{wxRichTextCtrl overview}{wxrichtextctrloverview}.
\wxheading{Derived from}
wxTextCtrlBase
\wxheading{Include files}
<wx/richtext/richtextctrl.h>
\wxheading{Window styles}
\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxRE\_READONLY}}{The text will not be user-editable.}
\twocolitem{\windowstyle{wxRE\_CENTRE\_CARET}}{The control will try to keep the current caret line centred vertically.}
\twocolitem{\windowstyle{wxRE\_CENTER\_CARET}}{The same as wxRE\_CENTRE\_CARET.}
\end{twocollist}
See also \helpref{window styles overview}{windowstyles}.
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxRichTextCtrl::wxRichTextCtrl}\label{wxrichtextctrlwxrichtextctrl}
\func{}{wxRichTextCtrl}{\void}
\func{}{wxRichTextCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxString\& }{value = wxEmptyString},
\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxRE\_MULTILINE},
\param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}
Constructors.
\membersection{wxRichTextCtrl::\destruct{wxRichTextCtrl}}\label{wxrichtextctrldtor}
\func{}{\destruct{wxRichTextCtrl}}{\void}
Destructor.
\membersection{wxRichTextCtrl::AddImage}\label{wxrichtextctrladdimage}
\func{wxRichTextRange}{AddImage}{\param{const wxImage\& }{image}}
Adds an image to the control's buffer.
\membersection{wxRichTextCtrl::AddParagraph}\label{wxrichtextctrladdparagraph}
\func{wxRichTextRange}{AddParagraph}{\param{const wxString\& }{text}}
Adds a new paragraph of text to the end of the buffer.
\membersection{wxRichTextCtrl::AppendText}\label{wxrichtextctrlappendtext}
\func{void}{AppendText}{\param{const wxString\& }{text}}
Sets the insertion point to the end of the buffer and writes the text.
\membersection{wxRichTextCtrl::ApplyAlignmentToSelection}\label{wxrichtextctrlapplyalignmenttoselection}
\func{bool}{ApplyAlignmentToSelection}{\param{wxTextAttrAlignment }{alignment}}
Applies the given alignment to the selection (undoable).
For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.
\membersection{wxRichTextCtrl::ApplyBoldToSelection}\label{wxrichtextctrlapplyboldtoselection}
\func{bool}{ApplyBoldToSelection}{\void}
Apples bold to the selection (undoable).
\membersection{wxRichTextCtrl::ApplyItalicToSelection}\label{wxrichtextctrlapplyitalictoselection}
\func{bool}{ApplyItalicToSelection}{\void}
Applies italic to the selection (undoable).
\membersection{wxRichTextCtrl::ApplyStyle}\label{wxrichtextctrlapplystyle}
\func{bool}{ApplyStyle}{\param{wxRichTextStyleDefinition*}{ def}}
Applies the given style to the selection.
\membersection{wxRichTextCtrl::ApplyStyleSheet}\label{wxrichtextctrlapplystylesheet}
\func{bool}{ApplyStyleSheet}{\param{wxRichTextStyleSheet*}{ sheet $=$ NULL}}
Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles
in the buffer. This might be useful if the styles have changed. If {\it sheet} is NULL, the
sheet set with SetStyleSheet is used.
Currently this applies paragraph styles only.
\membersection{wxRichTextCtrl::ApplyUnderlineToSelection}\label{wxrichtextctrlapplyunderlinetoselection}
\func{bool}{ApplyUnderlineToSelection}{\void}
Applies underline to the selection (undoable).
\membersection{wxRichTextCtrl::BatchingUndo}\label{wxrichtextctrlbatchingundo}
\constfunc{bool}{BatchingUndo}{\void}
Returns \true if undo commands are being batched.
\membersection{wxRichTextCtrl::BeginAlignment}\label{wxrichtextctrlbeginalignment}
\func{bool}{BeginAlignment}{\param{wxTextAttrAlignment }{alignment}}
Begins using alignment
For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.
\membersection{wxRichTextCtrl::BeginBatchUndo}\label{wxrichtextctrlbeginbatchundo}
\func{bool}{BeginBatchUndo}{\param{const wxString\& }{cmdName}}
Starts batching undo history for commands.
\membersection{wxRichTextCtrl::BeginBold}\label{wxrichtextctrlbeginbold}
\func{bool}{BeginBold}{\void}
Begins using bold.
\membersection{wxRichTextCtrl::BeginCharacterStyle}\label{wxrichtextctrlbegincharacterstyle}
\func{bool}{BeginCharacterStyle}{\param{const wxString\& }{characterStyle}}
Begins using the named character style.
\membersection{wxRichTextCtrl::BeginFont}\label{wxrichtextctrlbeginfont}
\func{bool}{BeginFont}{\param{const wxFont\& }{font}}
Begins using this font.
\membersection{wxRichTextCtrl::BeginFontSize}\label{wxrichtextctrlbeginfontsize}
\func{bool}{BeginFontSize}{\param{int }{pointSize}}
Begins using the given point size.
\membersection{wxRichTextCtrl::BeginItalic}\label{wxrichtextctrlbeginitalic}
\func{bool}{BeginItalic}{\void}
Begins using italic.
\membersection{wxRichTextCtrl::BeginLeftIndent}\label{wxrichtextctrlbeginleftindent}
\func{bool}{BeginLeftIndent}{\param{int }{leftIndent}, \param{int }{leftSubIndent = 0}}
Begins applying a left indent and subindent in tenths of a millimetre.
The sub-indent is an offset from the left of the paragraph, and is used for all but the
first line in a paragraph. A positive value will cause the first line to appear to the left
of the subsequent lines, and a negative value will cause the first line to be indented
relative to the subsequent lines.
wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
the margin and the bullet. The content of the paragraph, including the first line, starts
at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
left of the actual paragraph is leftSubIndent.
\membersection{wxRichTextCtrl::BeginLineSpacing}\label{wxrichtextctrlbeginlinespacing}
\func{bool}{BeginLineSpacing}{\param{int }{lineSpacing}}
Begins appling line spacing. {\it spacing} is a multiple, where 10 means single-spacing,
15 means 1.5 spacing, and 20 means double spacing. The following constants are
defined for convenience:
{\small
\begin{verbatim}
#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
#define wxTEXT_ATTR_LINE_SPACING_HALF 15
#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
\end{verbatim}
}
\membersection{wxRichTextCtrl::BeginListStyle}\label{wxrichtextctrlbeginliststyle}
\func{bool}{BeginListStyle}{\param{const wxString\&}{ listStyle}, \param{int}{ level=1}, \param{int}{ number=1}}
Begins using a specified list style. Optionally, you can also pass a level and a number.
\membersection{wxRichTextCtrl::BeginNumberedBullet}\label{wxrichtextctrlbeginnumberedbullet}
\func{bool}{BeginNumberedBullet}{\param{int }{bulletNumber}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_ARABIC|wxTEXT\_ATTR\_BULLET\_STYLE\_PERIOD}}
Begins a numbered bullet. This call will be needed for each item in the list, and the
application should take care of incrementing the numbering.
{\it bulletNumber} is a number, usually starting with 1.
{\it leftIndent} and {\it leftSubIndent} are values in tenths of a millimetre.
{\it bulletStyle} is a bitlist of the following values:
{\small
\begin{verbatim}
#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000
#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010
#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020
#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040
#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080
#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100
#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200
#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400
#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
\end{verbatim}
}
wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
the margin and the bullet. The content of the paragraph, including the first line, starts
at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
left of the actual paragraph is leftSubIndent.
\membersection{wxRichTextCtrl::BeginParagraphSpacing}\label{wxrichtextctrlbeginparagraphspacing}
\func{bool}{BeginParagraphSpacing}{\param{int }{before}, \param{int }{after}}
Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
a millimetre.
\membersection{wxRichTextCtrl::BeginParagraphStyle}\label{wxrichtextctrlbeginparagraphstyle}
\func{bool}{BeginParagraphStyle}{\param{const wxString\& }{paragraphStyle}}
Begins applying the named paragraph style.
\membersection{wxRichTextCtrl::BeginRightIndent}\label{wxrichtextctrlbeginrightindent}
\func{bool}{BeginRightIndent}{\param{int }{rightIndent}}
Begins a right indent, specified in tenths of a millimetre.
\membersection{wxRichTextCtrl::BeginStyle}\label{wxrichtextctrlbeginstyle}
\func{bool}{BeginStyle}{\param{const wxTextAttrEx\& }{style}}
Begins applying a style.
\membersection{wxRichTextCtrl::BeginSuppressUndo}\label{wxrichtextctrlbeginsuppressundo}
\func{bool}{BeginSuppressUndo}{\void}
Starts suppressing undo history for commands.
\membersection{wxRichTextCtrl::BeginSymbolBullet}\label{wxrichtextctrlbeginsymbolbullet}
\func{bool}{BeginSymbolBullet}{\param{wxChar }{symbol}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_SYMBOL}}
Begins applying a symbol bullet, using a character from the current font. See \helpref{BeginNumberedBullet}{wxrichtextctrlbeginnumberedbullet} for
an explanation of how indentation is used to render the bulleted paragraph.
\membersection{wxRichTextCtrl::BeginTextColour}\label{wxrichtextctrlbegintextcolour}
\func{bool}{BeginTextColour}{\param{const wxColour\& }{colour}}
Begins using this colour.
\membersection{wxRichTextCtrl::BeginUnderline}\label{wxrichtextctrlbeginunderline}
\func{bool}{BeginUnderline}{\void}
Begins using underlining.
\membersection{wxRichTextCtrl::BeginURL}\label{wxrichtextctrlbeginurl}
\func{bool}{BeginURL}{\param{const wxString\&}{ url}, \param{const wxString\&}{ characterStyle = wxEmptyString}}
Begins applying wxTEXT\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,
since it is common to mark a URL with a familiar style such as blue text with underlining.
\membersection{wxRichTextCtrl::CanCopy}\label{wxrichtextctrlcancopy}
\constfunc{bool}{CanCopy}{\void}
Returns \true if selected content can be copied to the clipboard.
\membersection{wxRichTextCtrl::CanCut}\label{wxrichtextctrlcancut}
\constfunc{bool}{CanCut}{\void}
Returns \true if selected content can be copied to the clipboard and deleted.
\membersection{wxRichTextCtrl::CanDeleteSelection}\label{wxrichtextctrlcandeleteselection}
\constfunc{bool}{CanDeleteSelection}{\void}
Returns \true if selected content can be deleted.
\membersection{wxRichTextCtrl::CanPaste}\label{wxrichtextctrlcanpaste}
\constfunc{bool}{CanPaste}{\void}
Returns \true if the clipboard content can be pasted to the buffer.
\membersection{wxRichTextCtrl::CanRedo}\label{wxrichtextctrlcanredo}
\constfunc{bool}{CanRedo}{\void}
Returns \true if there is a command in the command history that can be redone.
\membersection{wxRichTextCtrl::CanUndo}\label{wxrichtextctrlcanundo}
\constfunc{bool}{CanUndo}{\void}
Returns \true if there is a command in the command history that can be undone.
\membersection{wxRichTextCtrl::Clear}\label{wxrichtextctrlclear}
\func{void}{Clear}{\void}
Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
\membersection{wxRichTextCtrl::ClearListStyle}\label{wxrichtextctrlclearliststyle}
\func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
\func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.
{\it flags} is a bit list of the following:
\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\end{itemize}
See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}.
\membersection{wxRichTextCtrl::Command}\label{wxrichtextctrlcommand}
\func{void}{Command}{\param{wxCommandEvent\& }{event}}
Sends the event to the control.
\membersection{wxRichTextCtrl::Copy}\label{wxrichtextctrlcopy}
\func{void}{Copy}{\void}
Copies the selected content (if any) to the clipboard.
\membersection{wxRichTextCtrl::Create}\label{wxrichtextctrlcreate}
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxString\& }{value = wxEmptyString},
\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxRE\_MULTILINE},
\param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}
Creates the underlying window.
\membersection{wxRichTextCtrl::Cut}\label{wxrichtextctrlcut}
\func{void}{Cut}{\void}
Copies the selected content (if any) to the clipboard and deletes the selection.
This is undoable.
\membersection{wxRichTextCtrl::Delete}\label{wxrichtextctrldelete}
\func{bool}{Delete}{\param{const wxRichTextRange\&}{ range}}
Deletes the content within the given range.
\membersection{wxRichTextCtrl::DeleteSelectedContent}\label{wxrichtextctrldeleteselectedcontent}
\func{bool}{DeleteSelectedContent}{\param{long* }{newPos = NULL}}
Deletes content if there is a selection, e.g. when pressing a key.
Returns the new caret position in {\it newPos}, or leaves it if there
was no action. This is undoable.
\membersection{wxRichTextCtrl::DeleteSelection}\label{wxrichtextctrldeleteselection}
\func{void}{DeleteSelection}{\void}
Deletes the content in the selection, if any. This is undoable.
\membersection{wxRichTextCtrl::DiscardEdits}\label{wxrichtextctrldiscardedits}
\func{void}{DiscardEdits}{\void}
Sets the buffer's modified status to \false, and clears the buffer's command history.
\membersection{wxRichTextCtrl::DoGetBestSize}\label{wxrichtextctrldogetbestsize}
\constfunc{wxSize}{DoGetBestSize}{\void}
Currently this simply returns {\tt wxSize(10, 10)}.
\membersection{wxRichTextCtrl::EndAlignment}\label{wxrichtextctrlendalignment}
\func{bool}{EndAlignment}{\void}
Ends alignment.
\membersection{wxRichTextCtrl::EndAllStyles}\label{wxrichtextctrlendallstyles}
\func{bool}{EndAllStyles}{\void}
Ends application of all styles in the current style stack.
\membersection{wxRichTextCtrl::EndBatchUndo}\label{wxrichtextctrlendbatchundo}
\func{bool}{EndBatchUndo}{\void}
Ends batching undo command history.
\membersection{wxRichTextCtrl::EndBold}\label{wxrichtextctrlendbold}
\func{bool}{EndBold}{\void}
Ends using bold.
\membersection{wxRichTextCtrl::EndCharacterStyle}\label{wxrichtextctrlendcharacterstyle}
\func{bool}{EndCharacterStyle}{\void}
Ends application of a named character style.
\membersection{wxRichTextCtrl::EndFont}\label{wxrichtextctrlendfont}
\func{bool}{EndFont}{\void}
Ends using a font.
\membersection{wxRichTextCtrl::EndFontSize}\label{wxrichtextctrlendfontsize}
\func{bool}{EndFontSize}{\void}
Ends using a point size.
\membersection{wxRichTextCtrl::EndItalic}\label{wxrichtextctrlenditalic}
\func{bool}{EndItalic}{\void}
Ends using italic.
\membersection{wxRichTextCtrl::EndLeftIndent}\label{wxrichtextctrlendleftindent}
\func{bool}{EndLeftIndent}{\void}
Ends left indent.
\membersection{wxRichTextCtrl::EndLineSpacing}\label{wxrichtextctrlendlinespacing}
\func{bool}{EndLineSpacing}{\void}
Ends line spacing.
\membersection{wxRichTextCtrl::EndListStyle}\label{wxrichtextctrlendliststyle}
\func{bool}{EndListStyle}{\void}
Ends using a specified list style.
\membersection{wxRichTextCtrl::EndNumberedBullet}\label{wxrichtextctrlendnumberedbullet}
\func{bool}{EndNumberedBullet}{\void}
Ends application of a numbered bullet.
\membersection{wxRichTextCtrl::EndParagraphSpacing}\label{wxrichtextctrlendparagraphspacing}
\func{bool}{EndParagraphSpacing}{\void}
Ends paragraph spacing.
\membersection{wxRichTextCtrl::EndParagraphStyle}\label{wxrichtextctrlendparagraphstyle}
\func{bool}{EndParagraphStyle}{\void}
Ends application of a named character style.
\membersection{wxRichTextCtrl::EndRightIndent}\label{wxrichtextctrlendrightindent}
\func{bool}{EndRightIndent}{\void}
Ends right indent.
\membersection{wxRichTextCtrl::EndStyle}\label{wxrichtextctrlendstyle}
\func{bool}{EndStyle}{\void}
Ends the current style.
\membersection{wxRichTextCtrl::EndSuppressUndo}\label{wxrichtextctrlendsuppressundo}
\func{bool}{EndSuppressUndo}{\void}
Ends suppressing undo command history.
\membersection{wxRichTextCtrl::EndSymbolBullet}\label{wxrichtextctrlendsymbolbullet}
\func{bool}{EndSymbolBullet}{\void}
Ends applying a symbol bullet.
\membersection{wxRichTextCtrl::EndTextColour}\label{wxrichtextctrlendtextcolour}
\func{bool}{EndTextColour}{\void}
Ends applying a text colour.
\membersection{wxRichTextCtrl::EndUnderline}\label{wxrichtextctrlendunderline}
\func{bool}{EndUnderline}{\void}
End applying underlining.
\membersection{wxRichTextCtrl::EndURL}\label{wxrichtextctrlendurl}
\func{bool}{EndURL}{\void}
Ends applying a URL.
\membersection{wxRichTextCtrl::ExtendSelection}\label{wxrichtextctrlextendselection}
\func{bool}{ExtendSelection}{\param{long }{oldPosition}, \param{long }{newPosition}, \param{int }{flags}}
Helper function for extending the selection, returning \true if the selection was
changed. Selections are in caret positions.
\membersection{wxRichTextCtrl::FindNextWordPosition}\label{wxrichtextctrlfindnextwordposition}
\constfunc{long}{FindNextWordPosition}{\param{int }{direction = 1}}
Helper function for finding the caret position for the next word. Direction
is 1 (forward) or -1 (backwards).
\membersection{wxRichTextCtrl::Freeze}\label{wxrichtextctrlfreeze}
\func{void}{Freeze}{\void}
Call this function to prevent refresh and allow fast updates, and then \helpref{Thaw}{wxrichtextctrlthaw} to
refresh the control.
\membersection{wxRichTextCtrl::GetBasicStyle}\label{wxrichtextctrlgetbasicstyle}
\constfunc{const wxTextAttrEx\&}{GetBasicStyle}{\void}
Gets the basic (overall) style. This is the style of the whole
buffer before further styles are applied, unlike the default style, which
only affects the style currently being applied (for example, setting the default
style to bold will cause subsequently inserted text to be bold).
\membersection{wxRichTextCtrl::GetBuffer}\label{wxrichtextctrlgetbuffer}
\constfunc{const wxRichTextBuffer\&}{GetBuffer}{\void}
\func{wxRichTextBuffer\&}{GetBuffer}{\void}
Returns the buffer associated with the control.
\membersection{wxRichTextCtrl::GetCaretPosition}\label{wxrichtextctrlgetcaretposition}
\constfunc{long}{GetCaretPosition}{\void}
Returns the current caret position.
\membersection{wxRichTextCtrl::GetCaretPositionForIndex}\label{wxrichtextctrlgetcaretpositionforindex}
\func{bool}{GetCaretPositionForIndex}{\param{long }{position}, \param{wxRect\& }{rect}}
Returns the caret height and position for the given character position
\membersection{wxRichTextCtrl::GetCommandProcessor}\label{wxrichtextctrlgetcommandprocessor}
\constfunc{wxCommandProcessor*}{GetCommandProcessor}{\void}
Gets the command processor associated with the control's buffer.
\membersection{wxRichTextCtrl::GetDefaultStyleEx}\label{wxrichtextctrlgetdefaultstyleex}
\constfunc{const wxTextAttrEx\&}{GetDefaultStyleEx}{\void}
Returns the current default style, which can be used to change how subsequently inserted
text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
will become GetDefaultStyle.
\membersection{wxRichTextCtrl::GetDelayedLayoutThreshold}\label{wxrichtextctrlgetdelayedlayoutthreshold}
\constfunc{long}{GetDelayedLayoutThreshold}{\void}
Gets the size of the buffer beyond which layout is delayed during resizing.
This optimizes sizing for large buffers. The default is 20000.
\membersection{wxRichTextCtrl::GetFilename}\label{wxrichtextctrlgetfilename}
\constfunc{wxString}{GetFilename}{\void}
Gets the current filename associated with the control.
\membersection{wxRichTextCtrl::GetFirstVisiblePosition}\label{wxrichtextctrlgetfirstvisibleposition}
\constfunc{long}{GetFirstVisiblePosition}{\void}
Returns the first visible position in the current view.
\membersection{wxRichTextCtrl::GetHandlerFlags}\label{wxrichtextfilehandlergethandlerflags}
\constfunc{int}{GetHandlerFlags}{\void}
Returns flags that change the behaviour of loading or saving. See the documentation for each
handler class to see what flags are relevant for each handler.
\membersection{wxRichTextCtrl::GetInsertionPoint}\label{wxrichtextctrlgetinsertionpoint}
\constfunc{long}{GetInsertionPoint}{\void}
Returns the current insertion point.
\membersection{wxRichTextCtrl::GetLastPosition}\label{wxrichtextctrlgetlastposition}
\constfunc{wxTextPos}{GetLastPosition}{\void}
Returns the last position in the buffer.
\membersection{wxRichTextCtrl::GetLineLength}\label{wxrichtextctrlgetlinelength}
\constfunc{int}{GetLineLength}{\param{long }{lineNo}}
Returns the length of the specified line in characters.
\membersection{wxRichTextCtrl::GetLineText}\label{wxrichtextctrlgetlinetext}
\constfunc{wxString}{GetLineText}{\param{long }{lineNo}}
Returns the text for the given line.
\membersection{wxRichTextCtrl::GetLogicalPoint}\label{wxrichtextctrlgetlogicalpoint}
\constfunc{wxPoint}{GetLogicalPoint}{\param{const wxPoint\& }{ptPhysical}}
Transforms physical window position to logical (unscrolled) position.
\membersection{wxRichTextCtrl::GetNumberOfLines}\label{wxrichtextctrlgetnumberoflines}
\constfunc{int}{GetNumberOfLines}{\void}
Returns the number of lines in the buffer.
\membersection{wxRichTextCtrl::GetPhysicalPoint}\label{wxrichtextctrlgetphysicalpoint}
\constfunc{wxPoint}{GetPhysicalPoint}{\param{const wxPoint\& }{ptLogical}}
Transforms logical (unscrolled) position to physical window position.
\membersection{wxRichTextCtrl::GetRange}\label{wxrichtextctrlgetrange}
\constfunc{wxString}{GetRange}{\param{long }{from}, \param{long }{to}}
Gets the text for the given range.
The end point of range is specified as the last character position of the span of text, plus one.
\membersection{wxRichTextCtrl::GetSelection}\label{wxrichtextctrlgetselection}
\constfunc{void}{GetSelection}{\param{long* }{from}, \param{long* }{to}}
Returns the range of the current selection.
The end point of range is specified as the last character position of the span of text, plus one.
If the return values {\it from} and {\it to} are the same, there is no selection.
\membersection{wxRichTextCtrl::GetSelectionRange}\label{wxrichtextctrlgetselectionrange}
\constfunc{const wxRichTextRange\&}{GetSelectionRange}{\void}
Returns the selection range in character positions. -1, -1 means no selection.
\membersection{wxRichTextCtrl::GetStringSelection}\label{wxrichtextctrlgetstringselection}
\constfunc{wxString}{GetStringSelection}{\void}
Returns the text within the current selection range, if any.
\membersection{wxRichTextCtrl::GetStyle}\label{wxrichtextctrlgetstyle}
\func{bool}{GetStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
\func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
\func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}
Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
because it does not use wxFont objects.
This function gets the combined style - that is, the style you see on the screen as a result
of combining base style, paragraph style and character style attributes. To get the character
or paragraph style alone, use \helpref{GetUncombinedStyle}{wxrichtextctrlgetuncombinedstyle}.
\membersection{wxRichTextCtrl::GetStyleForRange}\label{wxrichtextctrlgetstyleforrange}
\func{bool}{GetStyleForRange}{\param{const wxRichTextRange\& }{range}, \param{wxRichTextAttr\& }{style}}
\func{bool}{GetStyleForRange}{\param{const wxRichTextRange\& }{range}, \param{wxTextAttrEx\& }{style}}
Gets the attributes common to the specified range. Attributes that differ in value within the range will
not be included in {\it style}'s flags.
\membersection{wxRichTextCtrl::GetStyleSheet}\label{wxrichtextctrlgetstylesheet}
\constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
Returns the style sheet associated with the control, if any. A style sheet allows named
character and paragraph styles to be applied.
\membersection{wxRichTextCtrl::GetUncombinedStyle}\label{wxrichtextctrlgetuncombinedstyle}
\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}}
Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
because it does not use wxFont objects.
This function gets the {\it uncombined style} - that is, the attributes associated with the
paragraph or character content, and not necessarily the combined attributes you see on the
screen. To get the combined attributes, use \helpref{GetStyle}{wxrichtextctrlgetstyle}.
If you specify (any) paragraph attribute in {\it style}'s flags, this function will fetch
the paragraph attributes. Otherwise, it will return the character attributes.
\membersection{wxRichTextCtrl::GetValue}\label{wxrichtextctrlgetvalue}
\constfunc{wxString}{GetValue}{\void}
Returns the content of the entire control as a string.
\membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition}\label{wxrichtextctrlgetvisiblelineforcaretposition}
\constfunc{wxRichTextLine*}{GetVisibleLineForCaretPosition}{\param{long }{caretPosition}}
Internal helper function returning the line for the visible caret position. If the caret is
shown at the very end of the line, it means the next character is actually
on the following line. So this function gets the line we're expecting to find
if this is the case.
\membersection{wxRichTextCtrl::HasCharacterAttributes}\label{wxrichtextctrlhascharacterattributes}
\constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}
\constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
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. {\it style} must have
flags indicating which attributes are of interest.
\membersection{wxRichTextCtrl::HasParagraphAttributes}\label{wxrichtextctrlhasparagraphattributes}
\constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}
\constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
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. {\it style} must have
flags indicating which attributes are of interest.
\membersection{wxRichTextCtrl::HasSelection}\label{wxrichtextctrlhasselection}
\constfunc{bool}{HasSelection}{\void}
Returns \true if there is a selection.
\membersection{wxRichTextCtrl::HitTest}\label{wxrichtextctrlhittest}
\constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{long* }{pos}}
\constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{wxTextCoord* }{col}, \param{wxTextCoord* }{row}}
Finds the character at the given position in pixels.
{\it pt} is in device coords (not adjusted for the client area origin nor for scrolling).
\membersection{wxRichTextCtrl::Init}\label{wxrichtextctrlinit}
\func{void}{Init}{\void}
Initialises the members of the control.
\membersection{wxRichTextCtrl::InitCommandEvent}\label{wxrichtextctrlinitcommandevent}
\constfunc{void}{InitCommandEvent}{\param{wxCommandEvent\& }{event}}
Initialises the command event.
\membersection{wxRichTextCtrl::IsDefaultStyleShowing}\label{wxrichtextctrlisdefaultstyleshowing}
\constfunc{bool}{IsDefaultStyleShowing}{\void}
Returns \true if the user has recently set the default style without moving the caret,
and therefore the UI needs to reflect the default style and not the style at the caret.
Below is an example of code that uses this function to determine whether the UI
should show that the current style is bold.
\begin{verbatim}
/// Is all of the selection bold?
bool wxRichTextCtrl::IsSelectionBold()
{
if (HasSelection())
{
wxRichTextAttr attr;
wxRichTextRange range = GetInternalSelectionRange();
attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
attr.SetFontWeight(wxBOLD);
return HasCharacterAttributes(range, attr);
}
else
{
// If no selection, then we need to combine current style with default style
// to see what the effect would be if we started typing.
wxRichTextAttr attr;
attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
long pos = GetAdjustedCaretPosition(GetCaretPosition());
if (GetStyle(pos, attr))
{
if (IsDefaultStyleShowing())
wxRichTextApplyStyle(attr, GetDefaultStyleEx());
return attr.GetFontWeight() == wxBOLD;
}
}
return false;
}
\end{verbatim}
See also \helpref{SetAndShowDefaultStyle}{wxrichtextctrlsetandshowdefaultstyle}.
\membersection{wxRichTextCtrl::IsEditable}\label{wxrichtextctrliseditable}
\constfunc{bool}{IsEditable}{\void}
Returns \true if the control is editable.
\membersection{wxRichTextCtrl::IsFrozen}\label{wxrichtextctrlisfrozen}
\constfunc{bool}{IsFrozen}{\void}
Returns \true if Freeze has been called without a Thaw.
\membersection{wxRichTextCtrl::IsModified}\label{wxrichtextctrlismodified}
\constfunc{bool}{IsModified}{\void}
Returns \true if the buffer has been modified.
\membersection{wxRichTextCtrl::IsMultiLine}\label{wxrichtextctrlismultiline}
\constfunc{bool}{IsMultiLine}{\void}
Returns \true if the control is multiline.
\membersection{wxRichTextCtrl::IsPositionVisible}\label{wxrichtextctrlispositionvisible}
\constfunc{bool}{IsPositionVisible}{\param{long }{pos}}
Returns \true if the given position is visible on the screen.
\membersection{wxRichTextCtrl::IsSelectionAligned}\label{wxrichtextctrlisselectionaligned}
\constfunc{bool}{IsSelectionAligned}{\param{wxTextAttrAlignment }{alignment}}
Returns \true if all of the selection is aligned according to the specified flag.
\membersection{wxRichTextCtrl::IsSelectionBold}\label{wxrichtextctrlisselectionbold}
\constfunc{bool}{IsSelectionBold}{\void}
Returns \true if all of the selection is bold.
\membersection{wxRichTextCtrl::IsSelectionItalics}\label{wxrichtextctrlisselectionitalics}
\constfunc{bool}{IsSelectionItalics}{\void}
Returns \true if all of the selection is italic.
\membersection{wxRichTextCtrl::IsSelectionUnderlined}\label{wxrichtextctrlisselectionunderlined}
\constfunc{bool}{IsSelectionUnderlined}{\void}
Returns \true if all of the selection is underlined.
\membersection{wxRichTextCtrl::IsSingleLine}\label{wxrichtextctrlissingleline}
\constfunc{bool}{IsSingleLine}{\void}
Returns \true if the control is single-line. Currently wxRichTextCtrl does not
support single-line editing.
\membersection{wxRichTextCtrl::KeyboardNavigate}\label{wxrichtextctrlkeyboardnavigate}
\func{bool}{KeyboardNavigate}{\param{int }{keyCode}, \param{int }{flags}}
Helper function implementing keyboard navigation.
\membersection{wxRichTextCtrl::LayoutContent}\label{wxrichtextctrllayoutcontent}
\func{bool}{LayoutContent}{\param{bool }{onlyVisibleRect = false}}
Lays out the buffer, which must be done before certain operations, such as
setting the caret position. This function should not normally be required by the
application.
\membersection{wxRichTextCtrl::LineBreak}\label{wxrichtextctrllinebreak}
\func{bool}{LineBreak}{\void}
Inserts a line break at the current insertion point. A line break forces wrapping within a paragraph, and
can be introduced by using this function, by appending the wxChar value {\bf wxRichTextLineBreakChar} to text content,
or by typing Shift-Return.
\membersection{wxRichTextCtrl::LoadFile}\label{wxrichtextctrlloadfile}
\func{bool}{LoadFile}{\param{const wxString\& }{file}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
Loads content into the control's buffer using the given type. If the specified type
is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.
This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.
\membersection{wxRichTextCtrl::MarkDirty}\label{wxrichtextctrlmarkdirty}
\func{void}{MarkDirty}{\void}
Marks the buffer as modified.
\membersection{wxRichTextCtrl::MoveCaret}\label{wxrichtextctrlmovecaret}
\func{bool}{MoveCaret}{\param{long }{pos}, \param{bool }{showAtLineStart = false}}
Move the caret to the given character position.
\membersection{wxRichTextCtrl::MoveCaretBack}\label{wxrichtextctrlmovecaretback}
\func{void}{MoveCaretBack}{\param{long }{oldPosition}}
Move the caret one visual step forward: this may mean setting a flag
and keeping the same position if we're going from the end of one line
to the start of the next, which may be the exact same caret position.
\membersection{wxRichTextCtrl::MoveCaretForward}\label{wxrichtextctrlmovecaretforward}
\func{void}{MoveCaretForward}{\param{long }{oldPosition}}
Move the caret one visual step forward: this may mean setting a flag
and keeping the same position if we're going from the end of one line
to the start of the next, which may be the exact same caret position.
\membersection{wxRichTextCtrl::MoveDown}\label{wxrichtextctrlmovedown}
\func{bool}{MoveDown}{\param{int }{noLines = 1}, \param{int }{flags = 0}}
Moves the caret down.
\membersection{wxRichTextCtrl::MoveEnd}\label{wxrichtextctrlmoveend}
\func{bool}{MoveEnd}{\param{int }{flags = 0}}
Moves to the end of the buffer.
\membersection{wxRichTextCtrl::MoveHome}\label{wxrichtextctrlmovehome}
\func{bool}{MoveHome}{\param{int }{flags = 0}}
Moves to the start of the buffer.
\membersection{wxRichTextCtrl::MoveLeft}\label{wxrichtextctrlmoveleft}
\func{bool}{MoveLeft}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}
Moves left.
\membersection{wxRichTextCtrl::MoveRight}\label{wxrichtextctrlmoveright}
\func{bool}{MoveRight}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}
Moves right.
\membersection{wxRichTextCtrl::MoveToLineEnd}\label{wxrichtextctrlmovetolineend}
\func{bool}{MoveToLineEnd}{\param{int }{flags = 0}}
Moves to the end of the line.
\membersection{wxRichTextCtrl::MoveToLineStart}\label{wxrichtextctrlmovetolinestart}
\func{bool}{MoveToLineStart}{\param{int }{flags = 0}}
Moves to the start of the line.
\membersection{wxRichTextCtrl::MoveToParagraphEnd}\label{wxrichtextctrlmovetoparagraphend}
\func{bool}{MoveToParagraphEnd}{\param{int }{flags = 0}}
Moves to the end of the paragraph.
\membersection{wxRichTextCtrl::MoveToParagraphStart}\label{wxrichtextctrlmovetoparagraphstart}
\func{bool}{MoveToParagraphStart}{\param{int }{flags = 0}}
Moves to the start of the paragraph.
\membersection{wxRichTextCtrl::MoveUp}\label{wxrichtextctrlmoveup}
\func{bool}{MoveUp}{\param{int }{noLines = 1}, \param{int }{flags = 0}}
Moves up.
\membersection{wxRichTextCtrl::Newline}\label{wxrichtextctrlnewline}
\func{bool}{Newline}{\void}
Inserts a new paragraph at the current insertion point. See also \helpref{wxRichTextCtrl::LineBreak}{wxrichtextctrllinebreak}.
\membersection{wxRichTextCtrl::NumberList}\label{wxrichtextctrlnumberlist}
\func{bool}{NumberList}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
\func{bool}{Number}{\param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in the current sheet) can be passed.
{\it flags} is a bit list of the following:
\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
\item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.
\end{itemize}
See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
\membersection{wxRichTextCtrl::OnClear}\label{wxrichtextctrlonclear}
\func{void}{OnClear}{\param{wxCommandEvent\& }{event}}
Standard handler for the wxID\_CLEAR command.
\membersection{wxRichTextCtrl::OnContextMenu}\label{wxrichtextctrloncontextmenu}
\func{void}{OnContextMenu}{\param{wxContextMenuEvent\& }{event}}
Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
\membersection{wxRichTextCtrl::OnCopy}\label{wxrichtextctrloncopy}
\func{void}{OnCopy}{\param{wxCommandEvent\& }{event}}
Standard handler for the wxID\_COPY command.
\membersection{wxRichTextCtrl::OnCut}\label{wxrichtextctrloncut}
\func{void}{OnCut}{\param{wxCommandEvent\& }{event}}
Standard handler for the wxID\_CUT command.
\membersection{wxRichTextCtrl::OnDropFiles}\label{wxrichtextctrlondropfiles}
\func{void}{OnDropFiles}{\param{wxDropFilesEvent\& }{event}}
Loads the first dropped file.
\membersection{wxRichTextCtrl::OnPaste}\label{wxrichtextctrlonpaste}
\func{void}{OnPaste}{\param{wxCommandEvent\& }{event}}
Standard handler for the wxID\_PASTE command.
\membersection{wxRichTextCtrl::OnRedo}\label{wxrichtextctrlonredo}
\func{void}{OnRedo}{\param{wxCommandEvent\& }{event}}
Standard handler for the wxID\_REDO command.
\membersection{wxRichTextCtrl::OnSelectAll}\label{wxrichtextctrlonselectall}
\func{void}{OnSelectAll}{\param{wxCommandEvent\& }{event}}
Standard handler for the wxID\_SELECTALL command.
\membersection{wxRichTextCtrl::OnUndo}\label{wxrichtextctrlonundo}
\func{void}{OnUndo}{\param{wxCommandEvent\& }{event}}
Standard handler for the wxID\_PASTE command.
\membersection{wxRichTextCtrl::OnUpdateClear}\label{wxrichtextctrlonupdateclear}
\func{void}{OnUpdateClear}{\param{wxUpdateUIEvent\& }{event}}
Standard update handler for the wxID\_CLEAR command.
\membersection{wxRichTextCtrl::OnUpdateCopy}\label{wxrichtextctrlonupdatecopy}
\func{void}{OnUpdateCopy}{\param{wxUpdateUIEvent\& }{event}}
Standard update handler for the wxID\_COPY command.
\membersection{wxRichTextCtrl::OnUpdateCut}\label{wxrichtextctrlonupdatecut}
\func{void}{OnUpdateCut}{\param{wxUpdateUIEvent\& }{event}}
Standard update handler for the wxID\_CUT command.
\membersection{wxRichTextCtrl::OnUpdatePaste}\label{wxrichtextctrlonupdatepaste}
\func{void}{OnUpdatePaste}{\param{wxUpdateUIEvent\& }{event}}
Standard update handler for the wxID\_PASTE command.
\membersection{wxRichTextCtrl::OnUpdateRedo}\label{wxrichtextctrlonupdateredo}
\func{void}{OnUpdateRedo}{\param{wxUpdateUIEvent\& }{event}}
Standard update handler for the wxID\_REDO command.
\membersection{wxRichTextCtrl::OnUpdateSelectAll}\label{wxrichtextctrlonupdateselectall}
\func{void}{OnUpdateSelectAll}{\param{wxUpdateUIEvent\& }{event}}
Standard update handler for the wxID\_SELECTALL command.
\membersection{wxRichTextCtrl::OnUpdateUndo}\label{wxrichtextctrlonupdateundo}
\func{void}{OnUpdateUndo}{\param{wxUpdateUIEvent\& }{event}}
Standard update handler for the wxID\_UNDO command.
\membersection{wxRichTextCtrl::PageDown}\label{wxrichtextctrlpagedown}
\func{bool}{PageDown}{\param{int }{noPages = 1}, \param{int }{flags = 0}}
Moves one or more pages down.
\membersection{wxRichTextCtrl::PageUp}\label{wxrichtextctrlpageup}
\func{bool}{PageUp}{\param{int }{noPages = 1}, \param{int }{flags = 0}}
Moves one or more pages up.
\membersection{wxRichTextCtrl::PaintBackground}\label{wxrichtextctrlpaintbackground}
\func{void}{PaintBackground}{\param{wxDC\& }{dc}}
Paints the background.
\membersection{wxRichTextCtrl::Paste}\label{wxrichtextctrlpaste}
\func{void}{Paste}{\void}
Pastes content from the clipboard to the buffer.
\membersection{wxRichTextCtrl::PositionCaret}\label{wxrichtextctrlpositioncaret}
\func{void}{PositionCaret}{\void}
Internal function to position the visible caret according to the current caret position.
\membersection{wxRichTextCtrl::PositionToXY}\label{wxrichtextctrlpositiontoxy}
\constfunc{bool}{PositionToXY}{\param{long }{pos}, \param{long* }{x}, \param{long* }{y}}
Converts a text position to zero-based column and line numbers.
\membersection{wxRichTextCtrl::PromoteList}\label{wxrichtextctrlpromotelist}
\func{bool}{PromoteList}{\param{int}{ promoteBy}, \param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ listLevel = -1}}
\func{bool}{PromoteList}{\param{int}{ promoteBy}, \param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ listLevel = -1}}
Promotes or demotes the paragraphs in the given range. A positive {\it promoteBy} produces a smaller indent, and a negative number
produces a larger indent. Pass flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in the current sheet) can be passed.
{\it flags} is a bit list of the following:
\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
\item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.
\end{itemize}
See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
\membersection{wxRichTextCtrl::Redo}\label{wxrichtextctrlredo}
\func{void}{Redo}{\void}
Redoes the current command.
\membersection{wxRichTextCtrl::Remove}\label{wxrichtextctrlremove}
\func{void}{Remove}{\param{long }{from}, \param{long }{to}}
Removes the content in the specified range.
\membersection{wxRichTextCtrl::Replace}\label{wxrichtextctrlreplace}
\func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}
Replaces the content in the specified range with the string specified by {\it value}.
\membersection{wxRichTextCtrl::SaveFile}\label{wxrichtextctrlsavefile}
\func{bool}{SaveFile}{\param{const wxString\& }{file = wxEmptyString}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
Saves the buffer content using the given type. If the specified type
is wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.
This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.
\membersection{wxRichTextCtrl::ScrollIntoView}\label{wxrichtextctrlscrollintoview}
\func{bool}{ScrollIntoView}{\param{long }{position}, \param{int }{keyCode}}
Scrolls {\it position} into view. This function takes a caret position.
\membersection{wxRichTextCtrl::SelectAll}\label{wxrichtextctrlselectall}
\func{void}{SelectAll}{\void}
Selects all the text in the buffer.
\membersection{wxRichTextCtrl::SelectNone}\label{wxrichtextctrlselectnone}
\func{void}{SelectNone}{\void}
Cancels any selection.
\membersection{wxRichTextCtrl::SetAndShowDefaultStyle}\label{wxrichtextctrlsetandshowdefaultstyle}
\func{void}{SetAndShowDefaultStyle}{\param{const wxRichTextAttr\& }{attr}}
Sets {\it attr} as the default style and tells the control that the UI should reflect
this attribute until the user moves the caret.
See also \helpref{IsDefaultStyleShowing}{wxrichtextctrlisdefaultstyleshowing}.
\membersection{wxRichTextCtrl::SetBasicStyle}\label{wxrichtextctrlsetbasicstyle}
\func{void}{SetBasicStyle}{\param{const wxRichTextAttr\& }{style}}
\func{void}{SetBasicStyle}{\param{const wxTextAttrEx\& }{style}}
Sets the basic (overall) style. This is the style of the whole
buffer before further styles are applied, unlike the default style, which
only affects the style currently being applied (for example, setting the default
style to bold will cause subsequently inserted text to be bold).
\membersection{wxRichTextCtrl::SetCaretPosition}\label{wxrichtextctrlsetcaretposition}
\func{void}{SetCaretPosition}{\param{long }{position}, \param{bool }{showAtLineStart = false}}
The caret position is the character position just before the caret.
A value of -1 means the caret is at the start of the buffer.
\membersection{wxRichTextCtrl::SetDefaultStyle}\label{wxrichtextctrlsetdefaultstyle}
\func{bool}{SetDefaultStyle}{\param{const wxTextAttrEx\& }{style}}
Sets the current default style, which can be used to change how subsequently inserted
text is displayed.
\membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle}\label{wxrichtextctrlsetdefaultstyletocursorstyle}
\func{bool}{SetDefaultStyleToCursorStyle}{\void}
Sets the default style to the style under the cursor.
\membersection{wxRichTextCtrl::SetDelayedLayoutThreshold}\label{wxrichtextctrlsetdelayedlayoutthreshold}
\func{void}{SetDelayedLayoutThreshold}{\param{long }{threshold}}
Sets the size of the buffer beyond which layout is delayed during resizing.
This optimizes sizing for large buffers. The default is 20000.
\membersection{wxRichTextCtrl::SetEditable}\label{wxrichtextctrlseteditable}
\func{void}{SetEditable}{\param{bool }{editable}}
Makes the control editable, or not.
\membersection{wxRichTextCtrl::SetFilename}\label{wxrichtextctrlsetfilename}
\func{void}{SetFilename}{\param{const wxString\& }{filename}}
Sets the current filename.
\membersection{wxRichTextCtrl::SetFont}\label{wxrichtextctrlsetfont}
\func{bool}{SetFont}{\param{const wxFont\& }{font}}
Sets the font, and also the basic and default attributes (see \helpref{SetDefaultStyle}{wxrichtextctrlsetdefaultstyle}).
\membersection{wxRichTextCtrl::SetHandlerFlags}\label{wxrichtextctrlsethandlerflags}
\func{void}{SetHandlerFlags}{\param{int }{flags}}
Sets flags that change the behaviour of loading or saving. See the documentation for each
handler class to see what flags are relevant for each handler.
\membersection{wxRichTextCtrl::SetInsertionPoint}\label{wxrichtextctrlsetinsertionpoint}
\func{void}{SetInsertionPoint}{\param{long }{pos}}
Sets the insertion point.
\membersection{wxRichTextCtrl::SetInsertionPointEnd}\label{wxrichtextctrlsetinsertionpointend}
\func{void}{SetInsertionPointEnd}{\void}
Sets the insertion point to the end of the text control.
\membersection{wxRichTextCtrl::SetListStyle}\label{wxrichtextctrlsetliststyle}
\func{bool}{SetListStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
\func{bool}{SetListStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}
Sets the list attributes for the given range, passing flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in the current sheet) can be passed.
{\it flags} is a bit list of the following:
\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.
\item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.
\end{itemize}
See also \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.
\membersection{wxRichTextCtrl::SetSelection}\label{wxrichtextctrlsetselection}
\func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}
Sets the selection to the given range.
The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the selection for a character at position 5, use the range (5,6).
\membersection{wxRichTextCtrl::SetSelectionRange}\label{wxrichtextctrlsetselectionrange}
\func{void}{SetSelectionRange}{\param{const wxRichTextRange\& }{range}}
Sets the selection to the given range.
The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the selection for a character at position 5, use the range (5,6).
\membersection{wxRichTextCtrl::SetStyle}\label{wxrichtextctrlsetstyle}
\func{bool}{SetStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}
\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}}
\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{style}}
Sets the attributes for the given range. The wxRichTextAttr version is more efficient
because it does not use wxFont objects.
The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the style for a character at position 5, use the range (5,6).
\membersection{wxRichTextCtrl::SetStyleEx}\label{wxrichtextctrlsetstyleex}
\func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
\func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
\func{bool}{SetStyleEx}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
because it does not use wxFont objects.
The end point of range is specified as the last character position of the span of text, plus one.
So, for example, to set the style for a character at position 5, use the range (5,6).
{\it flags} may contain a bit list of the following values:
\begin{itemize}\itemsep=0pt
\item wxRICHTEXT\_SETSTYLE\_NONE: no style flag.
\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.
\item wxRICHTEXT\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if the
combined style at this point is already the style in question.
\item wxRICHTEXT\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,
and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
\item wxRICHTEXT\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,
and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
\item wxRICHTEXT\_SETSTYLE\_RESET: resets (clears) the existing style before applying the new style.
\item wxRICHTEXT\_SETSTYLE\_REMOVE: removes the specified style. Only the style flags are used in this operation.
\end{itemize}
\membersection{wxRichTextCtrl::SetStyleSheet}\label{wxrichtextctrlsetstylesheet}
\func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}
Sets the style sheet associated with the control. A style sheet allows named
character and paragraph styles to be applied.
\membersection{wxRichTextCtrl::SetValue}\label{wxrichtextctrlsetvalue}
\func{void}{SetValue}{\param{const wxString\& }{value}}
Replaces existing content with the given text.
\membersection{wxRichTextCtrl::SetupScrollbars}\label{wxrichtextctrlsetupscrollbars}
\func{void}{SetupScrollbars}{\param{bool }{atTop = false}}
A helper function setting up scrollbars, for example after a resize.
\membersection{wxRichTextCtrl::ShowPosition}\label{wxrichtextctrlshowposition}
\func{void}{ShowPosition}{\param{long }{pos}}
Scrolls the buffer so that the given position is in view.
\membersection{wxRichTextCtrl::SuppressingUndo}\label{wxrichtextctrlsuppressingundo}
\constfunc{bool}{SuppressingUndo}{\void}
Returns \true if undo history suppression is on.
\membersection{wxRichTextCtrl::Thaw}\label{wxrichtextctrlthaw}
\func{void}{Thaw}{\void}
Call this function to end a Freeze and refresh the display.
\membersection{wxRichTextCtrl::Undo}\label{wxrichtextctrlundo}
\func{void}{Undo}{\void}
Undoes the command at the top of the command history, if there is one.
\membersection{wxRichTextCtrl::WordLeft}\label{wxrichtextctrlwordleft}
\func{bool}{WordLeft}{\param{int }{noWords = 1}, \param{int }{flags = 0}}
Moves a number of words to the left.
\membersection{wxRichTextCtrl::WordRight}\label{wxrichtextctrlwordright}
\func{bool}{WordRight}{\param{int }{noWords = 1}, \param{int }{flags = 0}}
Move a nuber of words to the right.
\membersection{wxRichTextCtrl::WriteImage}\label{wxrichtextctrlwriteimage}
\func{bool}{WriteImage}{\param{const wxString\& }{filename}, \param{int }{bitmapType}}
Loads an image from a file and writes it at the current insertion point.
\func{bool}{WriteImage}{\param{const wxRichTextImageBlock\& }{imageBlock}}
Writes an image block at the current insertion point.
\func{bool}{WriteImage}{\param{const wxBitmap\& }{bitmap}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}
\func{bool}{WriteImage}{\param{const wxImage\& }{image}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}
Write a bitmap or image at the current insertion point. Supply an optional type to use
for internal and file storage of the raw data.
\membersection{wxRichTextCtrl::WriteText}\label{wxrichtextctrlwritetext}
\func{void}{WriteText}{\param{const wxString\& }{text}}
Writes text at the current position.
\membersection{wxRichTextCtrl::XYToPosition}\label{wxrichtextctrlxytoposition}
\constfunc{long}{XYToPosition}{\param{long }{x}, \param{long }{y}}
Translates from column and line number to position.
|