2006-07-01 16:30:58 -04:00
\section { \class { wxRichTextAttr} } \label { wxrichtextattr}
wxRichTextAttr represents the character and paragraph attributes, or style,
for a range of text in a \helpref { wxRichTextCtrl} { wxrichtextctrl} . This class
is specific to wxRichTextCtrl, although you can also use the
standard \helpref { wxTextAttr} { wxtextattr} class with wxRichTextCtrl.
When setting up a wxRichTextAttr object, pass a bitlist mask to \helpref { SetFlags} { wxrichtextattrsetflags} to
indicate which style elements should be changed. As a convenience, when you call a setter such
2006-11-09 15:22:33 -05:00
as SetFont, the relevant bit will be set.
2006-07-01 16:30:58 -04:00
2006-11-09 15:22:33 -05:00
wxRichTextAttr stores attributes without a wxFont object, so is a more
2006-07-01 16:30:58 -04:00
efficient way to query styles than using a \helpref { wxTextAttr} { wxtextattr} or \helpref { wxTextAttrEx} { wxtextattrex} object.
\wxheading { Derived from}
No base class
\wxheading { Include files}
<wx/richtext/richtextbuffer.h>
\wxheading { Constants}
2006-11-09 15:22:33 -05:00
The following values can be passed to wxRichTextAttr::SetAlignment to determine
2006-07-01 16:30:58 -04:00
paragraph alignment.
{ \small
\begin { verbatim}
enum wxTextAttrAlignment
{
wxTEXT_ ALIGNMENT_ DEFAULT,
wxTEXT_ ALIGNMENT_ LEFT,
wxTEXT_ ALIGNMENT_ CENTRE,
wxTEXT_ ALIGNMENT_ CENTER = wxTEXT_ ALIGNMENT_ CENTRE,
wxTEXT_ ALIGNMENT_ RIGHT,
wxTEXT_ ALIGNMENT_ JUSTIFIED
} ;
\end { verbatim}
}
2006-11-09 15:22:33 -05:00
Of these, wxTEXT\_ ALIGNMENT\_ JUSTIFIED is unimplemented. In future justification may be supported
when printing or previewing, only.
The following values are passed in a bitlist to wxRichTextAttr::SetFlags to determine
2006-07-01 16:30:58 -04:00
what attributes will be considered when setting the attributes
for a text control.
{ \small
\begin { verbatim}
// Standard wxTextAttr constants
2006-11-09 15:22:33 -05:00
#define wxTEXT_ ATTR_ TEXT_ COLOUR 0x00000001
#define wxTEXT_ ATTR_ BACKGROUND_ COLOUR 0x00000002
#define wxTEXT_ ATTR_ FONT_ FACE 0x00000004
#define wxTEXT_ ATTR_ FONT_ SIZE 0x00000008
#define wxTEXT_ ATTR_ FONT_ WEIGHT 0x00000010
#define wxTEXT_ ATTR_ FONT_ ITALIC 0x00000020
#define wxTEXT_ ATTR_ FONT_ UNDERLINE 0x00000040
2006-07-01 16:30:58 -04:00
#define wxTEXT_ ATTR_ FONT \
wxTEXT_ ATTR_ FONT_ FACE | wxTEXT_ ATTR_ FONT_ SIZE | wxTEXT_ ATTR_ FONT_ WEIGHT \
| wxTEXT_ ATTR_ FONT_ ITALIC | wxTEXT_ ATTR_ FONT_ UNDERLINE
2006-11-09 15:22:33 -05:00
#define wxTEXT_ ATTR_ ALIGNMENT 0x00000080
#define wxTEXT_ ATTR_ LEFT_ INDENT 0x00000100
#define wxTEXT_ ATTR_ RIGHT_ INDENT 0x00000200
#define wxTEXT_ ATTR_ TABS 0x00000400
2006-07-01 16:30:58 -04:00
// Extra formatting flags not in wxTextAttr
#define wxTEXT_ ATTR_ PARA_ SPACING_ AFTER 0x00000800
#define wxTEXT_ ATTR_ PARA_ SPACING_ BEFORE 0x00001000
#define wxTEXT_ ATTR_ LINE_ SPACING 0x00002000
#define wxTEXT_ ATTR_ CHARACTER_ STYLE_ NAME 0x00004000
#define wxTEXT_ ATTR_ PARAGRAPH_ STYLE_ NAME 0x00008000
2006-10-26 02:32:47 -04:00
#define wxTEXT_ ATTR_ LIST_ STYLE_ NAME 0x00010000
#define wxTEXT_ ATTR_ BULLET_ STYLE 0x00020000
#define wxTEXT_ ATTR_ BULLET_ NUMBER 0x00040000
#define wxTEXT_ ATTR_ BULLET_ TEXT 0x00080000
#define wxTEXT_ ATTR_ BULLET_ NAME 0x00100000
#define wxTEXT_ ATTR_ URL 0x00200000
2006-10-30 12:52:14 -05:00
#define wxTEXT_ ATTR_ PAGE_ BREAK 0x00400000
2006-11-09 15:22:33 -05:00
#define wxTEXT_ ATTR_ EFFECTS 0x00800000
2006-11-10 10:48:46 -05:00
#define wxTEXT_ ATTR_ OUTLINE_ LEVEL 0x01000000
2006-07-01 16:30:58 -04:00
\end { verbatim}
}
The following styles can be passed to wxRichTextAttr::SetBulletStyle:
{ \small
\begin { verbatim}
2006-10-26 02:32:47 -04:00
#define wxTEXT_ ATTR_ BULLET_ STYLE_ NONE 0x00000000
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ARABIC 0x00000001
#define wxTEXT_ ATTR_ BULLET_ STYLE_ LETTERS_ UPPER 0x00000002
#define wxTEXT_ ATTR_ BULLET_ STYLE_ LETTERS_ LOWER 0x00000004
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ROMAN_ UPPER 0x00000008
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ROMAN_ LOWER 0x00000010
#define wxTEXT_ ATTR_ BULLET_ STYLE_ SYMBOL 0x00000020
#define wxTEXT_ ATTR_ BULLET_ STYLE_ BITMAP 0x00000040
#define wxTEXT_ ATTR_ BULLET_ STYLE_ PARENTHESES 0x00000080
#define wxTEXT_ ATTR_ BULLET_ STYLE_ PERIOD 0x00000100
#define wxTEXT_ ATTR_ BULLET_ STYLE_ STANDARD 0x00000200
#define wxTEXT_ ATTR_ BULLET_ STYLE_ RIGHT_ PARENTHESIS 0x00000400
#define wxTEXT_ ATTR_ BULLET_ STYLE_ OUTLINE 0x00000800
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ALIGN_ LEFT 0x00000000
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ALIGN_ RIGHT 0x00001000
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ALIGN_ CENTRE 0x00002000
2006-07-01 16:30:58 -04:00
\end { verbatim}
}
2006-11-09 15:22:33 -05:00
Of these, wxTEXT\_ ATTR\_ BULLET\_ STYLE\_ BITMAP is unimplemented.
2006-07-01 16:30:58 -04:00
The following constants can be passed to wxRichTextAttr::SetLineSpacing:
{ \small
\begin { verbatim}
#define wxTEXT_ ATTR_ LINE_ SPACING_ NORMAL 10
#define wxTEXT_ ATTR_ LINE_ SPACING_ HALF 15
#define wxTEXT_ ATTR_ LINE_ SPACING_ TWICE 20
\end { verbatim}
}
2006-11-09 15:22:33 -05:00
The following styles can be passed to wxTextAttrEx::SetTextEffects:
{ \small
\begin { verbatim}
#define wxTEXT_ ATTR_ EFFECT_ NONE 0x00000000
#define wxTEXT_ ATTR_ EFFECT_ CAPITALS 0x00000001
#define wxTEXT_ ATTR_ EFFECT_ SMALL_ CAPITALS 0x00000002
#define wxTEXT_ ATTR_ EFFECT_ STRIKETHROUGH 0x00000004
#define wxTEXT_ ATTR_ EFFECT_ DOUBLE_ STRIKETHROUGH 0x00000008
#define wxTEXT_ ATTR_ EFFECT_ SHADOW 0x00000010
#define wxTEXT_ ATTR_ EFFECT_ EMBOSS 0x00000020
#define wxTEXT_ ATTR_ EFFECT_ OUTLINE 0x00000040
#define wxTEXT_ ATTR_ EFFECT_ ENGRAVE 0x00000080
#define wxTEXT_ ATTR_ EFFECT_ SUPERSCRIPT 0x00000100
#define wxTEXT_ ATTR_ EFFECT_ SUBSCRIPT 0x00000200
\end { verbatim}
}
Of these, only wxTEXT\_ ATTR\_ EFFECT\_ CAPITALS and wxTEXT\_ ATTR\_ EFFECT\_ STRIKETHROUGH are implemented.
2006-07-01 16:30:58 -04:00
\wxheading { See also}
\helpref { wxTextAttr} { wxtextattr} , \helpref { wxTextAttrEx} { wxtextattrex} , \helpref { wxRichTextCtrl} { wxrichtextctrl}
\latexignore { \rtfignore { \wxheading { Members} } }
\membersection { wxRichTextAttr::wxRichTextAttr} \label { wxrichtextattrwxrichtextattr}
\func { } { wxRichTextAttr} { \void }
\func { } { wxRichTextAttr} { \param { const wxColour\& } { colText} , \param { const wxColour\& } { colBack = wxNullColour} , \param { wxTextAttrAlignment } { alignment = wxTEXT\_ ALIGNMENT\_ DEFAULT} }
\func { } { wxRichTextAttr} { \param { const wxTextAttrEx\& } { attr} }
Constructors.
2006-07-24 14:20:18 -04:00
\membersection { wxRichTextAttr::Apply} \label { wxrichtextattrapply}
2006-07-01 16:30:58 -04:00
2006-07-24 14:20:18 -04:00
\func { bool} { Combine} { \param { const wxRichTextAttrEx\& } { style} , \param { const wxRichTextAttrEx* } { compareWith = NULL} }
2006-07-01 16:30:58 -04:00
2006-07-24 14:20:18 -04:00
Applies the attributes in { \it style} to the original object, but not those attributes from { \it style} that are the same as those in { \it compareWith} (if passed).
See also \helpref { wxRichTextAttr::Combine} { wxrichtextattrcombine} for a function that does almost the same but returns a new object instead of modifying the original object.
\membersection { wxRichTextAttr::Combine} \label { wxrichtextattrcombine}
\constfunc { wxRichTextAttr} { Combine} { \param { const wxRichTextAttrEx\& } { style} , \param { const wxRichTextAttrEx* } { compareWith = NULL} }
Combines 'this' with { \it style} , but not applying attributes from { \it style} that are the same as those in { \it compareWith} (if passed).
A wxRichTextAttr object is returned and the original object is not changed.
See also \helpref { wxRichTextAttr::Apply} { wxrichtextattrapply} for a function that does almost the same but modifies the original object instead of returning a new one.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::CreateFont} \label { wxrichtextattrcreatefont}
\constfunc { wxFont} { CreateFont} { \void }
Creates a font from the font attributes.
\membersection { wxRichTextAttr::GetAlignment} \label { wxrichtextattrgetalignment}
\constfunc { wxTextAttrAlignment} { GetAlignment} { \void }
Returns the alignment flags.
See \helpref { wxRichTextAttr::SetAlignment} { wxrichtextattrsetalignment} for a list of available styles.
\membersection { wxRichTextAttr::GetBackgroundColour} \label { wxrichtextattrgetbackgroundcolour}
\constfunc { const wxColour\& } { GetBackgroundColour} { \void }
Returns the background colour.
2006-10-10 12:48:47 -04:00
\membersection { wxRichTextAttr::GetBulletFont} \label { wxrichtextattrgetbulletfont}
\constfunc { const wxString\& } { GetBulletFont} { \void }
Returns a string containing the name of the font associated with the bullet symbol.
Only valid for attributes with wxTEXT\_ ATTR\_ BULLET\_ SYMBOL.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::GetBulletName} \label { wxrichtextattrgetbulletname}
\constfunc { const wxString\& } { GetBulletName} { \void }
Returns the standard bullet name, applicable if the bullet style is wxTEXT\_ ATTR\_ BULLET\_ STYLE\_ STANDARD.
Currently the following standard bullet names are supported:
\begin { itemize} \itemsep =0pt
\item { \tt standard/circle}
\item { \tt standard/square}
\item { \tt standard/diamond}
\item { \tt standard/triangle}
\end { itemize}
If you wish your application to support further bullet graphics, you can derive a
class from wxRichTextRenderer or wxRichTextStdRenderer, override { \tt DrawStandardBullet} and { \tt EnumerateStandardBulletNames} , and
set an instance of the class using \helpref { wxRichTextBuffer::SetRenderer} { wxrichtextbuffersetrenderer} .
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::GetBulletNumber} \label { wxrichtextattrgetbulletnumber}
\constfunc { int} { GetBulletNumber} { \void }
Returns the bullet number.
\membersection { wxRichTextAttr::GetBulletStyle} \label { wxrichtextattrgetbulletstyle}
\constfunc { int} { GetBulletStyle} { \void }
Returns the bullet style.
See \helpref { wxRichTextAttr::SetBulletStyle} { wxrichtextattrsetbulletstyle} for a list of available styles.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::GetBulletText} \label { wxrichtextattrgetbullettext}
2006-07-01 16:30:58 -04:00
2006-10-26 02:32:47 -04:00
\constfunc { const wxString\& } { GetBulletText} { \void }
2006-07-01 16:30:58 -04:00
2006-10-26 02:32:47 -04:00
Returns the bullet text, which could be a symbol, or (for example) cached outline text.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::GetCharacterStyleName} \label { wxrichtextattrgetcharacterstylename}
\constfunc { const wxString\& } { GetCharacterStyleName} { \void }
Returns the name of the character style.
\membersection { wxRichTextAttr::GetFlags} \label { wxrichtextattrgetflags}
\constfunc { long} { GetFlags} { \void }
Returns flags indicating which attributes are applicable.
See \helpref { wxRichTextAttr::SetFlags} { wxrichtextattrsetflags} for a list of available flags.
\membersection { wxRichTextAttr::GetFontAttributes} \label { wxrichtextattrgetfontattributes}
\func { bool} { GetFontAttributes} { \param { const wxFont\& } { font} }
Sets the font attributes from the given font.
\membersection { wxRichTextAttr::GetFontFaceName} \label { wxrichtextattrgetfontfacename}
\constfunc { const wxString\& } { GetFontFaceName} { \void }
Returns the font face name.
\membersection { wxRichTextAttr::GetFontSize} \label { wxrichtextattrgetfontsize}
\constfunc { int} { GetFontSize} { \void }
Returns the font size in points.
\membersection { wxRichTextAttr::GetFontStyle} \label { wxrichtextattrgetfontstyle}
\constfunc { int} { GetFontStyle} { \void }
Returns the font style.
\membersection { wxRichTextAttr::GetFontUnderlined} \label { wxrichtextattrgetfontunderlined}
\constfunc { bool} { GetFontUnderlined} { \void }
Returns \true if the font is underlined.
\membersection { wxRichTextAttr::GetFontWeight} \label { wxrichtextattrgetfontweight}
\constfunc { int} { GetFontWeight} { \void }
Returns the font weight.
\membersection { wxRichTextAttr::GetLeftIndent} \label { wxrichtextattrgetleftindent}
\constfunc { long} { GetLeftIndent} { \void }
Returns the left indent in tenths of a millimetre.
\membersection { wxRichTextAttr::GetLeftSubIndent} \label { wxrichtextattrgetleftsubindent}
\constfunc { long} { GetLeftSubIndent} { \void }
Returns the left sub-indent in tenths of a millimetre.
\membersection { wxRichTextAttr::GetLineSpacing} \label { wxrichtextattrgetlinespacing}
\constfunc { int} { GetLineSpacing} { \void }
Returns the line spacing value, one of wxTEXT\_ ATTR\_ LINE\_ SPACING\_ NORMAL,
wxTEXT\_ ATTR\_ LINE\_ SPACING\_ HALF, and wxTEXT\_ ATTR\_ LINE\_ SPACING\_ TWICE.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::GetListStyleName} \label { wxrichtextattrgetliststylename}
\constfunc { const wxString\& } { GetListStyleName} { \void }
Returns the name of the list style.
2006-11-10 10:48:46 -05:00
\membersection { wxRichTextAttr::GetOutlineLevel} \label { wxrichtextattrgetoutlinelevel}
\constfunc { bool} { GetOutlineLevel} { \void }
Returns the outline level.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::GetParagraphSpacingAfter} \label { wxrichtextattrgetparagraphspacingafter}
\constfunc { int} { GetParagraphSpacingAfter} { \void }
Returns the space in tenths of a millimeter after the paragraph.
\membersection { wxRichTextAttr::GetParagraphSpacingBefore} \label { wxrichtextattrgetparagraphspacingbefore}
\constfunc { int} { GetParagraphSpacingBefore} { \void }
Returns the space in tenths of a millimeter before the paragraph.
\membersection { wxRichTextAttr::GetParagraphStyleName} \label { wxrichtextattrgetparagraphstylename}
\constfunc { const wxString\& } { GetParagraphStyleName} { \void }
Returns the name of the paragraph style.
\membersection { wxRichTextAttr::GetRightIndent} \label { wxrichtextattrgetrightindent}
\constfunc { long} { GetRightIndent} { \void }
Returns the right indent in tenths of a millimeter.
\membersection { wxRichTextAttr::GetTabs} \label { wxrichtextattrgettabs}
\constfunc { const wxArrayInt\& } { GetTabs} { \void }
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.
\membersection { wxRichTextAttr::GetTextColour} \label { wxrichtextattrgettextcolour}
\constfunc { const wxColour\& } { GetTextColour} { \void }
Returns the text foreground colour.
2006-11-09 15:22:33 -05:00
\membersection { wxRichTextAttr::GetTextEffectFlags} \label { wxrichtextattrgettexteffectflags}
\constfunc { int} { GetTextEffectFlags} { \void }
Returns the text effect bits of interest. See \helpref { wxRichTextAttr::SetFlags} { wxrichtextattrsetflags} for further information.
\membersection { wxRichTextAttr::GetTextEffects} \label { wxrichtextattrgettexteffects}
\constfunc { int} { GetTextEffects} { \void }
Returns the text effects, a bit list of styles. See \helpref { wxRichTextAttr::SetTextEffects} { wxrichtextattrsettexteffects} for
details.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::GetURL} \label { wxrichtextattrgeturl}
\constfunc { const wxString\& } { GetURL} { \void }
Returns the URL for the content. Content with wxTEXT\_ ATTR\_ URL style
causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
a wxTextUrlEvent when the content is clicked.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::HasAlignment} \label { wxrichtextattrhasalignment}
\constfunc { bool} { HasAlignment} { \void }
Returns \true if the attribute object specifies alignment.
\membersection { wxRichTextAttr::HasBackgroundColour} \label { wxrichtextattrhasbackgroundcolour}
\constfunc { bool} { HasBackgroundColour} { \void }
Returns \true if the attribute object specifies a background colour.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::HasBulletName} \label { wxrichtextattrhasbulletname}
\constfunc { bool} { HasBulletName} { \void }
Returns \true if the attribute object specifies a standard bullet name.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::HasBulletNumber} \label { wxrichtextattrhasbulletnumber}
\constfunc { bool} { HasBulletNumber} { \void }
Returns \true if the attribute object specifies a bullet number.
\membersection { wxRichTextAttr::HasBulletStyle} \label { wxrichtextattrhasbulletstyle}
\constfunc { bool} { HasBulletStyle} { \void }
Returns \true if the attribute object specifies a bullet style.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::HasBulletText} \label { wxrichtextattrhasbullettext}
2006-07-01 16:30:58 -04:00
2006-10-26 02:32:47 -04:00
\constfunc { bool} { HasBulletText} { \void }
2006-07-01 16:30:58 -04:00
2006-10-26 02:32:47 -04:00
Returns \true if the attribute object specifies bullet text (usually specifying a symbol).
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::HasCharacterStyleName} \label { wxrichtextattrhascharacterstylename}
\constfunc { bool} { HasCharacterStyleName} { \void }
Returns \true if the attribute object specifies a character style name.
2006-07-24 14:20:18 -04:00
\membersection { wxRichTextAttr::HasFontFaceName} \label { wxrichtextattrhasfontfacename}
2006-07-01 16:30:58 -04:00
2006-07-24 14:20:18 -04:00
\constfunc { bool} { HasFontFaceName} { \void }
2006-07-01 16:30:58 -04:00
Returns \true if the attribute object specifies a font face name.
\membersection { wxRichTextAttr::HasFlag} \label { wxrichtextattrhasflag}
\constfunc { bool} { HasFlag} { \param { long } { flag} }
Returns \true if the { \it flag} is present in the attribute object's flag bitlist.
\membersection { wxRichTextAttr::HasFont} \label { wxrichtextattrhasfont}
\constfunc { bool} { HasFont} { \void }
Returns \true if the attribute object specifies any font attributes.
2006-07-24 14:20:18 -04:00
\membersection { wxRichTextAttr::HasFontItalic} \label { wxrichtextattrhasfontitalic}
2006-07-01 16:30:58 -04:00
2006-07-24 14:20:18 -04:00
\constfunc { bool} { HasFontItalic} { \void }
2006-07-01 16:30:58 -04:00
Returns \true if the attribute object specifies italic style.
\membersection { wxRichTextAttr::HasLeftIndent} \label { wxrichtextattrhasleftindent}
\constfunc { bool} { HasLeftIndent} { \void }
Returns \true if the attribute object specifies a left indent.
\membersection { wxRichTextAttr::HasLineSpacing} \label { wxrichtextattrhaslinespacing}
\constfunc { bool} { HasLineSpacing} { \void }
Returns \true if the attribute object specifies line spacing.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::HasListStyleName} \label { wxrichtextattrhasliststylename}
\constfunc { bool} { HasListStyleName} { \void }
Returns \true if the attribute object specifies a list style name.
2006-11-10 10:48:46 -05:00
\membersection { wxRichTextAttr::HasOutlineLevel} \label { wxrichtextattrhasoutlinelevel}
\constfunc { bool} { HasOutlineLevel} { \void }
Returns \true if the attribute object specifies an outline level.
2006-10-30 12:52:14 -05:00
\membersection { wxRichTextAttr::HasPageBreak} \label { wxrichtextattrhaspagebreak}
\constfunc { bool} { HasPageBreak} { \void }
Returns \true if the attribute object specifies a page break before this paragraph.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::HasParagraphSpacingAfter} \label { wxrichtextattrhasparagraphspacingafter}
\constfunc { bool} { HasParagraphSpacingAfter} { \void }
Returns \true if the attribute object specifies spacing after a paragraph.
\membersection { wxRichTextAttr::HasParagraphSpacingBefore} \label { wxrichtextattrhasparagraphspacingbefore}
\constfunc { bool} { HasParagraphSpacingBefore} { \void }
Returns \true if the attribute object specifies spacing before a paragraph.
\membersection { wxRichTextAttr::HasParagraphStyleName} \label { wxrichtextattrhasparagraphstylename}
\constfunc { bool} { HasParagraphStyleName} { \void }
Returns \true if the attribute object specifies a paragraph style name.
\membersection { wxRichTextAttr::HasRightIndent} \label { wxrichtextattrhasrightindent}
\constfunc { bool} { HasRightIndent} { \void }
Returns \true if the attribute object specifies a right indent.
2006-07-24 14:20:18 -04:00
\membersection { wxRichTextAttr::HasFontSize} \label { wxrichtextattrhasfontsize}
2006-07-01 16:30:58 -04:00
2006-07-24 14:20:18 -04:00
\constfunc { bool} { HasFontSize} { \void }
2006-07-01 16:30:58 -04:00
Returns \true if the attribute object specifies a font point size.
\membersection { wxRichTextAttr::HasTabs} \label { wxrichtextattrhastabs}
\constfunc { bool} { HasTabs} { \void }
Returns \true if the attribute object specifies tab stops.
\membersection { wxRichTextAttr::HasTextColour} \label { wxrichtextattrhastextcolour}
\constfunc { bool} { HasTextColour} { \void }
Returns \true if the attribute object specifies a text foreground colour.
2006-11-10 10:48:46 -05:00
\membersection { wxRichTextAttr::HasTextEffects} \label { wxrichtextattrhastexteffects}
\constfunc { bool} { HasTextEffects} { \void }
Returns \true if the attribute object specifies text effects.
2006-07-24 14:20:18 -04:00
\membersection { wxRichTextAttr::HasFontUnderlined} \label { wxrichtextattrhasfontunderlined}
2006-07-01 16:30:58 -04:00
2006-07-24 14:20:18 -04:00
\constfunc { bool} { HasFontUnderlined} { \void }
2006-07-01 16:30:58 -04:00
Returns \true if the attribute object specifies either underlining or no underlining.
2006-11-10 10:48:46 -05:00
\membersection { wxRichTextAttr::HasURL} \label { wxrichtextattrhasurl}
\constfunc { bool} { HasURL} { \void }
Returns \true if the attribute object specifies a URL.
2006-07-24 14:20:18 -04:00
\membersection { wxRichTextAttr::HasFontWeight} \label { wxrichtextattrhasfontweight}
2006-07-01 16:30:58 -04:00
2006-07-24 14:20:18 -04:00
\constfunc { bool} { HasFontWeight} { \void }
2006-07-01 16:30:58 -04:00
Returns \true if the attribute object specifies font weight (bold, light or normal).
\membersection { wxRichTextAttr::IsCharacterStyle} \label { wxrichtextattrischaracterstyle}
\constfunc { bool} { IsCharacterStyle} { \void }
Returns \true if the object represents a character style, that is,
the flags specify a font or a text background or foreground colour.
\membersection { wxRichTextAttr::IsDefault} \label { wxrichtextattrisdefault}
\constfunc { bool} { IsDefault} { \void }
Returns \false if we have any attributes set, \true otherwise.
\membersection { wxRichTextAttr::IsParagraphStyle} \label { wxrichtextattrisparagraphstyle}
\constfunc { bool} { IsParagraphStyle} { \void }
Returns \true if the object represents a paragraph style, that is,
the flags specify alignment, indentation, tabs, paragraph spacing, or
bullet style.
\membersection { wxRichTextAttr::SetAlignment} \label { wxrichtextattrsetalignment}
\func { void} { SetAlignment} { \param { wxTextAttrAlignment } { alignment} }
Sets the paragraph alignment. These are the possible values for { \it alignment} :
{ \small
\begin { verbatim}
enum wxTextAttrAlignment
{
wxTEXT_ ALIGNMENT_ DEFAULT,
wxTEXT_ ALIGNMENT_ LEFT,
wxTEXT_ ALIGNMENT_ CENTRE,
wxTEXT_ ALIGNMENT_ CENTER = wxTEXT_ ALIGNMENT_ CENTRE,
wxTEXT_ ALIGNMENT_ RIGHT,
wxTEXT_ ALIGNMENT_ JUSTIFIED
} ;
\end { verbatim}
}
2006-11-09 15:22:33 -05:00
Of these, wxTEXT\_ ALIGNMENT\_ JUSTIFIED is unimplemented. In future justification may be supported
when printing or previewing, only.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::SetBackgroundColour} \label { wxrichtextattrsetbackgroundcolour}
\func { void} { SetBackgroundColour} { \param { const wxColour\& } { colBack} }
Sets the background colour.
2006-10-10 12:48:47 -04:00
\membersection { wxRichTextAttr::SetBulletFont} \label { wxrichtextattrsetbulletfont}
\func { void} { SetBulletFont} { \param { const wxString\& } { font} }
Sets the name of the font associated with the bullet symbol.
Only valid for attributes with wxTEXT\_ ATTR\_ BULLET\_ SYMBOL.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::SetBulletName} \label { wxrichtextattrsetbulletname}
\func { void} { SetBulletName} { \param { const wxString\& } { name} }
Sets the standard bullet name, applicable if the bullet style is wxTEXT\_ ATTR\_ BULLET\_ STYLE\_ STANDARD.
See \helpref { wxRichTextAttr::GetBulletName} { wxrichtextattrgetbulletname} for a list
of supported names, and how to expand the range of supported types.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::SetBulletNumber} \label { wxrichtextattrsetbulletnumber}
\func { void} { SetBulletNumber} { \param { int } { n} }
Sets the bullet number.
\membersection { wxRichTextAttr::SetBulletStyle} \label { wxrichtextattrsetbulletstyle}
\func { void} { SetBulletStyle} { \param { int } { style} }
Sets the bullet style. The following styles can be passed:
{ \small
\begin { verbatim}
2006-10-26 02:32:47 -04:00
#define wxTEXT_ ATTR_ BULLET_ STYLE_ NONE 0x00000000
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ARABIC 0x00000001
#define wxTEXT_ ATTR_ BULLET_ STYLE_ LETTERS_ UPPER 0x00000002
#define wxTEXT_ ATTR_ BULLET_ STYLE_ LETTERS_ LOWER 0x00000004
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ROMAN_ UPPER 0x00000008
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ROMAN_ LOWER 0x00000010
#define wxTEXT_ ATTR_ BULLET_ STYLE_ SYMBOL 0x00000020
#define wxTEXT_ ATTR_ BULLET_ STYLE_ BITMAP 0x00000040
#define wxTEXT_ ATTR_ BULLET_ STYLE_ PARENTHESES 0x00000080
#define wxTEXT_ ATTR_ BULLET_ STYLE_ PERIOD 0x00000100
#define wxTEXT_ ATTR_ BULLET_ STYLE_ STANDARD 0x00000200
#define wxTEXT_ ATTR_ BULLET_ STYLE_ RIGHT_ PARENTHESIS 0x00000400
#define wxTEXT_ ATTR_ BULLET_ STYLE_ OUTLINE 0x00000800
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ALIGN_ LEFT 0x00000000
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ALIGN_ RIGHT 0x00001000
#define wxTEXT_ ATTR_ BULLET_ STYLE_ ALIGN_ CENTRE 0x00002000
2006-07-01 16:30:58 -04:00
\end { verbatim}
}
2006-11-09 15:22:33 -05:00
Currently wxTEXT\_ ATTR\_ BULLET\_ STYLE\_ BITMAP is not supported.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::SetBulletText} \label { wxrichtextattrsetbullettext}
2006-07-01 16:30:58 -04:00
2006-10-26 02:32:47 -04:00
\func { void} { SetBulletText} { \param { const wxString& } { text} }
2006-07-01 16:30:58 -04:00
2006-10-26 02:32:47 -04:00
Sets the bullet text, which could be a symbol, or (for example) cached outline text.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::SetCharacterStyleName} \label { wxrichtextattrsetcharacterstylename}
\func { void} { SetCharacterStyleName} { \param { const wxString\& } { name} }
Sets the character style name.
\membersection { wxRichTextAttr::SetFlags} \label { wxrichtextattrsetflags}
\func { void} { SetFlags} { \param { long } { flags} }
Sets the flags determining which styles are being specified. The following
flags can be passed in a bitlist:
{ \small
\begin { verbatim}
// Standard wxTextAttr constants
2006-11-09 15:22:33 -05:00
#define wxTEXT_ ATTR_ TEXT_ COLOUR 0x00000001
#define wxTEXT_ ATTR_ BACKGROUND_ COLOUR 0x00000002
#define wxTEXT_ ATTR_ FONT_ FACE 0x00000004
#define wxTEXT_ ATTR_ FONT_ SIZE 0x00000008
#define wxTEXT_ ATTR_ FONT_ WEIGHT 0x00000010
#define wxTEXT_ ATTR_ FONT_ ITALIC 0x00000020
#define wxTEXT_ ATTR_ FONT_ UNDERLINE 0x00000040
2006-07-01 16:30:58 -04:00
#define wxTEXT_ ATTR_ FONT \
wxTEXT_ ATTR_ FONT_ FACE | wxTEXT_ ATTR_ FONT_ SIZE | wxTEXT_ ATTR_ FONT_ WEIGHT \
| wxTEXT_ ATTR_ FONT_ ITALIC | wxTEXT_ ATTR_ FONT_ UNDERLINE
2006-11-09 15:22:33 -05:00
#define wxTEXT_ ATTR_ ALIGNMENT 0x00000080
#define wxTEXT_ ATTR_ LEFT_ INDENT 0x00000100
#define wxTEXT_ ATTR_ RIGHT_ INDENT 0x00000200
#define wxTEXT_ ATTR_ TABS 0x00000400
2006-07-01 16:30:58 -04:00
// Extra formatting flags not in wxTextAttr
#define wxTEXT_ ATTR_ PARA_ SPACING_ AFTER 0x00000800
#define wxTEXT_ ATTR_ PARA_ SPACING_ BEFORE 0x00001000
#define wxTEXT_ ATTR_ LINE_ SPACING 0x00002000
#define wxTEXT_ ATTR_ CHARACTER_ STYLE_ NAME 0x00004000
#define wxTEXT_ ATTR_ PARAGRAPH_ STYLE_ NAME 0x00008000
2006-10-26 02:32:47 -04:00
#define wxTEXT_ ATTR_ LIST_ STYLE_ NAME 0x00010000
#define wxTEXT_ ATTR_ BULLET_ STYLE 0x00020000
#define wxTEXT_ ATTR_ BULLET_ NUMBER 0x00040000
#define wxTEXT_ ATTR_ BULLET_ TEXT 0x00080000
#define wxTEXT_ ATTR_ BULLET_ NAME 0x00100000
#define wxTEXT_ ATTR_ URL 0x00200000
2006-11-09 15:22:33 -05:00
#define wxTEXT_ ATTR_ PAGE_ BREAK 0x00400000
#define wxTEXT_ ATTR_ EFFECTS 0x00800000
2006-11-10 10:48:46 -05:00
#define wxTEXT_ ATTR_ OUTLINE_ LEVEL 0x01000000
2006-07-01 16:30:58 -04:00
\end { verbatim}
}
\membersection { wxRichTextAttr::SetFontFaceName} \label { wxrichtextattrsetfontfacename}
\func { void} { SetFontFaceName} { \param { const wxString\& } { faceName} }
Sets the paragraph alignment.
\membersection { wxRichTextAttr::SetFontSize} \label { wxrichtextattrsetfontsize}
\func { void} { SetFontSize} { \param { int } { pointSize} }
Sets the font size in points.
\membersection { wxRichTextAttr::SetFontStyle} \label { wxrichtextattrsetfontstyle}
\func { void} { SetFontStyle} { \param { int } { fontStyle} }
Sets the font style (normal, italic or slanted).
\membersection { wxRichTextAttr::SetFontUnderlined} \label { wxrichtextattrsetfontunderlined}
\func { void} { SetFontUnderlined} { \param { bool } { underlined} }
Sets the font underlining.
\membersection { wxRichTextAttr::SetFontWeight} \label { wxrichtextattrsetfontweight}
\func { void} { SetFontWeight} { \param { int } { fontWeight} }
Sets the font weight.
\membersection { wxRichTextAttr::SetLeftIndent} \label { wxrichtextattrsetleftindent}
\func { void} { SetLeftIndent} { \param { int } { indent} , \param { int } { subIndent = 0} }
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.
\membersection { wxRichTextAttr::SetLineSpacing} \label { wxrichtextattrsetlinespacing}
\func { void} { SetLineSpacing} { \param { int } { spacing} }
Sets the line spacing. { \it spacing} is a multiple, where 10 means single-spacing,
15 means 1.5 spacing, and 20 means double spacing. The following constants are
defined for convenience:
{ \small
\begin { verbatim}
#define wxTEXT_ ATTR_ LINE_ SPACING_ NORMAL 10
#define wxTEXT_ ATTR_ LINE_ SPACING_ HALF 15
#define wxTEXT_ ATTR_ LINE_ SPACING_ TWICE 20
\end { verbatim}
}
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::SetListStyleName} \label { wxrichtextattrsetliststylename}
\func { void} { SetListStyleName} { \param { const wxString\& } { name} }
Sets the list style name.
2006-11-10 10:48:46 -05:00
\membersection { wxRichTextAttr::SetOutlineLevel} \label { wxrichtextattrsetoutlinelevel}
\func { void} { SetOutlineLevel} { \param { int} { level} }
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.
2006-10-30 12:52:14 -05:00
\membersection { wxRichTextAttr::SetPageBreak} \label { wxrichtextattrsetpagebreak}
\func { void} { SetPageBreak} { \param { bool} { pageBreak = true} }
Specifies a page break before this paragraph.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::SetParagraphSpacingAfter} \label { wxrichtextattrsetparagraphspacingafter}
\func { void} { SetParagraphSpacingAfter} { \param { int } { spacing} }
Sets the spacing after a paragraph, in tenths of a millimetre.
\membersection { wxRichTextAttr::SetParagraphSpacingBefore} \label { wxrichtextattrsetparagraphspacingbefore}
\func { void} { SetParagraphSpacingBefore} { \param { int } { spacing} }
Sets the spacing before a paragraph, in tenths of a millimetre.
\membersection { wxRichTextAttr::SetParagraphStyleName} \label { wxrichtextattrsetparagraphstylename}
\func { void} { SetParagraphStyleName} { \param { const wxString\& } { name} }
Sets the name of the paragraph style.
\membersection { wxRichTextAttr::SetRightIndent} \label { wxrichtextattrsetrightindent}
\func { void} { SetRightIndent} { \param { int } { indent} }
Sets the right indent in tenths of a millimetre.
\membersection { wxRichTextAttr::SetTabs} \label { wxrichtextattrsettabs}
\func { void} { SetTabs} { \param { const wxArrayInt\& } { tabs} }
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.
\membersection { wxRichTextAttr::SetTextColour} \label { wxrichtextattrsettextcolour}
\func { void} { SetTextColour} { \param { const wxColour\& } { colText} }
Sets the text foreground colout.
2006-11-09 15:22:33 -05:00
\membersection { wxRichTextAttr::SetTextEffectFlags} \label { wxrichtextattrsettexteffectflags}
\func { void} { SetTextEffectFlags} { \param { int } { flags} }
Sets the text effect bits of interest. You should also pass wxTEXT\_ ATTR\_ EFFECTS to \helpref { wxRichTextAttr::SetFlags} { wxrichtextattrsetflags} .
See \helpref { wxRichTextAttr::SetFlags} { wxrichtextattrsetflags} for further information.
\membersection { wxRichTextAttr::SetTextEffects} \label { wxrichtextattrsettexteffects}
\func { void} { SetTextEffects} { \param { int } { effects} }
Sets the text effects, a bit list of styles.
The following styles can be passed:
{ \small
\begin { verbatim}
#define wxTEXT_ ATTR_ EFFECT_ NONE 0x00000000
#define wxTEXT_ ATTR_ EFFECT_ CAPITALS 0x00000001
#define wxTEXT_ ATTR_ EFFECT_ SMALL_ CAPITALS 0x00000002
#define wxTEXT_ ATTR_ EFFECT_ STRIKETHROUGH 0x00000004
#define wxTEXT_ ATTR_ EFFECT_ DOUBLE_ STRIKETHROUGH 0x00000008
#define wxTEXT_ ATTR_ EFFECT_ SHADOW 0x00000010
#define wxTEXT_ ATTR_ EFFECT_ EMBOSS 0x00000020
#define wxTEXT_ ATTR_ EFFECT_ OUTLINE 0x00000040
#define wxTEXT_ ATTR_ EFFECT_ ENGRAVE 0x00000080
#define wxTEXT_ ATTR_ EFFECT_ SUPERSCRIPT 0x00000100
#define wxTEXT_ ATTR_ EFFECT_ SUBSCRIPT 0x00000200
\end { verbatim}
}
Of these, only wxTEXT\_ ATTR\_ EFFECT\_ CAPITALS and wxTEXT\_ ATTR\_ EFFECT\_ STRIKETHROUGH 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 \helpref { wxRichTextAttr::SetFlags} { wxrichtextattrsetflags} , and call\rtfsp
\helpref { wxRichTextAttr::SetTextEffectFlags} { wxrichtextattrsettexteffectflags} with the styles (taken from the
above set) that you are interested in setting.
2006-10-26 02:32:47 -04:00
\membersection { wxRichTextAttr::SetURL} \label { wxrichtextattrseturl}
\func { void} { SetURL} { \param { const wxString\& } { url} }
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.
2006-07-01 16:30:58 -04:00
\membersection { wxRichTextAttr::operator=} \label { wxrichtextattroperatorassign}
\func { void operator} { operator=} { \param { const wxTextAttrEx\& } { attr} }
Assignment from a \helpref { wxTextAttrEx} { wxtextattr} object.
\func { void operator} { operator=} { \param { const wxRichTextAttr\& } { attr} }
Assignment from a \helpref { wxRichTextAttr} { wxrichtextattr} object.
\membersection { wxRichTextAttr::wxTextAttrEx} \label { wxrichtextattrwxtextattrex}
\constfunc { operator} { wxTextAttrEx} { \void }
Makes a \helpref { wxTextAttrEx} { wxtextattrex} object from this object.
2006-10-10 12:48:47 -04:00