File: textctrl.h

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (1656 lines) | stat: -rw-r--r-- 52,899 bytes parent folder | download | duplicates (6)
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
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
/////////////////////////////////////////////////////////////////////////////
// Name:        textctrl.h
// Purpose:     interface of wxTextAttr
// Author:      wxWidgets team
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

/**
   wxTextCtrl style flags
*/
#define wxTE_NO_VSCROLL     0x0002

#define wxTE_READONLY       0x0010
#define wxTE_MULTILINE      0x0020
#define wxTE_PROCESS_TAB    0x0040

// alignment flags
#define wxTE_LEFT           0x0000                    // 0x0000
#define wxTE_CENTER         wxALIGN_CENTER_HORIZONTAL // 0x0100
#define wxTE_RIGHT          wxALIGN_RIGHT             // 0x0200
#define wxTE_CENTRE         wxTE_CENTER

// this style means to use RICHEDIT control and does something only under wxMSW
// and Win32 and is silently ignored under all other platforms
#define wxTE_RICH           0x0080

#define wxTE_PROCESS_ENTER  0x0400
#define wxTE_PASSWORD       0x0800

// automatically detect the URLs and generate the events when mouse is
// moved/clicked over an URL
//
// this is for Win32 richedit and wxGTK2 multiline controls only so far
#define wxTE_AUTO_URL       0x1000

// by default, the Windows text control doesn't show the selection when it
// doesn't have focus - use this style to force it to always show it
#define wxTE_NOHIDESEL      0x2000

// use wxHSCROLL to not wrap text at all, wxTE_CHARWRAP to wrap it at any
// position and wxTE_WORDWRAP to wrap at words boundary
//
// if no wrapping style is given at all, the control wraps at word boundary
#define wxTE_DONTWRAP       wxHSCROLL
#define wxTE_CHARWRAP       0x4000  // wrap at any position
#define wxTE_WORDWRAP       0x0001  // wrap only at words boundaries
#define wxTE_BESTWRAP       0x0000  // this is the default

// force using RichEdit version 2.0 or 3.0 instead of 1.0 (default) for
// wxTE_RICH controls - can be used together with or instead of wxTE_RICH
#define wxTE_RICH2          0x8000


#define wxTEXT_TYPE_ANY     0


/**
   wxTextCoord is a line or row number
*/
typedef long wxTextCoord;


/**
    One of the following values can be passed to wxTextAttr::SetAlignment to determine paragraph alignment.
*/
enum wxTextAttrAlignment
{
    wxTEXT_ALIGNMENT_DEFAULT,
    wxTEXT_ALIGNMENT_LEFT,
    wxTEXT_ALIGNMENT_CENTRE,
    wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
    wxTEXT_ALIGNMENT_RIGHT,

    /** wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented.
        In future justification may be supported when printing or previewing, only. */
    wxTEXT_ALIGNMENT_JUSTIFIED
};

/**
    The following values are passed in a bitlist to wxTextAttr::SetFlags() to
    determine what attributes will be considered when setting the attributes for a text control.
*/
enum wxTextAttrFlags
{
    wxTEXT_ATTR_TEXT_COLOUR          = 0x00000001,
    wxTEXT_ATTR_BACKGROUND_COLOUR    = 0x00000002,

    wxTEXT_ATTR_FONT_FACE            = 0x00000004,
    wxTEXT_ATTR_FONT_POINT_SIZE      = 0x00000008,
    wxTEXT_ATTR_FONT_PIXEL_SIZE      = 0x10000000,
    wxTEXT_ATTR_FONT_WEIGHT          = 0x00000010,
    wxTEXT_ATTR_FONT_ITALIC          = 0x00000020,
    wxTEXT_ATTR_FONT_UNDERLINE       = 0x00000040,
    wxTEXT_ATTR_FONT_STRIKETHROUGH   = 0x08000000,
    wxTEXT_ATTR_FONT_ENCODING        = 0x02000000,
    wxTEXT_ATTR_FONT_FAMILY          = 0x04000000,

    wxTEXT_ATTR_FONT_SIZE = \
        ( wxTEXT_ATTR_FONT_POINT_SIZE | wxTEXT_ATTR_FONT_PIXEL_SIZE ),
    /**
        Defined as the combination of all @c wxTEXT_ATTR_FONT_* values above.
    */
    wxTEXT_ATTR_FONT = \
        ( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
            wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_STRIKETHROUGH | wxTEXT_ATTR_FONT_ENCODING | wxTEXT_ATTR_FONT_FAMILY ),

    wxTEXT_ATTR_ALIGNMENT            = 0x00000080,
    wxTEXT_ATTR_LEFT_INDENT          = 0x00000100,
    wxTEXT_ATTR_RIGHT_INDENT         = 0x00000200,
    wxTEXT_ATTR_TABS                 = 0x00000400,
    wxTEXT_ATTR_PARA_SPACING_AFTER   = 0x00000800,
    wxTEXT_ATTR_PARA_SPACING_BEFORE  = 0x00001000,
    wxTEXT_ATTR_LINE_SPACING         = 0x00002000,
    wxTEXT_ATTR_CHARACTER_STYLE_NAME = 0x00004000,
    wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000,
    wxTEXT_ATTR_LIST_STYLE_NAME      = 0x00010000,

    wxTEXT_ATTR_BULLET_STYLE         = 0x00020000,
    wxTEXT_ATTR_BULLET_NUMBER        = 0x00040000,
    wxTEXT_ATTR_BULLET_TEXT          = 0x00080000,
    wxTEXT_ATTR_BULLET_NAME          = 0x00100000,

    /**
        Defined as the combination of all @c wxTEXT_ATTR_BULLET_* values above.
    */
    wxTEXT_ATTR_BULLET = \
        ( wxTEXT_ATTR_BULLET_STYLE | wxTEXT_ATTR_BULLET_NUMBER | wxTEXT_ATTR_BULLET_TEXT | \
          wxTEXT_ATTR_BULLET_NAME ),

