⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 richtextctrl.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
📖 第 1 页 / 共 4 页
字号:
\section{\class{wxRichTextCtrl}}\label{wxrichtextctrl}wxRichTextCtrl provides a generic, ground-up implementation of a text controlcapable of showing multiple styles and images.wxRichTextCtrl sends notification events: see \helpref{wxRichTextEvent}{wxrichtextevent}.It also sends the standard wxTextCtrl events wxEVT\_COMMAND\_TEXT\_ENTER and wxEVT\_COMMAND\_TEXT\_UPDATED,and wxTextUrlEvent when URL content is clicked.For more information, see the \helpref{wxRichTextCtrl overview}{wxrichtextctrloverview}.\wxheading{Derived from}wxTextCtrlBase\wxheading{Include files}<wx/richtext/richtextctrl.h>\wxheading{Data structures}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxRichTextCtrl::wxRichTextCtrl}\label{wxrichtextctrlwxrichtextctrl}\func{}{wxRichTextCtrl}{\void}\func{}{wxRichTextCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxString\& }{value = wxEmptyString}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxRE\_MULTILINE}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}Constructors.\membersection{wxRichTextCtrl::\destruct{wxRichTextCtrl}}\label{wxrichtextctrldtor}\func{}{\destruct{wxRichTextCtrl}}{\void}Destructor.\membersection{wxRichTextCtrl::AddImage}\label{wxrichtextctrladdimage}\func{wxRichTextRange}{AddImage}{\param{const wxImage\& }{image}}Adds an image to the control's buffer.\membersection{wxRichTextCtrl::AddParagraph}\label{wxrichtextctrladdparagraph}\func{wxRichTextRange}{AddParagraph}{\param{const wxString\& }{text}}Adds a new paragraph of text to the end of the buffer.\membersection{wxRichTextCtrl::AppendText}\label{wxrichtextctrlappendtext}\func{void}{AppendText}{\param{const wxString\& }{text}}Sets the insertion point to the end of the buffer and writes the text.\membersection{wxRichTextCtrl::ApplyAlignmentToSelection}\label{wxrichtextctrlapplyalignmenttoselection}\func{bool}{ApplyAlignmentToSelection}{\param{wxTextAttrAlignment }{alignment}}Applies the given alignment to the selection (undoable).For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.\membersection{wxRichTextCtrl::ApplyBoldToSelection}\label{wxrichtextctrlapplyboldtoselection}\func{bool}{ApplyBoldToSelection}{\void}Apples bold to the selection (undoable).\membersection{wxRichTextCtrl::ApplyItalicToSelection}\label{wxrichtextctrlapplyitalictoselection}\func{bool}{ApplyItalicToSelection}{\void}Applies italic to the selection (undoable).\membersection{wxRichTextCtrl::ApplyStyle}\label{wxrichtextctrlapplystyle}\func{bool}{ApplyStyle}{\param{wxRichTextStyleDefinition*}{ def}}Applies the given style to the selection.\membersection{wxRichTextCtrl::ApplyStyleSheet}\label{wxrichtextctrlapplystylesheet}\func{bool}{ApplyStyleSheet}{\param{wxRichTextStyleSheet*}{ sheet $=$ NULL}}Applies the style sheet to the buffer, matching paragraph styles in the sheet against named stylesin the buffer. This might be useful if the styles have changed. If {\it sheet} is NULL, thesheet set with SetStyleSheet is used.Currently this applies paragraph styles only.\membersection{wxRichTextCtrl::ApplyUnderlineToSelection}\label{wxrichtextctrlapplyunderlinetoselection}\func{bool}{ApplyUnderlineToSelection}{\void}Applies underline to the selection (undoable).\membersection{wxRichTextCtrl::BatchingUndo}\label{wxrichtextctrlbatchingundo}\constfunc{bool}{BatchingUndo}{\void}Returns \true if undo commands are being batched.\membersection{wxRichTextCtrl::BeginAlignment}\label{wxrichtextctrlbeginalignment}\func{bool}{BeginAlignment}{\param{wxTextAttrAlignment }{alignment}}Begins using alignmentFor alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}.\membersection{wxRichTextCtrl::BeginBatchUndo}\label{wxrichtextctrlbeginbatchundo}\func{bool}{BeginBatchUndo}{\param{const wxString\& }{cmdName}}Starts batching undo history for commands.\membersection{wxRichTextCtrl::BeginBold}\label{wxrichtextctrlbeginbold}\func{bool}{BeginBold}{\void}Begins using bold.\membersection{wxRichTextCtrl::BeginCharacterStyle}\label{wxrichtextctrlbegincharacterstyle}\func{bool}{BeginCharacterStyle}{\param{const wxString\& }{characterStyle}}Begins using the named character style.\membersection{wxRichTextCtrl::BeginFont}\label{wxrichtextctrlbeginfont}\func{bool}{BeginFont}{\param{const wxFont\& }{font}}Begins using this font.\membersection{wxRichTextCtrl::BeginFontSize}\label{wxrichtextctrlbeginfontsize}\func{bool}{BeginFontSize}{\param{int }{pointSize}}Begins using the given point size.\membersection{wxRichTextCtrl::BeginItalic}\label{wxrichtextctrlbeginitalic}\func{bool}{BeginItalic}{\void}Begins using italic.\membersection{wxRichTextCtrl::BeginLeftIndent}\label{wxrichtextctrlbeginleftindent}\func{bool}{BeginLeftIndent}{\param{int }{leftIndent}, \param{int }{leftSubIndent = 0}}Begins applying a left indent and 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{wxRichTextCtrl::BeginLineSpacing}\label{wxrichtextctrlbeginlinespacing}\func{bool}{BeginLineSpacing}{\param{int }{lineSpacing}}Begins appling 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{wxRichTextCtrl::BeginListStyle}\label{wxrichtextctrlbeginliststyle}\func{bool}{BeginListStyle}{\param{const wxString\&}{ listStyle}, \param{int}{ level=1}, \param{int}{ number=1}}Begins using a specified list style. Optionally, you can also pass a level and a number.\membersection{wxRichTextCtrl::BeginNumberedBullet}\label{wxrichtextctrlbeginnumberedbullet}\func{bool}{BeginNumberedBullet}{\param{int }{bulletNumber}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_ARABIC|wxTEXT\_ATTR\_BULLET\_STYLE\_PERIOD}}Begins a numbered bullet. This call will be needed for each item in the list, and theapplication should take care of incrementing the numbering.{\it bulletNumber} is a number, usually starting with 1.{\it leftIndent} and {\it leftSubIndent} are values in tenths of a millimetre.{\it bulletStyle} is a bitlist of the following values:{\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}}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{wxRichTextCtrl::BeginParagraphSpacing}\label{wxrichtextctrlbeginparagraphspacing}\func{bool}{BeginParagraphSpacing}{\param{int }{before}, \param{int }{after}}Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths ofa millimetre.\membersection{wxRichTextCtrl::BeginParagraphStyle}\label{wxrichtextctrlbeginparagraphstyle}\func{bool}{BeginParagraphStyle}{\param{const wxString\& }{paragraphStyle}}Begins applying the named paragraph style.\membersection{wxRichTextCtrl::BeginRightIndent}\label{wxrichtextctrlbeginrightindent}\func{bool}{BeginRightIndent}{\param{int }{rightIndent}}Begins a right indent, specified in tenths of a millimetre.\membersection{wxRichTextCtrl::BeginStyle}\label{wxrichtextctrlbeginstyle}\func{bool}{BeginStyle}{\param{const wxTextAttrEx\& }{style}}Begins applying a style.\membersection{wxRichTextCtrl::BeginSuppressUndo}\label{wxrichtextctrlbeginsuppressundo}\func{bool}{BeginSuppressUndo}{\void}Starts suppressing undo history for commands.\membersection{wxRichTextCtrl::BeginSymbolBullet}\label{wxrichtextctrlbeginsymbolbullet}\func{bool}{BeginSymbolBullet}{\param{wxChar }{symbol}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_SYMBOL}}Begins applying a symbol bullet, using a character from the current font. See \helpref{BeginNumberedBullet}{wxrichtextctrlbeginnumberedbullet} foran explanation of how indentation is used to render the bulleted paragraph.\membersection{wxRichTextCtrl::BeginTextColour}\label{wxrichtextctrlbegintextcolour}\func{bool}{BeginTextColour}{\param{const wxColour\& }{colour}}Begins using this colour.\membersection{wxRichTextCtrl::BeginUnderline}\label{wxrichtextctrlbeginunderline}\func{bool}{BeginUnderline}{\void}Begins using underlining.\membersection{wxRichTextCtrl::BeginURL}\label{wxrichtextctrlbeginurl}\func{bool}{BeginURL}{\param{const wxString\&}{ url}, \param{const wxString\&}{ characterStyle = wxEmptyString}}Begins applying wxTEXT\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,since it is common to mark a URL with a familiar style such as blue text with underlining.\membersection{wxRichTextCtrl::CanCopy}\label{wxrichtextctrlcancopy}\constfunc{bool}{CanCopy}{\void}Returns \true if selected content can be copied to the clipboard.\membersection{wxRichTextCtrl::CanCut}\label{wxrichtextctrlcancut}\constfunc{bool}{CanCut}{\void}Returns \true if selected content can be copied to the clipboard and deleted.\membersection{wxRichTextCtrl::CanDeleteSelection}\label{wxrichtextctrlcandeleteselection}\constfunc{bool}{CanDeleteSelection}{\void}Returns \true if selected content can be deleted.\membersection{wxRichTextCtrl::CanPaste}\label{wxrichtextctrlcanpaste}\constfunc{bool}{CanPaste}{\void}Returns \true if the clipboard content can be pasted to the buffer.\membersection{wxRichTextCtrl::CanRedo}\label{wxrichtextctrlcanredo}\constfunc{bool}{CanRedo}{\void}Returns \true if there is a command in the command history that can be redone.\membersection{wxRichTextCtrl::CanUndo}\label{wxrichtextctrlcanundo}\constfunc{bool}{CanUndo}{\void}Returns \true if there is a command in the command history that can be undone.\membersection{wxRichTextCtrl::Clear}\label{wxrichtextctrlclear}\func{void}{Clear}{\void}Clears the buffer content, leaving a single empty paragraph. Cannot be undone.\membersection{wxRichTextCtrl::ClearListStyle}\label{wxrichtextctrlclearliststyle}\func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}\func{bool}{ClearListStyle}{\param{const wxRichTextRange\& }{range}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.{\it flags} is a bit list of the following:\begin{itemize}\itemsep=0pt\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.\end{itemize}See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}.\membersection{wxRichTextCtrl::Command}\label{wxrichtextctrlcommand}\func{void}{Command}{\param{wxCommandEvent\& }{event}}Sends the event to the control.\membersection{wxRichTextCtrl::Copy}\label{wxrichtextctrlcopy}\func{void}{Copy}{\void}Copies the selected content (if any) to the clipboard.\membersection{wxRichTextCtrl::Create}\label{wxrichtextctrlcreate}\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxString\& }{value = wxEmptyString}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxRE\_MULTILINE}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxTextCtrlNameStr}}Creates the underlying window.\membersection{wxRichTextCtrl::Cut}\label{wxrichtextctrlcut}\func{void}{Cut}{\void}Copies the selected content (if any) to the clipboard and deletes the selection.This is undoable.\membersection{wxRichTextCtrl::Delete}\label{wxrichtextctrldelete}\func{bool}{Delete}{\param{const wxRichTextRange\&}{ range}}Deletes the content within the given range.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -