wxWidgets/docs/latex/wx/textattrex.tex
Julian Smart 62a268cc71 Added some missing newlines to ends of files (necessary for linear RTF)
Added rich text control formatting and symbol dialogs
API changes for wxRichTextCtrl


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-10 16:48:47 +00:00

349 lines
11 KiB
TeX

\section{\class{wxTextAttrEx}}\label{wxtextattrex}
wxTextAttrEx is an extended version of wxTextAttr with more paragraph attributes.
Currently it is only used with \helpref{wxRichTextCtrl}{wxrichtextctrl}.
It is intended that eventually, the members of wxTextAttrEx will
be folded into wxTextAttr, and wxTextAttr will be the official
cross-platform API for text controls that support attributes.
However, for now, wxTextAttrEx is provided as a means of enabling
extra functionality in wxRichTextCtrl, while retaining some compatibility
with the wxTextAttr API.
The most efficient method of accessing wxRichTextCtrl functionality
is a third attribute class, \helpref{wxRichTextAttr}{wxrichtextattr}, which
optimizes its storage to allow it to be used for implementing objects
in a buffer, as well as access to that buffer.
This section only documents the additional members; see \helpref{wxTextAttr}{wxtextattr} for
the remaining functions.
\wxheading{Derived from}
\helpref{wxTextAttr}{wxtextattr}
\wxheading{Include files}
<wx/richtext/richtextbuffer.h>
\wxheading{Constants}
The following values can be passed to SetAlignment to determine
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}
}
These values are passed in a bitlist to SetFlags to determine
what attributes will be considered when setting the attributes
for a text control.
{\small
\begin{verbatim}
// Standard wxTextAttr constants
#define wxTEXT_ATTR_TEXT_COLOUR 0x0001
#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x0002
#define wxTEXT_ATTR_FONT_FACE 0x0004
#define wxTEXT_ATTR_FONT_SIZE 0x0008
#define wxTEXT_ATTR_FONT_WEIGHT 0x0010
#define wxTEXT_ATTR_FONT_ITALIC 0x0020
#define wxTEXT_ATTR_FONT_UNDERLINE 0x0040
#define wxTEXT_ATTR_FONT \
wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
| wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
#define wxTEXT_ATTR_ALIGNMENT 0x0080
#define wxTEXT_ATTR_LEFT_INDENT 0x0100
#define wxTEXT_ATTR_RIGHT_INDENT 0x0200
#define wxTEXT_ATTR_TABS 0x0400
// 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
#define wxTEXT_ATTR_BULLET_STYLE 0x00010000
#define wxTEXT_ATTR_BULLET_NUMBER 0x00020000
#define wxTEXT_ATTR_BULLET_SYMBOL 0x00040000
\end{verbatim}
}
The following styles can be passed to wxRichTextAttr::SetBulletStyle:
{\small
\begin{verbatim}
#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x0000
#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x0001
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x0002
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x0004
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x0008
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x0010
#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x0020
#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x0040
#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x0080
#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x0100
\end{verbatim}
}
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}
}
\wxheading{See also}
\helpref{wxTextAttr}{wxtextattr}, \helpref{wxRichTextAttr}{wxrichtextattr}, \helpref{wxRichTextCtrl}{wxrichtextctrl}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxTextAttrEx::wxTextAttrEx}\label{wxtextattrexwxtextattrex}
\func{}{wxTextAttrEx}{\void}
\func{}{wxTextAttrEx}{\param{const wxTextAttrEx\& }{attr}}
Constructors.
\membersection{wxTextAttrEx::GetBulletFont}\label{wxtextattrexgetbulletfont}
\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.
\membersection{wxTextAttrEx::GetBulletNumber}\label{wxtextattrexgetbulletnumber}
\constfunc{int}{GetBulletNumber}{\void}
Returns the bullet number.
\membersection{wxTextAttrEx::GetBulletStyle}\label{wxtextattrexgetbulletstyle}
\constfunc{int}{GetBulletStyle}{\void}
Returns the bullet style.
See \helpref{wxTextAttrEx::SetBulletStyle}{wxtextattrexsetbulletstyle} for a list of available styles.
\membersection{wxTextAttrEx::GetBulletSymbol}\label{wxtextattrexgetbulletsymbol}
\constfunc{wxChar}{GetBulletSymbol}{\void}
Returns the bullet symbol, a character.
\membersection{wxTextAttrEx::GetCharacterStyleName}\label{wxtextattrexgetcharacterstylename}
\constfunc{const wxString\&}{GetCharacterStyleName}{\void}
Returns the name of the character style.
\membersection{wxTextAttrEx::GetLineSpacing}\label{wxtextattrexgetlinespacing}
\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.
\membersection{wxTextAttrEx::GetParagraphSpacingAfter}\label{wxtextattrexgetparagraphspacingafter}
\constfunc{int}{GetParagraphSpacingAfter}{\void}
Returns the space in tenths of a millimeter after the paragraph.
\membersection{wxTextAttrEx::GetParagraphSpacingBefore}\label{wxtextattrexgetparagraphspacingbefore}
\constfunc{int}{GetParagraphSpacingBefore}{\void}
Returns the space in tenths of a millimeter before the paragraph.
\membersection{wxTextAttrEx::GetParagraphStyleName}\label{wxtextattrexgetparagraphstylename}
\constfunc{const wxString\&}{GetParagraphStyleName}{\void}
Returns the name of the paragraph style.
\membersection{wxTextAttrEx::HasBulletNumber}\label{wxtextattrexhasbulletnumber}
\constfunc{bool}{HasBulletNumber}{\void}
Returns \true if the attribute object specifies a bullet number.
\membersection{wxTextAttrEx::HasBulletStyle}\label{wxtextattrexhasbulletstyle}
\constfunc{bool}{HasBulletStyle}{\void}
Returns \true if the attribute object specifies a bullet style.
\membersection{wxTextAttrEx::HasBulletSymbol}\label{wxtextattrexhasbulletsymbol}
\constfunc{bool}{HasBulletSymbol}{\void}
Returns \true if the attribute object specifies a bullet symbol.
\membersection{wxTextAttrEx::HasCharacterStyleName}\label{wxtextattrexhascharacterstylename}
\constfunc{bool}{HasCharacterStyleName}{\void}
Returns \true if the attribute object specifies a character style name.
\membersection{wxTextAttrEx::HasLineSpacing}\label{wxtextattrexhaslinespacing}
\constfunc{bool}{HasLineSpacing}{\void}
Returns \true if the attribute object specifies line spacing.
\membersection{wxTextAttrEx::HasParagraphSpacingAfter}\label{wxtextattrexhasparagraphspacingafter}
\constfunc{bool}{HasParagraphSpacingAfter}{\void}
Returns \true if the attribute object specifies spacing after a paragraph.
\membersection{wxTextAttrEx::HasParagraphSpacingBefore}\label{wxtextattrexhasparagraphspacingbefore}
\constfunc{bool}{HasParagraphSpacingBefore}{\void}
Returns \true if the attribute object specifies spacing before a paragraph.
\membersection{wxTextAttrEx::HasParagraphStyleName}\label{wxtextattrexhasparagraphstylename}
\constfunc{bool}{HasParagraphStyleName}{\void}
Returns \true if the attribute object specifies a paragraph style name.
\membersection{wxTextAttrEx::Init}\label{wxtextattrexinit}
\func{void}{Init}{\void}
Initialises this object.
\membersection{wxTextAttrEx::IsCharacterStyle}\label{wxtextattrexischaracterstyle}
\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{wxTextAttrEx::IsDefault}\label{wxtextattrexisdefault}
\constfunc{bool}{IsDefault}{\void}
Returns \false if we have any attributes set, \true otherwise.
\membersection{wxTextAttrEx::IsParagraphStyle}\label{wxtextattrexisparagraphstyle}
\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{wxTextAttrEx::SetBulletFont}\label{wxtextattrexsetbulletfont}
\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.
\membersection{wxTextAttrEx::SetBulletNumber}\label{wxtextattrexsetbulletnumber}
\func{void}{SetBulletNumber}{\param{int }{n}}
Sets the bullet number.
\membersection{wxTextAttrEx::SetBulletStyle}\label{wxtextattrexsetbulletstyle}
\func{void}{SetBulletStyle}{\param{int }{style}}
Sets the bullet style. The following styles can be passed:
{\small
\begin{verbatim}
#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x0000
#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x0001
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x0002
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x0004
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x0008
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x0010
#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x0020
#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x0040
#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x0080
#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x0100
\end{verbatim}
}
\membersection{wxTextAttrEx::SetBulletSymbol}\label{wxtextattrexsetbulletsymbol}
\func{void}{SetBulletSymbol}{\param{wxChar }{symbol}}
Sets the paragraph symbol.
\membersection{wxTextAttrEx::SetCharacterStyleName}\label{wxtextattrexsetcharacterstylename}
\func{void}{SetCharacterStyleName}{\param{const wxString\& }{name}}
Sets the character style name.
\membersection{wxTextAttrEx::SetLineSpacing}\label{wxtextattrexsetlinespacing}
\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}
}
\membersection{wxTextAttrEx::SetParagraphSpacingAfter}\label{wxtextattrexsetparagraphspacingafter}
\func{void}{SetParagraphSpacingAfter}{\param{int }{spacing}}
Sets the spacing after a paragraph, in tenths of a millimetre.
\membersection{wxTextAttrEx::SetParagraphSpacingBefore}\label{wxtextattrexsetparagraphspacingbefore}
\func{void}{SetParagraphSpacingBefore}{\param{int }{spacing}}
Sets the spacing before a paragraph, in tenths of a millimetre.
\membersection{wxTextAttrEx::SetParagraphStyleName}\label{wxtextattrexsetparagraphstylename}
\func{void}{SetParagraphStyleName}{\param{const wxString\& }{name}}
Sets the name of the paragraph style.
\membersection{wxTextAttrEx::operator=}\label{wxtextattrexoperatorassign}
\func{void operator}{operator=}{\param{const wxTextAttr\& }{attr}}
Assignment from a wxTextAttr object.
\func{void operator}{operator=}{\param{const wxTextAttrEx\& }{attr}}
Assignment from a wxTextAttrEx object.