1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxTextAttr
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 The following values can be passed to wxTextAttr::SetAlignment to determine paragraph alignment.
14 enum wxTextAttrAlignment
16 wxTEXT_ALIGNMENT_DEFAULT
,
17 wxTEXT_ALIGNMENT_LEFT
,
18 wxTEXT_ALIGNMENT_CENTRE
,
19 wxTEXT_ALIGNMENT_CENTER
= wxTEXT_ALIGNMENT_CENTRE
,
20 wxTEXT_ALIGNMENT_RIGHT
,
22 /** wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented.
23 In future justification may be supported when printing or previewing, only. */
24 wxTEXT_ALIGNMENT_JUSTIFIED
28 The following values are passed in a bitlist to wxTextAttr::SetFlags() to
29 determine what attributes will be considered when setting the attributes for a text control.
33 wxTEXT_ATTR_TEXT_COLOUR
= 0x00000001,
34 wxTEXT_ATTR_BACKGROUND_COLOUR
= 0x00000002,
35 wxTEXT_ATTR_FONT_FACE
= 0x00000004,
36 wxTEXT_ATTR_FONT_SIZE
= 0x00000008,
37 wxTEXT_ATTR_FONT_WEIGHT
= 0x00000010,
38 wxTEXT_ATTR_FONT_ITALIC
= 0x00000020,
39 wxTEXT_ATTR_FONT_UNDERLINE
= 0x00000040,
40 wxTEXT_ATTR_FONT_ENCODING
= 0x02000000,
41 wxTEXT_ATTR_FONT_FAMILY
= 0x04000000,
43 ( wxTEXT_ATTR_FONT_FACE
| wxTEXT_ATTR_FONT_SIZE
| wxTEXT_ATTR_FONT_WEIGHT
| \
44 wxTEXT_ATTR_FONT_ITALIC
| wxTEXT_ATTR_FONT_UNDERLINE
| wxTEXT_ATTR_FONT_ENCODING
| wxTEXT_ATTR_FONT_FAMILY
),
46 wxTEXT_ATTR_ALIGNMENT
= 0x00000080,
47 wxTEXT_ATTR_LEFT_INDENT
= 0x00000100,
48 wxTEXT_ATTR_RIGHT_INDENT
= 0x00000200,
49 wxTEXT_ATTR_TABS
= 0x00000400,
51 wxTEXT_ATTR_PARA_SPACING_AFTER
= 0x00000800,
52 wxTEXT_ATTR_PARA_SPACING_BEFORE
= 0x00001000,
53 wxTEXT_ATTR_LINE_SPACING
= 0x00002000,
54 wxTEXT_ATTR_CHARACTER_STYLE_NAME
= 0x00004000,
55 wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
= 0x00008000,
56 wxTEXT_ATTR_LIST_STYLE_NAME
= 0x00010000,
57 wxTEXT_ATTR_BULLET_STYLE
= 0x00020000,
58 wxTEXT_ATTR_BULLET_NUMBER
= 0x00040000,
59 wxTEXT_ATTR_BULLET_TEXT
= 0x00080000,
60 wxTEXT_ATTR_BULLET_NAME
= 0x00100000,
61 wxTEXT_ATTR_URL
= 0x00200000,
62 wxTEXT_ATTR_PAGE_BREAK
= 0x00400000,
63 wxTEXT_ATTR_EFFECTS
= 0x00800000,
64 wxTEXT_ATTR_OUTLINE_LEVEL
= 0x01000000,
67 Character and paragraph combined styles
70 wxTEXT_ATTR_CHARACTER
= \
71 (wxTEXT_ATTR_FONT
|wxTEXT_ATTR_EFFECTS
| \
72 wxTEXT_ATTR_BACKGROUND_COLOUR
|wxTEXT_ATTR_TEXT_COLOUR
|wxTEXT_ATTR_CHARACTER_STYLE_NAME
|wxTEXT_ATTR_URL
),
74 wxTEXT_ATTR_PARAGRAPH
= \
75 (wxTEXT_ATTR_ALIGNMENT
|wxTEXT_ATTR_LEFT_INDENT
|wxTEXT_ATTR_RIGHT_INDENT
|wxTEXT_ATTR_TABS
|\
76 wxTEXT_ATTR_PARA_SPACING_BEFORE
|wxTEXT_ATTR_PARA_SPACING_AFTER
|wxTEXT_ATTR_LINE_SPACING
|\
77 wxTEXT_ATTR_BULLET_STYLE
|wxTEXT_ATTR_BULLET_NUMBER
|wxTEXT_ATTR_BULLET_TEXT
|wxTEXT_ATTR_BULLET_NAME
|\
78 wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
|wxTEXT_ATTR_LIST_STYLE_NAME
|wxTEXT_ATTR_OUTLINE_LEVEL
),
80 wxTEXT_ATTR_ALL
= (wxTEXT_ATTR_CHARACTER
|wxTEXT_ATTR_PARAGRAPH
)
84 Styles for wxTextAttr::SetBulletStyle
86 enum wxTextAttrBulletStyle
88 wxTEXT_ATTR_BULLET_STYLE_NONE
= 0x00000000,
89 wxTEXT_ATTR_BULLET_STYLE_ARABIC
= 0x00000001,
90 wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
= 0x00000002,
91 wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
= 0x00000004,
92 wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
= 0x00000008,
93 wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
= 0x00000010,
94 wxTEXT_ATTR_BULLET_STYLE_SYMBOL
= 0x00000020,
96 /** wxTEXT_ATTR_BULLET_STYLE_BITMAP is unimplemented. */
97 wxTEXT_ATTR_BULLET_STYLE_BITMAP
= 0x00000040,
98 wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
= 0x00000080,
99 wxTEXT_ATTR_BULLET_STYLE_PERIOD
= 0x00000100,
100 wxTEXT_ATTR_BULLET_STYLE_STANDARD
= 0x00000200,
101 wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
= 0x00000400,
102 wxTEXT_ATTR_BULLET_STYLE_OUTLINE
= 0x00000800,
104 wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
= 0x00000000,
105 wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
= 0x00001000,
106 wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
= 0x00002000
110 Styles for wxTextAttr::SetTextEffects().
112 Of these, only wxTEXT_ATTR_EFFECT_CAPITALS and wxTEXT_ATTR_EFFECT_STRIKETHROUGH are implemented.
114 enum wxTextAttrEffects
116 wxTEXT_ATTR_EFFECT_NONE
= 0x00000000,
117 wxTEXT_ATTR_EFFECT_CAPITALS
= 0x00000001,
118 wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
= 0x00000002,
119 wxTEXT_ATTR_EFFECT_STRIKETHROUGH
= 0x00000004,
120 wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH
= 0x00000008,
121 wxTEXT_ATTR_EFFECT_SHADOW
= 0x00000010,
122 wxTEXT_ATTR_EFFECT_EMBOSS
= 0x00000020,
123 wxTEXT_ATTR_EFFECT_OUTLINE
= 0x00000040,
124 wxTEXT_ATTR_EFFECT_ENGRAVE
= 0x00000080,
125 wxTEXT_ATTR_EFFECT_SUPERSCRIPT
= 0x00000100,
126 wxTEXT_ATTR_EFFECT_SUBSCRIPT
= 0x00000200
130 Line spacing values; see wxTextAttr::SetLineSpacing().
132 enum wxTextAttrLineSpacing
134 wxTEXT_ATTR_LINE_SPACING_NORMAL
= 10,
135 wxTEXT_ATTR_LINE_SPACING_HALF
= 15,
136 wxTEXT_ATTR_LINE_SPACING_TWICE
= 20
141 Describes the possible return values of wxTextCtrl::HitTest().
143 The element names correspond to the relationship between the point asked
144 for and the character returned, e.g. @c wxTE_HT_BEFORE means that the point
145 is before (leftward or upward) it and so on.
147 enum wxTextCtrlHitTestResult
149 /// Indicates that wxTextCtrl::HitTest() is not implemented on this
151 wxTE_HT_UNKNOWN
= -2,
153 /// The point is before the character returned.
156 /// The point is directly on the character returned.
159 /// The point is below the last line of the control.
162 /// The point is beyond the end of line containing the character returned.
170 wxTextAttr represents the character and paragraph attributes, or style,
171 for a range of text in a wxTextCtrl or wxRichTextCtrl.
173 When setting up a wxTextAttr object, pass a bitlist mask to
174 wxTextAttr::SetFlags() to indicate which style elements should be changed.
175 As a convenience, when you call a setter such as SetFont, the relevant bit
181 @see wxTextCtrl, wxRichTextCtrl
191 wxTextAttr(const wxColour
& colText
,
192 const wxColour
& colBack
= wxNullColour
,
193 const wxFont
& font
= wxNullFont
,
194 wxTextAttrAlignment alignment
= wxTEXT_ALIGNMENT_DEFAULT
);
195 wxTextAttr(const wxTextAttr
& attr
);
199 Applies the attributes in @a style to the original object, but not those
200 attributes from @a style that are the same as those in @a compareWith (if passed).
202 bool Apply(const wxTextAttr
& style
,
203 const wxTextAttr
* compareWith
= NULL
);
206 Creates a font from the font attributes.
208 wxFont
CreateFont() const;
211 Returns the alignment flags.
212 See ::wxTextAttrAlignment for a list of available styles.
214 wxTextAttrAlignment
GetAlignment() const;
217 Returns the background colour.
219 const wxColour
& GetBackgroundColour() const;
222 Returns a string containing the name of the font associated with the bullet symbol.
223 Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
225 const wxString
& GetBulletFont() const;
228 Returns the standard bullet name, applicable if the bullet style is
229 wxTEXT_ATTR_BULLET_STYLE_STANDARD.
231 Currently the following standard bullet names are supported:
234 - @c standard/diamond
235 - @c standard/triangle
238 For wxRichTextCtrl users only: if you wish your rich text controls to support
239 further bullet graphics, you can derive a class from wxRichTextRenderer or
240 wxRichTextStdRenderer, override @c DrawStandardBullet and @c EnumerateStandardBulletNames,
241 and set an instance of the class using wxRichTextBuffer::SetRenderer.
243 const wxString
& GetBulletName() const;
246 Returns the bullet number.
248 int GetBulletNumber() const;
251 Returns the bullet style.
252 See ::wxTextAttrBulletStyle for a list of available styles.
254 int GetBulletStyle() const;
257 Returns the bullet text, which could be a symbol, or (for example) cached
260 const wxString
& GetBulletText() const;
263 Returns the name of the character style.
265 const wxString
& GetCharacterStyleName() const;
268 Returns flags indicating which attributes are applicable.
269 See SetFlags() for a list of available flags.
271 long GetFlags() const;
274 Creates and returns a font specified by the font attributes in the wxTextAttr
275 object. Note that wxTextAttr does not store a wxFont object, so this is only
278 For greater efficiency, access the font attributes directly.
280 wxFont
GetFont() const;
283 Gets the font attributes from the given font, using only the attributes
284 specified by @a flags.
286 bool GetFontAttributes(const wxFont
& font
,
287 int flags
= wxTEXT_ATTR_FONT
);
290 Returns the font encoding.
292 wxFontEncoding
GetFontEncoding() const;
295 Returns the font face name.
297 const wxString
& GetFontFaceName() const;
300 Returns the font family.
302 int GetFontFamily() const;
305 Returns the font size in points.
307 int GetFontSize() const;
310 Returns the font style.
312 int GetFontStyle() const;
315 Returns @true if the font is underlined.
317 bool GetFontUnderlined() const;
320 Returns the font weight.
322 int GetFontWeight() const;
325 Returns the left indent in tenths of a millimetre.
327 long GetLeftIndent() const;
330 Returns the left sub-indent in tenths of a millimetre.
332 long GetLeftSubIndent() const;
335 Returns the line spacing value, one of ::wxTextAttrLineSpacing values.
337 int GetLineSpacing() const;
340 Returns the name of the list style.
342 const wxString
& GetListStyleName() const;
345 Returns the outline level.
347 int GetOutlineLevel() const;
350 Returns the space in tenths of a millimeter after the paragraph.
352 int GetParagraphSpacingAfter() const;
355 Returns the space in tenths of a millimeter before the paragraph.
357 int GetParagraphSpacingBefore() const;
360 Returns the name of the paragraph style.
362 const wxString
& GetParagraphStyleName() const;
365 Returns the right indent in tenths of a millimeter.
367 long GetRightIndent() const;
370 Returns an array of tab stops, each expressed in tenths of a millimeter.
372 Each stop is measured from the left margin and therefore each value must
373 be larger than the last.
375 const wxArrayInt
& GetTabs() const;
378 Returns the text foreground colour.
380 const wxColour
& GetTextColour() const;
383 Returns the text effect bits of interest.
384 See SetFlags() for further information.
386 int GetTextEffectFlags() const;
389 Returns the text effects, a bit list of styles.
390 See SetTextEffects() for details.
392 int GetTextEffects() const;
395 Returns the URL for the content.
397 Content with @a wxTEXT_ATTR_URL style causes wxRichTextCtrl to show a
398 hand cursor over it, and wxRichTextCtrl generates a wxTextUrlEvent
399 when the content is clicked.
401 const wxString
& GetURL() const;
404 Returns @true if the attribute object specifies alignment.
406 bool HasAlignment() const;
409 Returns @true if the attribute object specifies a background colour.
411 bool HasBackgroundColour() const;
414 Returns @true if the attribute object specifies a standard bullet name.
416 bool HasBulletName() const;
419 Returns @true if the attribute object specifies a bullet number.
421 bool HasBulletNumber() const;
424 Returns @true if the attribute object specifies a bullet style.
426 bool HasBulletStyle() const;
429 Returns @true if the attribute object specifies bullet text (usually
430 specifying a symbol).
432 bool HasBulletText() const;
435 Returns @true if the attribute object specifies a character style name.
437 bool HasCharacterStyleName() const;
440 Returns @true if the @a flag is present in the attribute object's flag
443 bool HasFlag(long flag
) const;
446 Returns @true if the attribute object specifies any font attributes.
448 bool HasFont() const;
451 Returns @true if the attribute object specifies an encoding.
453 bool HasFontEncoding() const;
456 Returns @true if the attribute object specifies a font face name.
458 bool HasFontFaceName() const;
461 Returns @true if the attribute object specifies a font family.
463 bool HasFontFamily() const;
466 Returns @true if the attribute object specifies italic style.
468 bool HasFontItalic() const;
471 Returns @true if the attribute object specifies a font point size.
473 bool HasFontSize() const;
476 Returns @true if the attribute object specifies either underlining or no
479 bool HasFontUnderlined() const;
482 Returns @true if the attribute object specifies font weight (bold, light or
485 bool HasFontWeight() const;
488 Returns @true if the attribute object specifies a left indent.
490 bool HasLeftIndent() const;
493 Returns @true if the attribute object specifies line spacing.
495 bool HasLineSpacing() const;
498 Returns @true if the attribute object specifies a list style name.
500 bool HasListStyleName() const;
503 Returns @true if the attribute object specifies an outline level.
505 bool HasOutlineLevel() const;
508 Returns @true if the attribute object specifies a page break before this
511 bool HasPageBreak() const;
514 Returns @true if the attribute object specifies spacing after a paragraph.
516 bool HasParagraphSpacingAfter() const;
519 Returns @true if the attribute object specifies spacing before a paragraph.
521 bool HasParagraphSpacingBefore() const;
524 Returns @true if the attribute object specifies a paragraph style name.
526 bool HasParagraphStyleName() const;
529 Returns @true if the attribute object specifies a right indent.
531 bool HasRightIndent() const;
534 Returns @true if the attribute object specifies tab stops.
536 bool HasTabs() const;
539 Returns @true if the attribute object specifies a text foreground colour.
541 bool HasTextColour() const;
544 Returns @true if the attribute object specifies text effects.
546 bool HasTextEffects() const;
549 Returns @true if the attribute object specifies a URL.
554 Returns @true if the object represents a character style, that is,
555 the flags specify a font or a text background or foreground colour.
557 bool IsCharacterStyle() const;
560 Returns @false if we have any attributes set, @true otherwise.
562 bool IsDefault() const;
565 Returns @true if the object represents a paragraph style, that is,
566 the flags specify alignment, indentation, tabs, paragraph spacing, or
569 bool IsParagraphStyle() const;
572 Copies all defined/valid properties from overlay to current object.
574 void Merge(const wxTextAttr
& overlay
);
577 Creates a new @c wxTextAttr which is a merge of @a base and @a overlay.
579 Properties defined in @a overlay take precedence over those in @a base.
580 Properties undefined/invalid in both are undefined in the result.
582 static wxTextAttr
Merge(const wxTextAttr
& base
,
583 const wxTextAttr
& overlay
);
586 Sets the paragraph alignment. See ::wxTextAttrAlignment enumeration values.
588 Of these, wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented.
589 In future justification may be supported when printing or previewing, only.
591 void SetAlignment(wxTextAttrAlignment alignment
);
594 Sets the background colour.
596 void SetBackgroundColour(const wxColour
& colBack
);
599 Sets the name of the font associated with the bullet symbol.
600 Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
602 void SetBulletFont(const wxString
& font
);
605 Sets the standard bullet name, applicable if the bullet style is
606 wxTEXT_ATTR_BULLET_STYLE_STANDARD.
608 See GetBulletName() for a list of supported names, and how
609 to expand the range of supported types.
611 void SetBulletName(const wxString
& name
);
614 Sets the bullet number.
616 void SetBulletNumber(int n
);
619 Sets the bullet style.
621 The ::wxTextAttrBulletStyle enumeration values are all supported,
622 except for wxTEXT_ATTR_BULLET_STYLE_BITMAP.
624 void SetBulletStyle(int style
);
627 Sets the bullet text, which could be a symbol, or (for example) cached
630 void SetBulletText(const wxString
& text
);
633 Sets the character style name.
635 void SetCharacterStyleName(const wxString
& name
);
638 Sets the flags determining which styles are being specified.
639 The ::wxTextAttrFlags values can be passed in a bitlist.
641 void SetFlags(long flags
);
644 Sets the attributes for the given font.
645 Note that wxTextAttr does not store an actual wxFont object.
647 void SetFont(const wxFont
& font
, int flags
= wxTEXT_ATTR_FONT
);
650 Sets the font encoding.
652 void SetFontEncoding(wxFontEncoding encoding
);
655 Sets the font face name.
657 void SetFontFaceName(const wxString
& faceName
);
660 Sets the font family.
662 void SetFontFamily(int family
);
665 Sets the font size in points.
667 void SetFontSize(int pointSize
);
670 Sets the font style (normal, italic or slanted).
672 void SetFontStyle(int fontStyle
);
675 Sets the font underlining.
677 void SetFontUnderlined(bool underlined
);
680 Sets the font weight.
682 void SetFontWeight(int fontWeight
);
685 Sets the left indent and left subindent in tenths of a millimetre.
686 The sub-indent is an offset from the left of the paragraph, and is used for all
687 but the first line in a paragraph.
689 A positive value will cause the first line to appear to the left
690 of the subsequent lines, and a negative value will cause the first line to be
691 indented relative to the subsequent lines.
693 wxRichTextBuffer uses indentation to render a bulleted item.
694 The left indent is the distance between the margin and the bullet.
695 The content of the paragraph, including the first line, starts
696 at leftMargin + leftSubIndent.
697 So the distance between the left edge of the bullet and the
698 left of the actual paragraph is leftSubIndent.
700 void SetLeftIndent(int indent
, int subIndent
= 0);
703 Sets the line spacing. @a spacing is a multiple, where 10 means single-spacing,
704 15 means 1.5 spacing, and 20 means double spacing.
705 The ::wxTextAttrLineSpacing values are defined for convenience.
707 void SetLineSpacing(int spacing
);
710 Sets the list style name.
712 void SetListStyleName(const wxString
& name
);
715 Specifies the outline level. Zero represents normal text.
716 At present, the outline level is not used, but may be used in future for
717 determining list levels and for applications that need to store document
718 structure information.
720 void SetOutlineLevel(int level
);
723 Specifies a page break before this paragraph.
725 void SetPageBreak(bool pageBreak
= true);
728 Sets the spacing after a paragraph, in tenths of a millimetre.
730 void SetParagraphSpacingAfter(int spacing
);
733 Sets the spacing before a paragraph, in tenths of a millimetre.
735 void SetParagraphSpacingBefore(int spacing
);
738 Sets the name of the paragraph style.
740 void SetParagraphStyleName(const wxString
& name
);
743 Sets the right indent in tenths of a millimetre.
745 void SetRightIndent(int indent
);
748 Sets the tab stops, expressed in tenths of a millimetre.
749 Each stop is measured from the left margin and therefore each value must be
750 larger than the last.
752 void SetTabs(const wxArrayInt
& tabs
);
755 Sets the text foreground colout.
757 void SetTextColour(const wxColour
& colText
);
760 Sets the text effect bits of interest.
762 You should also pass wxTEXT_ATTR_EFFECTS to SetFlags().
763 See SetFlags() for further information.
765 void SetTextEffectFlags(int flags
);
768 Sets the text effects, a bit list of styles.
769 The ::wxTextAttrEffects enumeration values can be used.
771 Of these, only wxTEXT_ATTR_EFFECT_CAPITALS and wxTEXT_ATTR_EFFECT_STRIKETHROUGH
774 wxTEXT_ATTR_EFFECT_CAPITALS capitalises text when displayed (leaving the case
775 of the actual buffer text unchanged), and wxTEXT_ATTR_EFFECT_STRIKETHROUGH draws
778 To set effects, you should also pass wxTEXT_ATTR_EFFECTS to SetFlags(), and call
779 SetTextEffectFlags() with the styles (taken from the above set) that you
780 are interested in setting.
782 void SetTextEffects(int effects
);
785 Sets the URL for the content. Sets the wxTEXT_ATTR_URL style; content with this
786 style causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl
787 generates a wxTextUrlEvent when the content is clicked.
789 void SetURL(const wxString
& url
);
792 Assignment from a wxTextAttr object.
794 void operator operator=(const wxTextAttr
& attr
);
801 A text control allows text to be displayed and edited.
803 It may be single line or multi-line.
806 @style{wxTE_PROCESS_ENTER}
807 The control will generate the event wxEVT_COMMAND_TEXT_ENTER
808 (otherwise pressing Enter key is either processed internally by the
809 control or used for navigation between dialog controls).
810 @style{wxTE_PROCESS_TAB}
811 The control will receive wxEVT_CHAR events for TAB pressed -
812 normally, TAB is used for passing to the next control in a dialog
813 instead. For the control created with this style, you can still use
814 Ctrl-Enter to pass to the next control from the keyboard.
815 @style{wxTE_MULTILINE}
816 The text control allows multiple lines.
817 @style{wxTE_PASSWORD}
818 The text will be echoed as asterisks.
819 @style{wxTE_READONLY}
820 The text will not be user-editable.
822 Use rich text control under Win32, this allows to have more than
823 64KB of text in the control even under Win9x. This style is ignored
824 under other platforms.
826 Use rich text control version 2.0 or 3.0 under Win32, this style is
827 ignored under other platforms
828 @style{wxTE_AUTO_URL}
829 Highlight the URLs and generate the wxTextUrlEvents when mouse
830 events occur over them. This style is only supported for wxTE_RICH
831 Win32 and multi-line wxGTK2 text controls.
832 @style{wxTE_NOHIDESEL}
833 By default, the Windows text control doesn't show the selection
834 when it doesn't have focus - use this style to force it to always
835 show it. It doesn't do anything under other platforms.
837 A horizontal scrollbar will be created and used, so that text won't
838 be wrapped. No effect under wxGTK1.
839 @style{wxTE_NO_VSCROLL}
840 For multiline controls only: vertical scrollbar will never be
841 created. This limits the amount of text which can be entered into
842 the control to what can be displayed in it under MSW but not under
843 GTK2. Currently not implemented for the other platforms.
845 The text in the control will be left-justified (default).
847 The text in the control will be centered (currently wxMSW and
850 The text in the control will be right-justified (currently wxMSW
852 @style{wxTE_DONTWRAP}
853 Same as wxHSCROLL style: don't wrap at all, show horizontal
855 @style{wxTE_CHARWRAP}
856 Wrap the lines too long to be shown entirely at any position
857 (wxUniv and wxGTK2 only).
858 @style{wxTE_WORDWRAP}
859 Wrap the lines too long to be shown entirely at word boundaries
860 (wxUniv and wxGTK2 only).
861 @style{wxTE_BESTWRAP}
862 Wrap the lines at word boundaries or at any other character if
863 there are words longer than the window width (this is the default).
864 @style{wxTE_CAPITALIZE}
865 On PocketPC and Smartphone, causes the first letter to be
869 Note that alignment styles (wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT) can be
870 changed dynamically after control creation on wxMSW and wxGTK. wxTE_READONLY,
871 wxTE_PASSWORD and wrapping styles can be dynamically changed under wxGTK but
872 not wxMSW. The other styles can be only set during control creation.
875 @section textctrl_text_format wxTextCtrl Text Format
877 The multiline text controls always store the text as a sequence of lines
878 separated by @c '\\n' characters, i.e. in the Unix text format even on
879 non-Unix platforms. This allows the user code to ignore the differences
880 between the platforms but at a price: the indices in the control such as
881 those returned by GetInsertionPoint() or GetSelection() can @b not be used
882 as indices into the string returned by GetValue() as they're going to be
883 slightly off for platforms using @c "\\r\\n" as separator (as Windows
886 Instead, if you need to obtain a substring between the 2 indices obtained
887 from the control with the help of the functions mentioned above, you should
888 use GetRange(). And the indices themselves can only be passed to other
889 methods, for example SetInsertionPoint() or SetSelection().
891 To summarize: never use the indices returned by (multiline) wxTextCtrl as
892 indices into the string it contains, but only as arguments to be passed
893 back to the other wxTextCtrl methods. This problem doesn't arise for
894 single-line platforms however where the indices in the control do
895 correspond to the positions in the value string.
898 @section textctrl_styles wxTextCtrl Styles.
900 Multi-line text controls support styling, i.e. provide a possibility to set
901 colours and font for individual characters in it (note that under Windows
902 @c wxTE_RICH style is required for style support). To use the styles you
903 can either call SetDefaultStyle() before inserting the text or call
904 SetStyle() later to change the style of the text already in the control
905 (the first solution is much more efficient).
907 In either case, if the style doesn't specify some of the attributes (for
908 example you only want to set the text colour but without changing the font
909 nor the text background), the values of the default style will be used for
910 them. If there is no default style, the attributes of the text control
913 So the following code correctly describes what it does: the second call to
914 SetDefaultStyle() doesn't change the text foreground colour (which stays
915 red) while the last one doesn't change the background colour (which stays
919 text->SetDefaultStyle(wxTextAttr(*wxRED));
920 text->AppendText("Red text\n");
921 text->SetDefaultStyle(wxTextAttr(wxNullColour, *wxLIGHT_GREY));
922 text->AppendText("Red on grey text\n");
923 text->SetDefaultStyle(wxTextAttr(*wxBLUE);
924 text->AppendText("Blue on grey text\n");
928 @section textctrl_cpp_streams wxTextCtrl and C++ Streams
930 This class multiply-inherits from @c std::streambuf (except for some really
931 old compilers using non-standard iostream library), allowing code such as
935 wxTextCtrl *control = new wxTextCtrl(...);
937 ostream stream(control)
939 stream << 123.456 << " some text\n";
943 Note that even if your compiler doesn't support this (the symbol
944 @c wxHAS_TEXT_WINDOW_STREAM has value of 0 then) you can still use
945 wxTextCtrl itself in a stream-like manner:
948 wxTextCtrl *control = new wxTextCtrl(...);
950 *control << 123.456 << " some text\n";
953 However the possibility to create an ostream associated with wxTextCtrl may
954 be useful if you need to redirect the output of a function taking an
955 ostream as parameter to a text control.
957 Another commonly requested need is to redirect @c std::cout to the text
958 control. This may be done in the following way:
963 wxTextCtrl *control = new wxTextCtrl(...);
965 std::streambuf *sbOld = std::cout.rdbuf();
966 std::cout.rdbuf(control);
968 // use cout as usual, the output appears in the text control
971 std::cout.rdbuf(sbOld);
974 But wxWidgets provides a convenient class to make it even simpler so
975 instead you may just do
980 wxTextCtrl *control = new wxTextCtrl(...);
982 wxStreamToTextRedirector redirect(control);
984 // all output to cout goes into the text control until the exit from
988 See wxStreamToTextRedirector for more details.
991 @section textctrl_event_handling Event Handling.
993 The following commands are processed by default event handlers in
994 wxTextCtrl: @c wxID_CUT, @c wxID_COPY, @c wxID_PASTE, @c wxID_UNDO, @c
995 wxID_REDO. The associated UI update events are also processed
996 automatically, when the control has the focus.
998 @beginEventTable{wxCommandEvent}
999 @event{EVT_TEXT(id, func)}
1000 Respond to a wxEVT_COMMAND_TEXT_UPDATED event, generated when the text
1001 changes. Notice that this event will be sent when the text controls
1002 contents changes -- whether this is due to user input or comes from the
1003 program itself (for example, if wxTextCtrl::SetValue() is called); see
1004 wxTextCtrl::ChangeValue() for a function which does not send this event.
1005 This event is however not sent during the control creation.
1006 @event{EVT_TEXT_ENTER(id, func)}
1007 Respond to a wxEVT_COMMAND_TEXT_ENTER event, generated when enter is
1008 pressed in a text control which must have wxTE_PROCESS_ENTER style for
1009 this event to be generated.
1010 @event{EVT_TEXT_URL(id, func)}
1011 A mouse event occurred over an URL in the text control (wxMSW and
1012 wxGTK2 only currently).
1013 @event{EVT_TEXT_MAXLEN(id, func)}
1014 This event is generated when the user tries to enter more text into the
1015 control than the limit set by wxTextCtrl::SetMaxLength(), see its description.
1020 @appearance{textctrl.png}
1022 @see wxTextCtrl::Create, wxValidator
1024 class wxTextCtrl
: public wxControl
1033 Constructor, creating and showing a text control.
1036 Parent window. Should not be @NULL.
1038 Control identifier. A value of -1 denotes a default value.
1042 Text control position.
1046 Window style. See wxTextCtrl.
1053 The horizontal scrollbar (wxHSCROLL style flag) will only be
1054 created for multi-line text controls. Without a horizontal
1055 scrollbar, text lines that don't fit in the control's size will be
1056 wrapped (but no newline character is inserted).
1057 Single line controls don't have a horizontal scrollbar, the text is
1058 automatically scrolled so that the insertion point is always visible.
1060 @see Create(), wxValidator
1062 wxTextCtrl(wxWindow
* parent
, wxWindowID id
,
1063 const wxString
& value
= wxEmptyString
,
1064 const wxPoint
& pos
= wxDefaultPosition
,
1065 const wxSize
& size
= wxDefaultSize
,
1067 const wxValidator
& validator
= wxDefaultValidator
,
1068 const wxString
& name
= wxTextCtrlNameStr
);
1071 Destructor, destroying the text control.
1073 virtual ~wxTextCtrl();
1076 Appends the text to the end of the text control.
1079 Text to write to the text control.
1082 After the text is appended, the insertion point will be at the
1083 end of the text control. If this behaviour is not desired, the
1084 programmer should use GetInsertionPoint() and SetInsertionPoint().
1088 virtual void AppendText(const wxString
& text
);
1091 Call this function to enable auto-completion of the text typed in a
1092 single-line text control using the given @a choices.
1094 Notice that currently this function is only implemented in wxGTK2 and
1095 wxMSW ports and does nothing under the other platforms.
1100 @true if the auto-completion was enabled or @false if the operation
1101 failed, typically because auto-completion is not supported by the
1104 @see AutoCompleteFileNames()
1106 virtual bool AutoComplete(const wxArrayString
& choices
);
1109 Call this function to enable auto-completion of the text typed in a
1110 single-line text control using all valid file system paths.
1112 Notice that currently this function is only implemented in wxGTK2 port
1113 and does nothing under the other platforms.
1118 @true if the auto-completion was enabled or @false if the operation
1119 failed, typically because auto-completion is not supported by the
1124 virtual bool AutoCompleteFileNames();
1127 Returns @true if the selection can be copied to the clipboard.
1129 virtual bool CanCopy() const;
1132 Returns @true if the selection can be cut to the clipboard.
1134 virtual bool CanCut() const;
1137 Returns @true if the contents of the clipboard can be pasted into the
1140 On some platforms (Motif, GTK) this is an approximation and returns
1141 @true if the control is editable, @false otherwise.
1143 virtual bool CanPaste() const;
1146 Returns @true if there is a redo facility available and the last
1147 operation can be redone.
1149 virtual bool CanRedo() const;
1152 Returns @true if there is an undo facility available and the last
1153 operation can be undone.
1155 virtual bool CanUndo() const;
1158 Sets the new text control value.
1160 It also marks the control as not-modified which means that IsModified()
1161 would return @false immediately after the call to SetValue().
1163 The insertion point is set to the start of the control (i.e. position
1164 0) by this function.
1166 This functions does not generate the @c wxEVT_COMMAND_TEXT_UPDATED
1167 event but otherwise is identical to SetValue().
1169 See @ref overview_eventhandling_prog for more information.
1174 The new value to set. It may contain newline characters if the text
1175 control is multi-line.
1177 virtual void ChangeValue(const wxString
& value
);
1180 Clears the text in the control.
1182 Note that this function will generate a @c wxEVT_COMMAND_TEXT_UPDATED
1183 event, i.e. its effect is identical to calling @c SetValue("").
1185 virtual void Clear();
1188 Copies the selected text to the clipboard.
1190 virtual void Copy();
1193 Creates the text control for two-step construction.
1195 This method should be called if the default constructor was used for
1196 the control creation. Its parameters have the same meaning as for the
1197 non-default constructor.
1199 bool Create(wxWindow
* parent
, wxWindowID id
,
1200 const wxString
& value
= wxEmptyString
,
1201 const wxPoint
& pos
= wxDefaultPosition
,
1202 const wxSize
& size
= wxDefaultSize
, long style
= 0,
1203 const wxValidator
& validator
= wxDefaultValidator
,
1204 const wxString
& name
= wxTextCtrlNameStr
);
1207 Copies the selected text to the clipboard and removes the selection.
1212 Resets the internal modified flag as if the current changes had been
1215 virtual void DiscardEdits();
1218 This functions inserts into the control the character which would have
1219 been inserted if the given key event had occurred in the text control.
1221 The @a event object should be the same as the one passed to @c EVT_KEY_DOWN
1222 handler previously by wxWidgets. Please note that this function doesn't
1223 currently work correctly for all keys under any platform but MSW.
1226 @true if the event resulted in a change to the control, @false otherwise.
1228 virtual bool EmulateKeyPress(const wxKeyEvent
& event
);
1231 Returns the style currently used for the new text.
1233 @see SetDefaultStyle()
1235 virtual const wxTextAttr
& GetDefaultStyle() const;
1238 Returns the insertion point, or cursor, position.
1240 This is defined as the zero based index of the character position to
1241 the right of the insertion point. For example, if the insertion point
1242 is at the end of the single-line text control, it is equal to both
1243 GetLastPosition() and @c "GetValue().Length()" (but notice that the latter
1244 equality is not necessarily true for multiline edit controls which may
1245 use multiple new line characters).
1247 The following code snippet safely returns the character at the insertion
1248 point or the zero character if the point is at the end of the control.
1251 char GetCurrentChar(wxTextCtrl *tc) {
1252 if (tc->GetInsertionPoint() == tc->GetLastPosition())
1254 return tc->GetValue[tc->GetInsertionPoint()];
1258 virtual long GetInsertionPoint() const;
1261 Returns the zero based index of the last position in the text control,
1262 which is equal to the number of characters in the control.
1264 virtual wxTextPos
GetLastPosition() const;
1267 Gets the length of the specified line, not including any trailing
1268 newline character(s).
1271 Line number (starting from zero).
1274 The length of the line, or -1 if @a lineNo was invalid.
1276 virtual int GetLineLength(long lineNo
) const;
1279 Returns the contents of a given line in the text control, not including
1280 any trailing newline character(s).
1283 The line number, starting from zero.
1286 The contents of the line.
1288 virtual wxString
GetLineText(long lineNo
) const;
1291 Returns the number of lines in the text control buffer.
1294 Note that even empty text controls have one line (where the
1295 insertion point is), so GetNumberOfLines() never returns 0.
1296 For wxGTK using GTK+ 1.2.x and earlier, the number of lines in a
1297 multi-line text control is calculated by actually counting newline
1298 characters in the buffer, i.e. this function returns the number of
1299 logical lines and doesn't depend on whether any of them are wrapped.
1300 For all the other platforms, the number of physical lines in the
1301 control is returned.
1302 Also note that you may wish to avoid using functions that work with
1303 line numbers if you are working with controls that contain large
1304 amounts of text as this function has O(N) complexity for N being
1305 the number of lines.
1307 virtual int GetNumberOfLines() const;
1310 Returns the string containing the text starting in the positions
1311 @a from and up to @a to in the control.
1313 The positions must have been returned by another wxTextCtrl method.
1314 Please note that the positions in a multiline wxTextCtrl do @b not
1315 correspond to the indices in the string returned by GetValue() because
1316 of the different new line representations (@c CR or @c CR LF) and so
1317 this method should be used to obtain the correct results instead of
1318 extracting parts of the entire value. It may also be more efficient,
1319 especially if the control contains a lot of data.
1321 virtual wxString
GetRange(long from
, long to
) const;
1324 Gets the current selection span.
1326 If the returned values are equal, there was no selection. Please note
1327 that the indices returned may be used with the other wxTextCtrl methods
1328 but don't necessarily represent the correct indices into the string
1329 returned by GetValue() for multiline controls under Windows (at least,)
1330 you should use GetStringSelection() to get the selected text.
1333 The returned first position.
1335 The returned last position.
1337 virtual void GetSelection(long* from
, long* to
) const;
1340 Gets the text currently selected in the control.
1342 If there is no selection, the returned string is empty.
1344 virtual wxString
GetStringSelection() const;
1347 Returns the style at this position in the text control.
1349 Not all platforms support this function.
1352 @true on success, @false if an error occurred (this may also mean
1353 that the styles are not supported under this platform).
1355 @see SetStyle(), wxTextAttr
1357 virtual bool GetStyle(long position
, wxTextAttr
& style
);
1360 Gets the contents of the control.
1362 Notice that for a multiline text control, the lines will be separated
1363 by (Unix-style) @c \\n characters, even under Windows where they are
1364 separated by a @c \\r\\n sequence in the native control.
1366 virtual wxString
GetValue() const;
1369 This function finds the character at the specified position expressed
1372 If the return code is not @c wxTE_HT_UNKNOWN the row and column of the
1373 character closest to this position are returned in the @a col and @a
1374 row parameters (unless the pointers are @NULL which is allowed).
1375 Please note that this function is currently only implemented in wxUniv, wxMSW
1378 @see PositionToXY(), XYToPosition()
1380 wxTextCtrlHitTestResult
HitTest(const wxPoint
& pt
,
1382 wxTextCoord row
) const;
1385 Returns @true if the controls contents may be edited by user (note that
1386 it always can be changed by the program).
1388 In other words, this functions returns @true if the control hasn't been
1389 put in read-only mode by a previous call to SetEditable().
1391 virtual bool IsEditable() const;
1394 Returns @true if the control is currently empty.
1396 This is the same as @c GetValue().empty() but can be much more
1397 efficient for the multiline controls containing big amounts of text.
1401 virtual bool IsEmpty() const;
1404 Returns @true if the text has been modified by user.
1406 Note that calling SetValue() doesn't make the control modified.
1410 virtual bool IsModified() const;
1413 Returns @true if this is a multi line edit control and @false otherwise.
1417 bool IsMultiLine() const;
1420 Returns @true if this is a single line edit control and @false otherwise.
1422 @see IsSingleLine(), IsMultiLine()
1424 bool IsSingleLine() const;
1427 Loads and displays the named file, if it exists.
1430 The filename of the file to load.
1432 The type of file to load. This is currently ignored in wxTextCtrl.
1435 @true if successful, @false otherwise.
1437 bool LoadFile(const wxString
& filename
,
1438 int fileType
= wxTEXT_TYPE_ANY
);
1441 Mark text as modified (dirty).
1445 virtual void MarkDirty();
1448 This event handler function implements default drag and drop behaviour,
1449 which is to load the first dropped file into the control.
1452 The drop files event.
1454 @remarks This is not implemented on non-Windows platforms.
1456 @see wxDropFilesEvent
1458 void OnDropFiles(wxDropFilesEvent
& event
);
1461 Pastes text from the clipboard to the text item.
1463 virtual void Paste();
1466 Converts given position to a zero-based column, line number pair.
1471 Receives zero based column number.
1473 Receives zero based line number.
1476 @true on success, @false on failure (most likely due to a too large
1477 position parameter).
1481 virtual bool PositionToXY(long pos
, long* x
, long* y
) const;
1484 If there is a redo facility and the last operation can be redone,
1485 redoes the last operation.
1487 Does nothing if there is no redo facility.
1489 virtual void Redo();
1492 Removes the text starting at the first given position up to
1493 (but not including) the character at the last position.
1495 This function puts the current insertion point position at @a to as a
1503 virtual void Remove(long from
, long to
);
1506 Replaces the text starting at the first position up to
1507 (but not including) the character at the last position with the given text.
1509 This function puts the current insertion point position at @a to as a
1517 The value to replace the existing text with.
1519 virtual void Replace(long from
, long to
, const wxString
& value
);
1522 Saves the contents of the control in a text file.
1525 The name of the file in which to save the text.
1527 The type of file to save. This is currently ignored in wxTextCtrl.
1530 @true if the operation was successful, @false otherwise.
1532 bool SaveFile(const wxString
& filename
= wxEmptyString
,
1533 int fileType
= wxTEXT_TYPE_ANY
);
1536 Changes the default style to use for the new text which is going to be
1537 added to the control using WriteText() or AppendText().
1539 If either of the font, foreground, or background colour is not set in
1540 @a style, the values of the previous default style are used for them.
1541 If the previous default style didn't set them neither, the global font
1542 or colours of the text control itself are used as fall back.
1544 However if the @a style parameter is the default wxTextAttr, then the default
1545 style is just reset (instead of being combined with the new style which
1546 wouldn't change it at all).
1549 The style for the new text.
1552 @true on success, @false if an error occurred (this may also mean
1553 that the styles are not supported under this platform).
1555 @see GetDefaultStyle()
1557 virtual bool SetDefaultStyle(const wxTextAttr
& style
);
1560 Makes the text item editable or read-only, overriding the
1561 @b wxTE_READONLY flag.
1564 If @true, the control is editable. If @false, the control is
1569 virtual void SetEditable(bool editable
);
1572 Sets the insertion point at the given position.
1575 Position to set, in the range from 0 to GetLastPosition() inclusive.
1577 virtual void SetInsertionPoint(long pos
);
1580 Sets the insertion point at the end of the text control.
1582 This is equivalent to calling wxTextCtrl::SetInsertionPoint() with
1583 wxTextCtrl::GetLastPosition() argument.
1585 virtual void SetInsertionPointEnd();
1588 This function sets the maximum number of characters the user can enter
1591 In other words, it allows to limit the text value length to @a len not
1592 counting the terminating @c NUL character.
1594 If @a len is 0, the previously set max length limit, if any, is discarded
1595 and the user may enter as much text as the underlying native text control widget
1596 supports (typically at least 32Kb).
1597 If the user tries to enter more characters into the text control when it
1598 already is filled up to the maximal length, a @c wxEVT_COMMAND_TEXT_MAXLEN
1599 event is sent to notify the program about it (giving it the possibility
1600 to show an explanatory message, for example) and the extra input is discarded.
1602 Note that in wxGTK this function may only be used with single line text controls.
1604 virtual void SetMaxLength(unsigned long len
);
1607 Marks the control as being modified by the user or not.
1609 @see MarkDirty(), DiscardEdits()
1611 void SetModified(bool modified
);
1614 Selects the text starting at the first position up to (but not
1615 including) the character at the last position.
1617 If both parameters are equal to -1 all text in the control is selected.
1619 Notice that the insertion point will be moved to @a from by this
1629 virtual void SetSelection(long from
, long to
);
1632 Selects all text in the control.
1636 virtual void SelectAll();
1639 Changes the style of the given range.
1641 If any attribute within @a style is not set, the corresponding
1642 attribute from GetDefaultStyle() is used.
1645 The start of the range to change.
1647 The end of the range to change.
1649 The new style for the range.
1652 @true on success, @false if an error occurred (this may also mean
1653 that the styles are not supported under this platform).
1655 @see GetStyle(), wxTextAttr
1657 virtual bool SetStyle(long start
, long end
, const wxTextAttr
& style
);
1660 Sets the new text control value.
1662 It also marks the control as not-modified which means that IsModified()
1663 would return @false immediately after the call to SetValue().
1665 The insertion point is set to the start of the control (i.e. position
1666 0) by this function.
1668 Note that, unlike most other functions changing the controls values,
1669 this function generates a @c wxEVT_COMMAND_TEXT_UPDATED event. To avoid
1670 this you can use ChangeValue() instead.
1673 The new value to set. It may contain newline characters if the text
1674 control is multi-line.
1676 virtual void SetValue(const wxString
& value
);
1679 Makes the line containing the given position visible.
1682 The position that should be visible.
1684 virtual void ShowPosition(long pos
);
1687 If there is an undo facility and the last operation can be undone,
1688 undoes the last operation.
1690 Does nothing if there is no undo facility.
1692 virtual void Undo();
1695 Writes the text into the text control at the current insertion position.
1698 Text to write to the text control.
1701 Newlines in the text string are the only control characters
1702 allowed, and they will cause appropriate line breaks.
1703 See operator<<() and AppendText() for more convenient ways of
1704 writing to the window.
1705 After the write operation, the insertion point will be at the end
1706 of the inserted text, so subsequent write operations will be appended.
1707 To append text after the user may have interacted with the control,
1708 call wxTextCtrl::SetInsertionPointEnd() before writing.
1710 virtual void WriteText(const wxString
& text
);
1713 Converts the given zero based column and line number to a position.
1721 The position value, or -1 if x or y was invalid.
1723 virtual long XYToPosition(long x
, long y
) const;
1727 Operator definitions for appending to a text control.
1729 These operators can be used as with the standard C++ streams, for
1732 wxTextCtrl *wnd = new wxTextCtrl(my_frame);
1734 (*wnd) << "Welcome to text control number " << 1 << ".\n";
1738 wxTextCtrl
& operator<<(const wxString
& s
);
1739 wxTextCtrl
& operator<<(int i
);
1740 wxTextCtrl
& operator<<(long i
);
1741 wxTextCtrl
& operator<<(float f
);
1742 wxTextCtrl
& operator<<(double d
);
1743 wxTextCtrl
& operator<<(char c
);
1744 wxTextCtrl
& operator<<(wchar_t c
);
1751 @class wxStreamToTextRedirector
1753 This class can be used to (temporarily) redirect all output sent to a C++
1754 ostream object to a wxTextCtrl instead.
1757 Some compilers and/or build configurations don't support multiply
1758 inheriting wxTextCtrl from @c std::streambuf in which case this class is
1760 You also must have @c wxUSE_STD_IOSTREAM option on (i.e. set to 1) in your
1761 @c setup.h to be able to use it. Under Unix, specify @c --enable-std_iostreams
1762 switch when running configure for this.
1767 using namespace std;
1768 wxTextCtrl* text = new wxTextCtrl(...);
1770 wxStreamToTextRedirector redirect(text);
1772 // this goes to the text control
1773 cout << "Hello, text!" << endl;
1775 // this goes somewhere else, presumably to stdout
1776 cout << "Hello, console!" << endl;
1784 class wxStreamToTextRedirector
1788 The constructor starts redirecting output sent to @a ostr or @a cout for
1789 the default parameter value to the text control @a text.
1792 The text control to append output too, must be non-@NULL
1794 The C++ stream to redirect, cout is used if it is @NULL
1796 wxStreamToTextRedirector(wxTextCtrl
*text
, ostream
* ostr
);
1799 When a wxStreamToTextRedirector object is destroyed, the redirection is ended
1800 and any output sent to the C++ ostream which had been specified at the time of
1801 the object construction will go to its original destination.
1803 ~wxStreamToTextRedirector();