    wxTEXT_ATTR_URL                  = 0x00200000,
    wxTEXT_ATTR_PAGE_BREAK           = 0x00400000,
    wxTEXT_ATTR_EFFECTS              = 0x00800000,
    wxTEXT_ATTR_OUTLINE_LEVEL        = 0x01000000,

    /**
        Combines the styles @c wxTEXT_ATTR_FONT, @c wxTEXT_ATTR_EFFECTS, @c wxTEXT_ATTR_BACKGROUND_COLOUR,
        @c wxTEXT_ATTR_TEXT_COLOUR, @c wxTEXT_ATTR_CHARACTER_STYLE_NAME, @c wxTEXT_ATTR_URL.
    */

    wxTEXT_ATTR_CHARACTER = \
        (wxTEXT_ATTR_FONT|wxTEXT_ATTR_EFFECTS| \
            wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL),

    /**
        Combines all the styles regarding text paragraphs.
    */
    wxTEXT_ATTR_PARAGRAPH = \
        (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
            wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
            wxTEXT_ATTR_BULLET|wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL),

    /**
        Combines all previous values.
    */
    wxTEXT_ATTR_ALL = (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH)
};

/**
    Styles for wxTextAttr::SetBulletStyle. They can be combined together as a bitlist.
*/
enum wxTextAttrBulletStyle
{
    wxTEXT_ATTR_BULLET_STYLE_NONE            = 0x00000000,
    wxTEXT_ATTR_BULLET_STYLE_ARABIC          = 0x00000001,
    wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER   = 0x00000002,
    wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER   = 0x00000004,
    wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER     = 0x00000008,
    wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER     = 0x00000010,
    wxTEXT_ATTR_BULLET_STYLE_SYMBOL          = 0x00000020,

    /** wxTEXT_ATTR_BULLET_STYLE_BITMAP is unimplemented. */
    wxTEXT_ATTR_BULLET_STYLE_BITMAP          = 0x00000040,
    wxTEXT_ATTR_BULLET_STYLE_PARENTHESES     = 0x00000080,
    wxTEXT_ATTR_BULLET_STYLE_PERIOD          = 0x00000100,
    wxTEXT_ATTR_BULLET_STYLE_STANDARD        = 0x00000200,
    wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS = 0x00000400,
    wxTEXT_ATTR_BULLET_STYLE_OUTLINE         = 0x00000800,

    wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT      = 0x00000000,
    wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT     = 0x00001000,
    wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE    = 0x00002000,

    wxTEXT_ATTR_BULLET_STYLE_CONTINUATION    = 0x00004000
};

/**
    Styles for wxTextAttr::SetTextEffects(). They can be combined together as a bitlist.

    Of these, only wxTEXT_ATTR_EFFECT_CAPITALS, wxTEXT_ATTR_EFFECT_STRIKETHROUGH,
    wxTEXT_ATTR_EFFECT_SUPERSCRIPT and wxTEXT_ATTR_EFFECT_SUBSCRIPT are implemented.
*/
enum wxTextAttrEffects
{
    wxTEXT_ATTR_EFFECT_NONE                  = 0x00000000,
    wxTEXT_ATTR_EFFECT_CAPITALS              = 0x00000001,
    wxTEXT_ATTR_EFFECT_SMALL_CAPITALS        = 0x00000002,
    wxTEXT_ATTR_EFFECT_STRIKETHROUGH         = 0x00000004,
    wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH  = 0x00000008,
    wxTEXT_ATTR_EFFECT_SHADOW                = 0x00000010,
    wxTEXT_ATTR_EFFECT_EMBOSS                = 0x00000020,
    wxTEXT_ATTR_EFFECT_OUTLINE               = 0x00000040,
    wxTEXT_ATTR_EFFECT_ENGRAVE               = 0x00000080,
    wxTEXT_ATTR_EFFECT_SUPERSCRIPT           = 0x00000100,
    wxTEXT_ATTR_EFFECT_SUBSCRIPT             = 0x00000200
};

/**
    Convenience line spacing values; see wxTextAttr::SetLineSpacing().
*/
enum wxTextAttrLineSpacing
{
    wxTEXT_ATTR_LINE_SPACING_NORMAL         = 10,
    wxTEXT_ATTR_LINE_SPACING_HALF           = 15,
    wxTEXT_ATTR_LINE_SPACING_TWICE          = 20
};


/**
    Describes the possible return values of wxTextCtrl::HitTest().

    The element names correspond to the relationship between the point asked
    for and the character returned, e.g. @c wxTE_HT_BEFORE means that the point
    is before (leftward or upward) it and so on.
 */
enum wxTextCtrlHitTestResult
{
    /// Indicates that wxTextCtrl::HitTest() is not implemented on this
    /// platform.
    wxTE_HT_UNKNOWN = -2,

    /// The point is before the character returned.
    wxTE_HT_BEFORE,

    /// The point is directly on the character returned.
    wxTE_HT_ON_TEXT,

    /// The point is below the last line of the control.
    wxTE_HT_BELOW,

    /// The point is beyond the end of line containing the character returned.
    wxTE_HT_BEYOND
};


/**
    @class wxTextAttr

    wxTextAttr represents the character and paragraph attributes, or style,
    for a range of text in a wxTextCtrl or wxRichTextCtrl.

    When setting up a wxTextAttr object, pass a bitlist mask to
    wxTextAttr::SetFlags() to indicate which style elements should be changed.
    As a convenience, when you call a setter such as SetFont, the relevant bit
    will be set.

    @library{wxcore}
    @category{richtext}

    @see wxTextCtrl, wxRichTextCtrl
*/
class wxTextAttr
{
public:
    //@{
    /**
        Constructors.
    */
    wxTextAttr();
    wxTextAttr(const wxColour& colText,
               const wxColour& colBack = wxNullColour,
               const wxFont& font = wxNullFont,
               wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT);
    wxTextAttr(const wxTextAttr& attr);
    //@}

    /**
        Applies the attributes in @a style to the original object, but not those
        attributes from @a style that are the same as those in @a compareWith (if passed).
    */
    bool Apply(const wxTextAttr& style,
               const wxTextAttr* compareWith = NULL);

    /**
        Copies all defined/valid properties from overlay to current object.
    */
    void Merge(const wxTextAttr& overlay);

    /**
        Creates a new @c wxTextAttr which is a merge of @a base and @a overlay.

        Properties defined in @a overlay take precedence over those in @a base.
        Properties undefined/invalid in both are undefined in the result.
    */
    static wxTextAttr Merge(const wxTextAttr& base,
                            const wxTextAttr& overlay);


    /**
        Partial equality test.  If @a weakTest is @true, attributes of this object do not
        have to be present if those attributes of @a attr are present. If @a weakTest is
        @false, the function will fail if an attribute is present in @a attr but not
        in this object.
    */
    bool EqPartial(const wxTextAttr& attr, bool weakTest = true) const;

    /**
        @name GetXXX functions
     */

    //@{

    /**
        Returns the alignment flags.
        See ::wxTextAttrAlignment for a list of available styles.
    */
    wxTextAttrAlignment GetAlignment() const;

    /**
        Returns the background colour.
    */
    const wxColour& GetBackgroundColour() const;

    /**
        Returns a string containing the name of the font associated with the bullet symbol.
        Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
    */
    const wxString& GetBulletFont() const;

    /**
        Returns the standard bullet name, applicable if the bullet style is
        wxTEXT_ATTR_BULLET_STYLE_STANDARD.

        Currently the following standard bullet names are supported:
         - @c standard/circle
         - @c standard/square
         - @c standard/diamond
         - @c standard/triangle

        @note
        For wxRichTextCtrl users only: if you wish your rich text controls to support
        further bullet graphics, you can derive a class from wxRichTextRenderer or
        wxRichTextStdRenderer, override @c DrawStandardBullet and @c EnumerateStandardBulletNames,
        and set an instance of the class using wxRichTextBuffer::SetRenderer.
    */
    const wxString& GetBulletName() const;

    /**
        Returns the bullet number.
    */
    int GetBulletNumber() const;

    /**
        Returns the bullet style.
        See ::wxTextAttrBulletStyle for a list of available styles.
    */
    int GetBulletStyle() const;

    /**
        Returns the bullet text, which could be a symbol, or (for example) cached
        outline text.
    */
    const wxString& GetBulletText() const;

    /**
        Returns the name of the character style.
    */
    const wxString& GetCharacterStyleName() const;

    /**
        Returns flags indicating which attributes are applicable.
        See SetFlags() for a list of available flags.
    */
    long GetFlags() const;

    /**
        Creates and returns a font specified by the font attributes in the wxTextAttr
        object. Note that wxTextAttr does not store a wxFont object, so this is only
        a temporary font.

        For greater efficiency, access the font attributes directly.
    */
    wxFont GetFont() const;

    /**
        Gets the font attributes from the given font, using only the attributes
        specified by @a flags.
    */
    bool GetFontAttributes(const wxFont& font,
                           int flags = wxTEXT_ATTR_FONT);

    /**
        Returns the font encoding.
    */
    wxFontEncoding GetFontEncoding() const;

    /**
        Returns the font face name.
    */
    const wxString& GetFontFaceName() const;

    /**
        Returns the font family.
    */
    wxFontFamily GetFontFamily() const;

    /**
        Returns the font size in points.
    */
    int GetFontSize() const;

    /**
        Returns the font style.
    */
    wxFontStyle GetFontStyle() const;

    /**
        Returns @true if the font is underlined.
    */
    bool GetFontUnderlined() const;

    /**
        Returns the font weight.
    */
    wxFontWeight GetFontWeight() const;

    /**
        Returns the left indent in tenths of a millimetre.
    */
    long GetLeftIndent() const;

    /**
        Returns the left sub-indent in tenths of a millimetre.
    */
    long GetLeftSubIndent() const;

    /**
        Returns the line spacing value, one of ::wxTextAttrLineSpacing values.
    */
    int GetLineSpacing() const;

    /**
        Returns the name of the list style.
    */
    const wxString& GetListStyleName() const;

    /**
        Returns the outline level.
    */
    int GetOutlineLevel() const;

    /**
        Returns the space in tenths of a millimeter after the paragraph.
    */
    int GetParagraphSpacingAfter() const;

    /**
        Returns the space in tenths of a millimeter before the paragraph.
    */
    int GetParagraphSpacingBefore() const;

    /**
        Returns the name of the paragraph style.
    */
    const wxString& GetParagraphStyleName() const;

    /**
        Returns the right indent in tenths of a millimeter.
    */
    long GetRightIndent() const;

    /**
        Returns an array of tab stops, each expressed in tenths of a millimeter.

        Each stop is measured from the left margin and therefore each value must
        be larger than the last.
    */
    const wxArrayInt& GetTabs() const;

    /**
        Returns the text foreground colour.
    */
    const wxColour& GetTextColour() const;

    /**
        Returns the text effect bits of interest.
        See SetFlags() for further information.
    */
    int GetTextEffectFlags() const;

    /**
        Returns the text effects, a bit list of styles.
        See SetTextEffects() for details.
    */
    int GetTextEffects() const;

    /**
        Returns the URL for the content.

        Content with @a wxTEXT_ATTR_URL style causes wxRichTextCtrl to show a
        hand cursor over it, and wxRichTextCtrl generates a wxTextUrlEvent
        when the content is clicked.
    */
    const wxString& GetURL() const;

    //@}



    /**
        @name HasXXX and IsXXX functions
     */

    //@{

    /**
        Returns @true if the attribute object specifies alignment.
    */
    bool HasAlignment() const;

    /**
        Returns @true if the attribute object specifies a background colour.
    */
    bool HasBackgroundColour() const;

    /**
        Returns @true if the attribute object specifies a standard bullet name.
    */
    bool HasBulletName() const;

    /**
        Returns @true if the attribute object specifies a bullet number.
    */
    bool HasBulletNumber() const;

    /**
        Returns @true if the attribute object specifies a bullet style.
    */
    bool HasBulletStyle() const;

    /**
        Returns @true if the attribute object specifies bullet text (usually
        specifying a symbol).
    */
    bool HasBulletText() const;

