📄 richtextattr.tex
字号:
\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.\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 listof supported names, and how to expand the range of supported types.\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}#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000\end{verbatim}}Currently wxTEXT\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.\membersection{wxRichTextAttr::SetBulletText}\label{wxrichtextattrsetbullettext}\func{void}{SetBulletText}{\param{const wxString& }{text}}Sets the bullet text, which could be a symbol, or (for example) cached outline text.\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 followingflags can be passed in a bitlist:{\small\begin{verbatim}// Standard wxTextAttr constants#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#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 0x00000080#define wxTEXT_ATTR_LEFT_INDENT 0x00000100#define wxTEXT_ATTR_RIGHT_INDENT 0x00000200#define wxTEXT_ATTR_TABS 0x00000400// 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_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#define wxTEXT_ATTR_PAGE_BREAK 0x00400000#define wxTEXT_ATTR_EFFECTS 0x00800000#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000\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 thefirst line in a paragraph. A positive value will cause the first line to appear to the leftof the subsequent lines, and a negative value will cause the first line to be indentedrelative to the subsequent lines.wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance betweenthe margin and the bullet. The content of the paragraph, including the first line, startsat leftMargin + leftSubIndent. So the distance between the left edge of the bullet and theleft 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 aredefined 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{wxRichTextAttr::SetListStyleName}\label{wxrichtextattrsetliststylename}\func{void}{SetListStyleName}{\param{const wxString\& }{name}}Sets the list style name.\membersection{wxRichTextAttr::SetOutlineLevel}\label{wxrichtextattrsetoutlinelevel}\func{void}{SetOutlineLevel}{\param{int}{ level}}Specifies the outline level. Zero represents normal text. At present, the outline level isnot used, but may be used in future for determining list levels and for applicationsthat need to store document structure information.\membersection{wxRichTextAttr::SetPageBreak}\label{wxrichtextattrsetpagebreak}\func{void}{SetPageBreak}{\param{bool}{ pageBreak = true}}Specifies a page break before this paragraph.\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.\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 buffertext 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 theabove set) that you are interested in setting.\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 stylecauses wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generatesa wxTextUrlEvent when the content is clicked.\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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -