richtextctrl.tex
来自「wxWidgets 是一个跨平台的 GUI 框架。它给开发人员提供了统一的接口」· TEX 代码 · 共 1,496 行 · 第 1/4 页
TEX
1,496 行
\membersection{wxRichTextCtrl::OnUpdatePaste}\label{wxrichtextctrlonupdatepaste}\func{void}{OnUpdatePaste}{\param{wxUpdateUIEvent\& }{event}}Standard update handler for the wxID\_PASTE command.\membersection{wxRichTextCtrl::OnUpdateRedo}\label{wxrichtextctrlonupdateredo}\func{void}{OnUpdateRedo}{\param{wxUpdateUIEvent\& }{event}}Standard update handler for the wxID\_REDO command.\membersection{wxRichTextCtrl::OnUpdateSelectAll}\label{wxrichtextctrlonupdateselectall}\func{void}{OnUpdateSelectAll}{\param{wxUpdateUIEvent\& }{event}}Standard update handler for the wxID\_SELECTALL command.\membersection{wxRichTextCtrl::OnUpdateUndo}\label{wxrichtextctrlonupdateundo}\func{void}{OnUpdateUndo}{\param{wxUpdateUIEvent\& }{event}}Standard update handler for the wxID\_UNDO command.\membersection{wxRichTextCtrl::PageDown}\label{wxrichtextctrlpagedown}\func{bool}{PageDown}{\param{int }{noPages = 1}, \param{int }{flags = 0}}Moves one or more pages down.\membersection{wxRichTextCtrl::PageUp}\label{wxrichtextctrlpageup}\func{bool}{PageUp}{\param{int }{noPages = 1}, \param{int }{flags = 0}}Moves one or more pages up.\membersection{wxRichTextCtrl::PaintBackground}\label{wxrichtextctrlpaintbackground}\func{void}{PaintBackground}{\param{wxDC\& }{dc}}Paints the background.\membersection{wxRichTextCtrl::Paste}\label{wxrichtextctrlpaste}\func{void}{Paste}{\void}Pastes content from the clipboard to the buffer.\membersection{wxRichTextCtrl::PositionCaret}\label{wxrichtextctrlpositioncaret}\func{void}{PositionCaret}{\void}Internal function to position the visible caret according to the current caret position.\membersection{wxRichTextCtrl::PositionToXY}\label{wxrichtextctrlpositiontoxy}\constfunc{bool}{PositionToXY}{\param{long }{pos}, \param{long* }{x}, \param{long* }{y}}Converts a text position to zero-based column and line numbers.\membersection{wxRichTextCtrl::PromoteList}\label{wxrichtextctrlpromotelist}\func{bool}{PromoteList}{\param{int}{ promoteBy}, \param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ listLevel = -1}}\func{bool}{PromoteList}{\param{int}{ promoteBy}, \param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ listLevel = -1}}Promotes or demotes the paragraphs in the given range. A positive {\it promoteBy} produces a smaller indent, and a negative numberproduces a larger indent. Pass flags to determine how the attributes are set.Either the style definition or the name of the style definition (in the current sheet) can be passed.{\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.\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.\item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.\end{itemize}See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlsetliststyle}, See also \helpref{wxRichTextCtrl::SetListStyle}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.\membersection{wxRichTextCtrl::Redo}\label{wxrichtextctrlredo}\func{void}{Redo}{\void}Redoes the current command.\membersection{wxRichTextCtrl::Remove}\label{wxrichtextctrlremove}\func{void}{Remove}{\param{long }{from}, \param{long }{to}}Removes the content in the specified range.\membersection{wxRichTextCtrl::Replace}\label{wxrichtextctrlreplace}\func{void}{Replace}{\param{long }{from}, \param{long }{to}, \param{const wxString\& }{value}}Replaces the content in the specified range with the string specified by {\it value}.\membersection{wxRichTextCtrl::SaveFile}\label{wxrichtextctrlsavefile}\func{bool}{SaveFile}{\param{const wxString\& }{file = wxEmptyString}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}Saves the buffer content using the given type. If the specified typeis wxRICHTEXT\_TYPE\_ANY, the type is deduced from the filename extension.This function looks for a suitable \helpref{wxRichTextFileHandler}{wxrichtextfilehandler} object.\membersection{wxRichTextCtrl::ScrollIntoView}\label{wxrichtextctrlscrollintoview}\func{bool}{ScrollIntoView}{\param{long }{position}, \param{int }{keyCode}}Scrolls {\it position} into view. This function takes a caret position.\membersection{wxRichTextCtrl::SelectAll}\label{wxrichtextctrlselectall}\func{void}{SelectAll}{\void}Selects all the text in the buffer.\membersection{wxRichTextCtrl::SelectNone}\label{wxrichtextctrlselectnone}\func{void}{SelectNone}{\void}Cancels any selection.\membersection{wxRichTextCtrl::SetAndShowDefaultStyle}\label{wxrichtextctrlsetandshowdefaultstyle}\func{void}{SetAndShowDefaultStyle}{\param{const wxRichTextAttr\& }{attr}}Sets {\it attr} as the default style and tells the control that the UI should reflectthis attribute until the user moves the caret.See also \helpref{IsDefaultStyleShowing}{wxrichtextctrlisdefaultstyleshowing}.\membersection{wxRichTextCtrl::SetBasicStyle}\label{wxrichtextctrlsetbasicstyle}\func{void}{SetBasicStyle}{\param{const wxRichTextAttr\& }{style}}\func{void}{SetBasicStyle}{\param{const wxTextAttrEx\& }{style}}Sets the basic (overall) style. This is the style of the wholebuffer before further styles are applied, unlike the default style, whichonly affects the style currently being applied (for example, setting the defaultstyle to bold will cause subsequently inserted text to be bold).\membersection{wxRichTextCtrl::SetCaretPosition}\label{wxrichtextctrlsetcaretposition}\func{void}{SetCaretPosition}{\param{long }{position}, \param{bool }{showAtLineStart = false}}The caret position is the character position just before the caret.A value of -1 means the caret is at the start of the buffer.\membersection{wxRichTextCtrl::SetDefaultStyle}\label{wxrichtextctrlsetdefaultstyle}\func{bool}{SetDefaultStyle}{\param{const wxTextAttrEx\& }{style}}Sets the current default style, which can be used to change how subsequently insertedtext is displayed.\membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle}\label{wxrichtextctrlsetdefaultstyletocursorstyle}\func{bool}{SetDefaultStyleToCursorStyle}{\void}Sets the default style to the style under the cursor.\membersection{wxRichTextCtrl::SetDelayedLayoutThreshold}\label{wxrichtextctrlsetdelayedlayoutthreshold}\func{void}{SetDelayedLayoutThreshold}{\param{long }{threshold}}Sets the size of the buffer beyond which layout is delayed during resizing.This optimizes sizing for large buffers. The default is 20000.\membersection{wxRichTextCtrl::SetEditable}\label{wxrichtextctrlseteditable}\func{void}{SetEditable}{\param{bool }{editable}}Makes the control editable, or not.\membersection{wxRichTextCtrl::SetFilename}\label{wxrichtextctrlsetfilename}\func{void}{SetFilename}{\param{const wxString\& }{filename}}Sets the current filename.\membersection{wxRichTextCtrl::SetFont}\label{wxrichtextctrlsetfont}\func{bool}{SetFont}{\param{const wxFont\& }{font}}Sets the font, and also the basic and default attributes (see \helpref{SetDefaultStyle}{wxrichtextctrlsetdefaultstyle}).\membersection{wxRichTextCtrl::SetHandlerFlags}\label{wxrichtextctrlsethandlerflags}\func{void}{SetHandlerFlags}{\param{int }{flags}}Sets flags that change the behaviour of loading or saving. See the documentation for eachhandler class to see what flags are relevant for each handler.\membersection{wxRichTextCtrl::SetInsertionPoint}\label{wxrichtextctrlsetinsertionpoint}\func{void}{SetInsertionPoint}{\param{long }{pos}}Sets the insertion point.\membersection{wxRichTextCtrl::SetInsertionPointEnd}\label{wxrichtextctrlsetinsertionpointend}\func{void}{SetInsertionPointEnd}{\void}Sets the insertion point to the end of the text control.\membersection{wxRichTextCtrl::SetListStyle}\label{wxrichtextctrlsetliststyle}\func{bool}{SetListStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextListStyleDefinition* }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}\func{bool}{SetListStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}Sets the list attributes for the given range, passing flags to determine how the attributes are set.Either the style definition or the name of the style definition (in the current sheet) can be passed.{\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.\item wxRICHTEXT\_SETSTYLE\_RENUMBER: specifies that numbering should start from {\it startFrom}, otherwise existing attributes are used.\item wxRICHTEXT\_SETSTYLE\_SPECIFY\_LEVEL: specifies that {\it listLevel} should be used as the level for all paragraphs, otherwise the current indentation will be used.\end{itemize}See also \helpref{wxRichTextCtrl::NumberList}{wxrichtextctrlnumberlist}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.\membersection{wxRichTextCtrl::SetSelection}\label{wxrichtextctrlsetselection}\func{void}{SetSelection}{\param{long }{from}, \param{long }{to}}Sets the selection to the given range.The end point of range is specified as the last character position of the span of text, plus one.So, for example, to set the style for a character at position 5, use the range (5,6).\membersection{wxRichTextCtrl::SetSelectionRange}\label{wxrichtextctrlsetselectionrange}\func{void}{SetSelectionRange}{\param{const wxRichTextRange\& }{range}}Sets the selection to the given range.The end point of range is specified as the last character position of the span of text, plus one.So, for example, to set the style for a character at position 5, use the range (5,6).\membersection{wxRichTextCtrl::SetStyle}\label{wxrichtextctrlsetstyle}\func{bool}{SetStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}}\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{style}}Sets the attributes for the given range. The wxRichTextAttr version is more efficientbecause it does not use wxFont objects.The end point of range is specified as the last character position of the span of text, plus one.So, for example, to set the style for a character at position 5, use the range (5,6).\membersection{wxRichTextCtrl::SetStyleEx}\label{wxrichtextctrlsetstyleex}\func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}\func{bool}{SetStyleEx}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}\func{bool}{SetStyleEx}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficientbecause it does not use wxFont objects.The end point of range is specified as the last character position of the span of text, plus one.So, for example, to set the style for a character at position 5, use the range (5,6).{\it flags} may contain a bit list of the following values:\begin{itemize}\itemsep=0pt\item wxRICHTEXT\_SETSTYLE\_NONE: no style flag.\item wxRICHTEXT\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.\item wxRICHTEXT\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if thecombined style at this point is already the style in question.\item wxRICHTEXT\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.\item wxRICHTEXT\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.\item wxRICHTEXT\_SETSTYLE\_RESET: resets (clears) the existing style before applying the new style.\end{itemize}\membersection{wxRichTextCtrl::SetStyleSheet}\label{wxrichtextctrlsetstylesheet}\func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}Sets the style sheet associated with the control. A style sheet allows namedcharacter and paragraph styles to be applied.\membersection{wxRichTextCtrl::SetValue}\label{wxrichtextctrlsetvalue}\func{void}{SetValue}{\param{const wxString\& }{value}}Replaces existing content with the given text.\membersection{wxRichTextCtrl::SetupScrollbars}\label{wxrichtextctrlsetupscrollbars}\func{void}{SetupScrollbars}{\param{bool }{atTop = false}}A helper function setting up scrollbars, for example after a resize.\membersection{wxRichTextCtrl::ShowPosition}\label{wxrichtextctrlshowposition}\func{void}{ShowPosition}{\param{long }{pos}}Scrolls the buffer so that the given position is in view.\membersection{wxRichTextCtrl::SuppressingUndo}\label{wxrichtextctrlsuppressingundo}\constfunc{bool}{SuppressingUndo}{\void}Returns \true if undo history suppression is on.\membersection{wxRichTextCtrl::Thaw}\label{wxrichtextctrlthaw}\func{void}{Thaw}{\void}Call this function to end a Freeze and refresh the display.\membersection{wxRichTextCtrl::Undo}\label{wxrichtextctrlundo}\func{void}{Undo}{\void}Undoes the command at the top of the command history, if there is one.\membersection{wxRichTextCtrl::WordLeft}\label{wxrichtextctrlwordleft}\func{bool}{WordLeft}{\param{int }{noWords = 1}, \param{int }{flags = 0}}Moves a number of words to the left.\membersection{wxRichTextCtrl::WordRight}\label{wxrichtextctrlwordright}\func{bool}{WordRight}{\param{int }{noWords = 1}, \param{int }{flags = 0}}Move a nuber of words to the right.\membersection{wxRichTextCtrl::WriteImage}\label{wxrichtextctrlwriteimage}\func{bool}{WriteImage}{\param{const wxString\& }{filename}, \param{int }{bitmapType}}Loads an image from a file and writes it at the current insertion point.\func{bool}{WriteImage}{\param{const wxRichTextImageBlock\& }{imageBlock}}Writes an image block at the current insertion point.\func{bool}{WriteImage}{\param{const wxBitmap\& }{bitmap}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}\func{bool}{WriteImage}{\param{const wxImage\& }{image}, \param{int }{bitmapType = wxBITMAP\_TYPE\_PNG}}Write a bitmap or image at the current insertion point. Supply an optional type to usefor internal and file storage of the raw data.\membersection{wxRichTextCtrl::WriteText}\label{wxrichtextctrlwritetext}\func{void}{WriteText}{\param{const wxString\& }{text}}Writes text at the current position.\membersection{wxRichTextCtrl::XYToPosition}\label{wxrichtextctrlxytoposition}\constfunc{long}{XYToPosition}{\param{long }{x}, \param{long }{y}}Translates from column and line number to position.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?