    /**
        Returns @true if the attribute object specifies a character style name.
    */
    bool HasCharacterStyleName() const;

    /**
        Returns @true if the @a flag is present in the attribute object's flag
        bitlist.
    */
    bool HasFlag(long flag) const;

    /**
        Returns @true if the attribute object specifies any font attributes.
    */
    bool HasFont() const;

    /**
        Returns @true if the attribute object specifies an encoding.
    */
    bool HasFontEncoding() const;

    /**
        Returns @true if the attribute object specifies a font face name.
    */
    bool HasFontFaceName() const;

    /**
        Returns @true if the attribute object specifies a font family.
    */
    bool HasFontFamily() const;

    /**
        Returns @true if the attribute object specifies italic style.
    */
    bool HasFontItalic() const;

    /**
        Returns @true if the attribute object specifies a font point or pixel size.
    */
    bool HasFontSize() const;

    /**
        Returns @true if the attribute object specifies a font point size.
    */
    bool HasFontPointSize() const;

    /**
        Returns @true if the attribute object specifies a font pixel size.
    */
    bool HasFontPixelSize() const;

    /**
        Returns @true if the attribute object specifies either underlining or no
        underlining.
    */
    bool HasFontUnderlined() const;

    /**
        Returns @true if the attribute object specifies font weight (bold, light or
        normal).
    */
    bool HasFontWeight() const;

    /**
        Returns @true if the attribute object specifies a left indent.
    */
    bool HasLeftIndent() const;

    /**
        Returns @true if the attribute object specifies line spacing.
    */
    bool HasLineSpacing() const;

    /**
        Returns @true if the attribute object specifies a list style name.
    */
    bool HasListStyleName() const;

    /**
        Returns @true if the attribute object specifies an outline level.
    */
    bool HasOutlineLevel() const;

    /**
        Returns @true if the attribute object specifies a page break before this
        paragraph.
    */
    bool HasPageBreak() const;

    /**
        Returns @true if the attribute object specifies spacing after a paragraph.
    */
    bool HasParagraphSpacingAfter() const;

    /**
        Returns @true if the attribute object specifies spacing before a paragraph.
    */
    bool HasParagraphSpacingBefore() const;

    /**
        Returns @true if the attribute object specifies a paragraph style name.
    */
    bool HasParagraphStyleName() const;

    /**
        Returns @true if the attribute object specifies a right indent.
    */
    bool HasRightIndent() const;

    /**
        Returns @true if the attribute object specifies tab stops.
    */
    bool HasTabs() const;

    /**
        Returns @true if the attribute object specifies a text foreground colour.
    */
    bool HasTextColour() const;

    /**
        Returns @true if the attribute object specifies text effects.
    */
    bool HasTextEffects() const;

    /**
        Returns @true if the attribute object specifies a URL.
    */
    bool HasURL() const;

    /**
        Returns @true if the object represents a character style, that is,
        the flags specify a font or a text background or foreground colour.
    */
    bool IsCharacterStyle() const;

    /**
        Returns @false if we have any attributes set, @true otherwise.
    */
    bool IsDefault() const;

    /**
        Returns @true if the object represents a paragraph style, that is,
        the flags specify alignment, indentation, tabs, paragraph spacing, or
        bullet style.
    */
    bool IsParagraphStyle() const;

    //@}


    /**
        @name SetXXX functions
     */

    //@{

    /**
        Sets the paragraph alignment. See ::wxTextAttrAlignment enumeration values.

        Of these, wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented.
        In future justification may be supported when printing or previewing, only.
    */
    void SetAlignment(wxTextAttrAlignment alignment);

    /**
        Sets the background colour.
    */
    void SetBackgroundColour(const wxColour& colBack);

    /**
        Sets the name of the font associated with the bullet symbol.
        Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
    */
    void SetBulletFont(const wxString& font);

    /**
        Sets the standard bullet name, applicable if the bullet style is
        wxTEXT_ATTR_BULLET_STYLE_STANDARD.

        See GetBulletName() for a list of supported names, and how
        to expand the range of supported types.
    */
    void SetBulletName(const wxString& name);

    /**
        Sets the bullet number.
    */
    void SetBulletNumber(int n);

    /**
        Sets the bullet style.

        The ::wxTextAttrBulletStyle enumeration values are all supported,
        except for wxTEXT_ATTR_BULLET_STYLE_BITMAP.
    */
    void SetBulletStyle(int style);

    /**
        Sets the bullet text, which could be a symbol, or (for example) cached
        outline text.
    */
    void SetBulletText(const wxString& text);

    /**
        Sets the character style name.
    */
    void SetCharacterStyleName(const wxString& name);

    /**
        Sets the flags determining which styles are being specified.
        The ::wxTextAttrFlags values can be passed in a bitlist.
    */
    void SetFlags(long flags);

    /**
        Sets the attributes for the given font.
        Note that wxTextAttr does not store an actual wxFont object.
    */
    void SetFont(const wxFont& font, int flags = wxTEXT_ATTR_FONT & ~wxTEXT_ATTR_FONT_PIXEL_SIZE);

    /**
        Sets the font encoding.
    */
    void SetFontEncoding(wxFontEncoding encoding);

    /**
        Sets the font face name.
    */
    void SetFontFaceName(const wxString& faceName);

    /**
        Sets the font family.
    */
    void SetFontFamily(wxFontFamily family);

    /**
        Sets the font size in points.
    */
    void SetFontSize(int pointSize);

    /**
        Sets the font size in points.
    */
    void SetFontPointSize(int pointSize);

    /**
        Sets the font size in pixels.
    */
    void SetFontPixelSize(int pixelSize);

    /**
        Sets the font style (normal, italic or slanted).
    */
    void SetFontStyle(wxFontStyle fontStyle);

    /**
        Sets the font underlining.
    */
    void SetFontUnderlined(bool underlined);

    /**
        Sets the font weight.
    */
    void SetFontWeight(wxFontWeight fontWeight);

    /**
        Sets the left indent and left 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.
    */
    void SetLeftIndent(int indent, int subIndent = 0);

    /**
        Sets the line spacing. @a spacing is a multiple, where 10 means single-spacing,
        15 means 1.5 spacing, and 20 means double spacing.
        The ::wxTextAttrLineSpacing values are defined for convenience.
    */
    void SetLineSpacing(int spacing);

    /**
        Sets the list style name.
    */
    void SetListStyleName(const wxString& name);

    /**
        Specifies the outline level. Zero represents normal text.
        At present, the outline level is not used, but may be used in future for
        determining list levels and for applications that need to store document
        structure information.
    */
    void SetOutlineLevel(int level);

    /**
        Specifies a page break before this paragraph.
    */
    void SetPageBreak(bool pageBreak = true);

    /**
        Sets the spacing after a paragraph, in tenths of a millimetre.
    */
    void SetParagraphSpacingAfter(int spacing);

    /**
        Sets the spacing before a paragraph, in tenths of a millimetre.
    */
    void SetParagraphSpacingBefore(int spacing);

    /**
        Sets the name of the paragraph style.
    */
    void SetParagraphStyleName(const wxString& name);

    /**
        Sets the right indent in tenths of a millimetre.
    */
    void SetRightIndent(int indent);

    /**
        Sets the tab stops, expressed in tenths of a millimetre.
        Each stop is measured from the left margin and therefore each value must be
        larger than the last.
    */
    void SetTabs(const wxArrayInt& tabs);

    /**
        Sets the text foreground colour.
    */
    void SetTextColour(const wxColour& colText);

    /**
        Sets the text effect bits of interest.

        You should also pass wxTEXT_ATTR_EFFECTS to SetFlags().
        See SetFlags() for further information.
    */
    void SetTextEffectFlags(int flags);

    /**
        Sets the text effects, a bit list of styles.
        The ::wxTextAttrEffects enumeration values can be used.

        Of these, only wxTEXT_ATTR_EFFECT_CAPITALS, wxTEXT_ATTR_EFFECT_STRIKETHROUGH,
        wxTEXT_ATTR_EFFECT_SUPERSCRIPT and wxTEXT_ATTR_EFFECT_SUBSCRIPT are implemented.

        wxTEXT_ATTR_EFFECT_CAPITALS capitalises text when displayed (leaving the case
        of the actual buffer text unchanged), and wxTEXT_ATTR_EFFECT_STRIKETHROUGH draws
        a line through text.

        To set effects, you should also pass wxTEXT_ATTR_EFFECTS to SetFlags(), and call
        SetTextEffectFlags() with the styles (taken from the above set) that you
        are interested in setting.
    */
    void SetTextEffects(int effects);

    /**
        Sets the URL for the content. Sets the wxTEXT_ATTR_URL style; content with this
        style causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl
        generates a wxTextUrlEvent when the content is clicked.
    */
    void SetURL(const wxString& url);

    //@}


    /**
        Assignment from a wxTextAttr object.
    */
    void operator=(const wxTextAttr& attr);
};


/**
    @class wxTextCtrl

    A text control allows text to be displayed and edited.

    It may be single line or multi-line. Notice that a lot of methods of the
    text controls are found in the base wxTextEntry class which is a common
    base class for wxTextCtrl and other controls using a single line text entry
    field (e.g. wxComboBox).

    @beginStyleTable
    @style{wxTE_PROCESS_ENTER}
           The control will generate the event @c wxEVT_TEXT_ENTER
           (otherwise pressing Enter key is either processed internally by the
           control or used for navigation between dialog controls).
    @style{wxTE_PROCESS_TAB}
           The control will receive @c wxEVT_CHAR events for TAB pressed -
           normally, TAB is used for passing to the next control in a dialog
           instead. For the control created with this style, you can still use
           Ctrl-Enter to pass to the next control from the keyboard.
    @style{wxTE_MULTILINE}
           The text control allows multiple lines. If this style is not
           specified, line break characters should not be used in the controls
           value.
    @style{wxTE_PASSWORD}
           The text will be echoed as asterisks.
    @style{wxTE_READONLY}
           The text will not be user-editable.
    @style{wxTE_RICH}
           Use rich text control under Win32, this allows to have more than
           64KB of text in the control even under Win9x. This style is ignored
           under other platforms.
    @style{wxTE_RICH2}
           Use rich text control version 2.0 or 3.0 under Win32, this style is
           ignored under other platforms
    @style{wxTE_AUTO_URL}
           Highlight the URLs and generate the wxTextUrlEvents when mouse
           events occur over them. This style is only supported for wxTE_RICH
           Win32 and multi-line wxGTK2 text controls.
    @style{wxTE_NOHIDESEL}
           By default, the Windows text control doesn't show the selection
           when it doesn't have focus - use this style to force it to always
           show it. It doesn't do anything under other platforms.
    @style{wxHSCROLL}
           A horizontal scrollbar will be created and used, so that text won't
           be wrapped. No effect under wxGTK1.
    @style{wxTE_NO_VSCROLL}
           For multiline controls only: vertical scrollbar will never be
           created. This limits the amount of text which can be entered into
           the control to what can be displayed in it under MSW but not under
           GTK2. Currently not implemented for the other platforms.
    @style{wxTE_LEFT}
           The text in the control will be left-justified (default).
    @style{wxTE_CENTRE}
           The text in the control will be centered (currently wxMSW and
           wxGTK2 only).
    @style{wxTE_RIGHT}
           The text in the control will be right-justified (currently wxMSW
           and wxGTK2 only).
    @style{wxTE_DONTWRAP}
           Same as wxHSCROLL style: don't wrap at all, show horizontal
           scrollbar instead.
    @style{wxTE_CHARWRAP}
           Wrap the lines too long to be shown entirely at any position
           (wxUniv and wxGTK2 only).
    @style{wxTE_WORDWRAP}
           Wrap the lines too long to be shown entirely at word boundaries
           (wxUniv and wxGTK2 only).
    @style{wxTE_BESTWRAP}
           Wrap the lines at word boundaries or at any other character if
           there are words longer than the window width (this is the default).
    @style{wxTE_CAPITALIZE}
           On PocketPC and Smartphone, causes the first letter to be
           capitalized.
    @endStyleTable

    Note that alignment styles (wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT) can be
    changed dynamically after control creation on wxMSW and wxGTK. wxTE_READONLY,
    wxTE_PASSWORD and wrapping styles can be dynamically changed under wxGTK but
    not wxMSW. The other styles can be only set during control creation.


    @section textctrl_text_format wxTextCtrl Text Format

    The multiline text controls always store the text as a sequence of lines
    separated by @c '\\n' characters, i.e. in the Unix text format even on
    non-Unix platforms. This allows the user code to ignore the differences
    between the platforms but at a price: the indices in the control such as
    those returned by GetInsertionPoint() or GetSelection() can @b not be used
    as indices into the string returned by GetValue() as they're going to be
    slightly off for platforms using @c "\\r\\n" as separator (as Windows
    does).

    Instead, if you need to obtain a substring between the 2 indices obtained
    from the control with the help of the functions mentioned above, you should
    use GetRange(). And the indices themselves can only be passed to other
    methods, for example SetInsertionPoint() or SetSelection().

    To summarize: never use the indices returned by (multiline) wxTextCtrl as
    indices into the string it contains, but only as arguments to be passed
    back to the other wxTextCtrl methods. This problem doesn't arise for
    single-line platforms however where the indices in the control do
    correspond to the positions in the value string.


    @section textctrl_styles wxTextCtrl Styles.

    Multi-line text controls support styling, i.e. provide a possibility to set
    colours and font for individual characters in it (note that under Windows
    @c wxTE_RICH style is required for style support). To use the styles you
    can either call SetDefaultStyle() before inserting the text or call
    SetStyle() later to change the style of the text already in the control
    (the first solution is much more efficient).

    In either case, if the style doesn't specify some of the attributes (for
    example you only want to set the text colour but without changing the font
    nor the text background), the values of the default style will be used for
    them. If there is no default style, the attributes of the text control
    itself are used.

    So the following code correctly describes what it does: the second call to
    SetDefaultStyle() doesn't change the text foreground colour (which stays
    red) while the last one doesn't change the background colour (which stays
    grey):

    @code
    text->SetDefaultStyle(wxTextAttr(*wxRED));
    text->AppendText("Red text\n");
    text->SetDefaultStyle(wxTextAttr(wxNullColour, *wxLIGHT_GREY));
    text->AppendText("Red on grey text\n");
    text->SetDefaultStyle(wxTextAttr(*wxBLUE);
    text->AppendText("Blue on grey text\n");
    @endcode


    @section textctrl_cpp_streams wxTextCtrl and C++ Streams

    This class multiply-inherits from @c std::streambuf (except for some really
    old compilers using non-standard iostream library), allowing code such as
    the following:

    @code
    wxTextCtrl *control = new wxTextCtrl(...);

    ostream stream(control)

    stream << 123.456 << " some text\n";
    stream.flush();
    @endcode

    Note that even if your compiler doesn't support this (the symbol
    @c wxHAS_TEXT_WINDOW_STREAM has value of 0 then) you can still use
    wxTextCtrl itself in a stream-like manner:

    @code
    wxTextCtrl *control = new wxTextCtrl(...);

    *control << 123.456 << " some text\n";
    @endcode

    However the possibility to create an ostream associated with wxTextCtrl may
    be useful if you need to redirect the output of a function taking an
    ostream as parameter to a text control.

    Another commonly requested need is to redirect @c std::cout to the text
    control. This may be done in the following way:

    @code
    #include <iostream>

    wxTextCtrl *control = new wxTextCtrl(...);

    std::streambuf *sbOld = std::cout.rdbuf();
    std::cout.rdbuf(control);

    // use cout as usual, the output appears in the text control
    ...

    std::cout.rdbuf(sbOld);
    @endcode

    But wxWidgets provides a convenient class to make it even simpler so
    instead you may just do

    @code
    #include <iostream>

    wxTextCtrl *control = new wxTextCtrl(...);

    wxStreamToTextRedirector redirect(control);

    // all output to cout goes into the text control until the exit from
    // current scope
    @endcode

    See wxStreamToTextRedirector for more details.


    @section textctrl_event_handling Event Handling.

    The following commands are processed by default event handlers in
    wxTextCtrl: @c wxID_CUT, @c wxID_COPY, @c wxID_PASTE, @c wxID_UNDO, @c
    wxID_REDO. The associated UI update events are also processed
    automatically, when the control has the focus.

    @beginEventEmissionTable{wxCommandEvent}
    @event{EVT_TEXT(id, func)}
        Respond to a @c wxEVT_TEXT event, generated when the text
        changes. Notice that this event will be sent when the text controls
        contents changes -- whether this is due to user input or comes from the
        program itself (for example, if wxTextCtrl::SetValue() is called); see
        wxTextCtrl::ChangeValue() for a function which does not send this event.
        This event is however not sent during the control creation.
    @event{EVT_TEXT_ENTER(id, func)}
        Respond to a @c wxEVT_TEXT_ENTER event, generated when enter is
        pressed in a text control which must have wxTE_PROCESS_ENTER style for
        this event to be generated.
    @event{EVT_TEXT_URL(id, func)}
        A mouse event occurred over an URL in the text control (wxMSW and
        wxGTK2 only currently).
    @event{EVT_TEXT_MAXLEN(id, func)}
        This event is generated when the user tries to enter more text into the
        control than the limit set by wxTextCtrl::SetMaxLength(), see its description.
    @endEventTable

    @library{wxcore}
    @category{ctrl}
    @appearance{textctrl}

    @see wxTextCtrl::Create, wxValidator
*/
class wxTextCtrl : public wxControl,
                   public wxTextEntry
{
public:
    /**
        Default ctor.
    */
    wxTextCtrl();

    /**
        Constructor, creating and showing a text control.

        @param parent
            Parent window. Should not be @NULL.
        @param id
            Control identifier. A value of -1 denotes a default value.
        @param value
            Default text value.
        @param pos
            Text control position.
        @param size
            Text control size.
        @param style
            Window style. See wxTextCtrl.
        @param validator
            Window validator.
        @param name
            Window name.

        @remarks
            The horizontal scrollbar (wxHSCROLL style flag) will only be
            created for multi-line text controls. Without a horizontal
            scrollbar, text lines that don't fit in the control's size will be
            wrapped (but no newline character is inserted).
            Single line controls don't have a horizontal scrollbar, the text is
            automatically scrolled so that the insertion point is always visible.

        @see Create(), wxValidator
    */
    wxTextCtrl(wxWindow* parent, wxWindowID id,
               const wxString& value = wxEmptyString,
               const wxPoint& pos = wxDefaultPosition,
               const wxSize& size = wxDefaultSize,
               long style = 0,
               const wxValidator& validator = wxDefaultValidator,
               const wxString& name = wxTextCtrlNameStr);

    /**
        Destructor, destroying the text control.
    */
    virtual ~wxTextCtrl();

    /**
        Creates the text control for two-step construction.

        This method should be called if the default constructor was used for
        the control creation. Its parameters have the same meaning as for the
        non-default constructor.
    */
    bool Create(wxWindow* parent, wxWindowID id,
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize, long style = 0,
                const wxValidator& validator = wxDefaultValidator,
                const wxString& name = wxTextCtrlNameStr);

    /**
        Resets the internal modified flag as if the current changes had been
        saved.
    */
    virtual void DiscardEdits();

    /**
        This function inserts into the control the character which would have
        been inserted if the given key event had occurred in the text control.

        The @a event object should be the same as the one passed to @c EVT_KEY_DOWN
        handler previously by wxWidgets. Please note that this function doesn't
        currently work correctly for all keys under any platform but MSW.

        @return
            @true if the event resulted in a change to the control, @false otherwise.
    */
    virtual bool EmulateKeyPress(const wxKeyEvent& event);

    /**
        Returns the style currently used for the new text.

        @see SetDefaultStyle()
    */
    virtual const wxTextAttr& GetDefaultStyle() const;

    /**
        Gets the length of the specified line, not including any trailing
        newline character(s).

        @param lineNo
            Line number (starting from zero).

        @return
            The length of the line, or -1 if @a lineNo was invalid.
    */
    virtual int GetLineLength(long lineNo) const;

    /**
        Returns the contents of a given line in the text control, not including
        any trailing newline character(s).

        @param lineNo
            The line number, starting from zero.

        @return
            The contents of the line.
    */
    virtual wxString GetLineText(long lineNo) const;

    /**
        Returns the number of lines in the text control buffer.

        The returned number is the number of logical lines, i.e. just the count
        of the number of newline characters in the control + 1, for wxGTK and
        wxOSX/Cocoa ports while it is the number of physical lines, i.e. the
        count of lines actually shown in the control, in wxMSW and wxOSX/Carbon.
        Because of this discrepancy, it is not recommended to use this function.

        @remarks
            Note that even empty text controls have one line (where the
            insertion point is), so GetNumberOfLines() never returns 0.
    */
    virtual int GetNumberOfLines() const;

    /**
        Returns the style at this position in the text control.

        Not all platforms support this function.

        @return
            @true on success, @false if an error occurred (this may also mean
            that the styles are not supported under this platform).

        @see SetStyle(), wxTextAttr
    */
    virtual bool GetStyle(long position, wxTextAttr& style);

    /**
        Finds the position of the character at the specified point.

        If the return code is not @c wxTE_HT_UNKNOWN the row and column of the
        character closest to this position are returned, otherwise the output
        parameters are not modified.

        Please note that this function is currently only implemented in wxUniv,
        wxMSW and wxGTK2 ports and always returns @c wxTE_HT_UNKNOWN in the
        other ports.

        @beginWxPerlOnly
        In wxPerl this function takes only the @a pt argument and
        returns a 3-element list (result, col, row).
        @endWxPerlOnly

        @param pt
            The position of the point to check, in window device coordinates.
        @param pos
            Receives the position of the character at the given position. May
            be @NULL.

        @see PositionToXY(), XYToPosition()
    */
    wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const;

    /**
        Finds the row and column of the character at the specified point.

        If the return code is not @c wxTE_HT_UNKNOWN the row and column of the
        character closest to this position are returned, otherwise the output
        parameters are not modified.

        Please note that this function is currently only implemented in wxUniv,
        wxMSW and wxGTK2 ports and always returns @c wxTE_HT_UNKNOWN in the
        other ports.

        @beginWxPerlOnly
        In wxPerl this function takes only the @a pt argument and
        returns a 3-element list (result, col, row).
        @endWxPerlOnly

        @param pt
            The position of the point to check, in window device coordinates.
        @param col
            Receives the column of the character at the given position. May be
            @NULL.
        @param row
            Receives the row of the character at the given position. May be
            @NULL.

        @see PositionToXY(), XYToPosition()
    */
    wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
                                    wxTextCoord *col,
                                    wxTextCoord *row) const;

    /**
        Returns @true if the text has been modified by user.

        Note that calling SetValue() doesn't make the control modified.

        @see MarkDirty()
    */
    virtual bool IsModified() const;

    /**
        Returns @true if this is a multi line edit control and @false otherwise.

        @see IsSingleLine()
    */
    bool IsMultiLine() const;

    /**
        Returns @true if this is a single line edit control and @false otherwise.

        @see IsSingleLine(), IsMultiLine()
    */
    bool IsSingleLine() const;

    /**
        Loads and displays the named file, if it exists.

        @param filename
            The filename of the file to load.
        @param fileType
            The type of file to load. This is currently ignored in wxTextCtrl.

        @return
            @true if successful, @false otherwise.
    */
    bool LoadFile(const wxString& filename,
                  int fileType = wxTEXT_TYPE_ANY);

    /**
        Mark text as modified (dirty).

        @see IsModified()
    */
    virtual void MarkDirty();

    /**
        This event handler function implements default drag and drop behaviour,
        which is to load the first dropped file into the control.

        @param event
            The drop files event.

        @remarks This is not implemented on non-Windows platforms.

        @see wxDropFilesEvent
    */
    void OnDropFiles(wxDropFilesEvent& event);

    /**
        Converts given position to a zero-based column, line number pair.

        @param pos
            Position.
        @param x
            Receives zero based column number.
        @param y
            Receives zero based line number.

        @return
            @true on success, @false on failure (most likely due to a too large
            position parameter).

        @beginWxPerlOnly
        In wxPerl this function takes only the @a pos argument and
        returns a 2-element list (x, y).
        @endWxPerlOnly

        @see XYToPosition()
    */
    virtual bool PositionToXY(long pos, long* x, long* y) const;

    /**
        Converts given text position to client coordinates in pixels.

        This function allows to find where is the character at the given
        position displayed in the text control.

        @onlyfor{wxmsw,wxgtk}. Additionally, wxGTK only implements this method
        for multiline controls and ::wxDefaultPosition is always returned for
        the single line ones.

        @param pos
            Text position in 0 to GetLastPosition() range (inclusive).
        @return
            On success returns a wxPoint which contains client coordinates for
            the given position in pixels, otherwise returns ::wxDefaultPosition.

        @since 2.9.3

        @see XYToPosition(), PositionToXY()
    */
    wxPoint PositionToCoords(long pos) const;

    /**
        Saves the contents of the control in a text file.

        @param filename
            The name of the file in which to save the text.
        @param fileType
            The type of file to save. This is currently ignored in wxTextCtrl.

        @return
            @true if the operation was successful, @false otherwise.
    */
    bool SaveFile(const wxString& filename = wxEmptyString,
                  int fileType = wxTEXT_TYPE_ANY);

    /**
        Changes the default style to use for the new text which is going to be
        added to the control using WriteText() or AppendText().

        If either of the font, foreground, or background colour is not set in
        @a style, the values of the previous default style are used for them.
        If the previous default style didn't set them neither, the global font
        or colours of the text control itself are used as fall back.

        However if the @a style parameter is the default wxTextAttr, then the default
        style is just reset (instead of being combined with the new style which
        wouldn't change it at all).

        @param style
            The style for the new text.

        @return
            @true on success, @false if an error occurred (this may also mean
            that the styles are not supported under this platform).

        @see GetDefaultStyle()
    */
    virtual bool SetDefaultStyle(const wxTextAttr& style);

    /**
        Marks the control as being modified by the user or not.

        @see MarkDirty(), DiscardEdits()
    */
    void SetModified(bool modified);

    /**
        Changes the style of the given range.

        If any attribute within @a style is not set, the corresponding
        attribute from GetDefaultStyle() is used.

        @param start
            The start of the range to change.
        @param end
            The end of the range to change.
        @param style
            The new style for the range.

        @return
            @true on success, @false if an error occurred (this may also mean
            that the styles are not supported under this platform).

        @see GetStyle(), wxTextAttr
    */
    virtual bool SetStyle(long start, long end, const wxTextAttr& style);

    /**
        Makes the line containing the given position visible.

        @param pos
            The position that should be visible.
    */
    virtual void ShowPosition(long pos);

    /**
        Converts the given zero based column and line number to a position.

        @param x
            The column number.
        @param y
            The line number.

        @return
            The position value, or -1 if x or y was invalid.
    */
    virtual long XYToPosition(long x, long y) const;

    //@{
    /**
        Operator definitions for appending to a text control.

        These operators can be used as with the standard C++ streams, for
        example:
        @code
            wxTextCtrl *wnd = new wxTextCtrl(my_frame);

            (*wnd) << "Welcome to text control number " << 1 << ".\n";
        @endcode
    */

    wxTextCtrl& operator<<(const wxString& s);
    wxTextCtrl& operator<<(int i);
    wxTextCtrl& operator<<(long i);
    wxTextCtrl& operator<<(float f);
    wxTextCtrl& operator<<(double d);
    wxTextCtrl& operator<<(char c);
    wxTextCtrl& operator<<(wchar_t c);
    //@}
};



wxEventType wxEVT_TEXT;
wxEventType wxEVT_TEXT_ENTER;
wxEventType wxEVT_TEXT_URL;
wxEventType wxEVT_TEXT_MAXLEN;


class wxTextUrlEvent : public wxCommandEvent
{
public:
    wxTextUrlEvent(int winid, const wxMouseEvent& evtMouse,
                   long start, long end);

    wxTextUrlEvent(const wxTextUrlEvent& event);

    // get the mouse event which happened over the URL
    const wxMouseEvent& GetMouseEvent() const;

    // get the start of the URL
    long GetURLStart() const;

    // get the end of the URL
    long GetURLEnd() const;

    virtual wxEvent *Clone() const;
};


/**
    @class wxStreamToTextRedirector

    This class can be used to (temporarily) redirect all output sent to a C++
    ostream object to a wxTextCtrl instead.

    @note
        Some compilers and/or build configurations don't support multiply
        inheriting wxTextCtrl from @c std::streambuf in which case this class is
        not compiled in.
        You also must have @c wxUSE_STD_IOSTREAM option on (i.e. set to 1) in your
        @c setup.h to be able to use it. Under Unix, specify @c --enable-std_iostreams
        switch when running configure for this.

    Example of usage:

    @code
    using namespace std;
    wxTextCtrl* text = new wxTextCtrl(...);
    {
        wxStreamToTextRedirector redirect(text);

        // this goes to the text control
        cout << "Hello, text!" << endl;
    }
    // this goes somewhere else, presumably to stdout
    cout << "Hello, console!" << endl;
    @endcode

    @library{wxcore}
    @category{logging}

    @see wxTextCtrl
*/
class wxStreamToTextRedirector
{
public:
    /**
        The constructor starts redirecting output sent to @a ostr or @a cout for
        the default parameter value to the text control @a text.

        @param text
            The text control to append output too, must be non-@NULL
        @param ostr
            The C++ stream to redirect, cout is used if it is @NULL
    */
    wxStreamToTextRedirector(wxTextCtrl *text, ostream* ostr);

    /**
        When a wxStreamToTextRedirector object is destroyed, the redirection is ended
        and any output sent to the C++ ostream which had been specified at the time of
        the object construction will go to its original destination.
    */
    ~wxStreamToTextRedirector();
};