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

📄 richtextctrl.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
📖 第 1 页 / 共 4 页
字号:
shown at the very end of the line, it means the next character is actuallyon the following line. So this function gets the line we're expecting to findif this is the case.\membersection{wxRichTextCtrl::HasCharacterAttributes}\label{wxrichtextctrlhascharacterattributes}\constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}\constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}Test if this whole range has character attributes of the specified kind. If anyof the attributes are different within the range, the test fails. Youcan use this to implement, for example, bold button updating. {\it style} must haveflags indicating which attributes are of interest.\membersection{wxRichTextCtrl::HasParagraphAttributes}\label{wxrichtextctrlhasparagraphattributes}\constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}}\constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}}Test if this whole range has paragraph attributes of the specified kind. If anyof the attributes are different within the range, the test fails. Youcan use this to implement, for example, centering button updating. {\it style} must haveflags indicating which attributes are of interest.\membersection{wxRichTextCtrl::HasSelection}\label{wxrichtextctrlhasselection}\constfunc{bool}{HasSelection}{\void}Returns \true if there is a selection.\membersection{wxRichTextCtrl::HitTest}\label{wxrichtextctrlhittest}\constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{long* }{pos}}\constfunc{wxTextCtrlHitTestResult}{HitTest}{\param{const wxPoint\& }{pt}, \param{wxTextCoord* }{col}, \param{wxTextCoord* }{row}}Finds the character at the given position in pixels.{\it pt} is in device coords (not adjusted for the client area origin nor for scrolling).\membersection{wxRichTextCtrl::Init}\label{wxrichtextctrlinit}\func{void}{Init}{\void}Initialises the members of the control.\membersection{wxRichTextCtrl::InitCommandEvent}\label{wxrichtextctrlinitcommandevent}\constfunc{void}{InitCommandEvent}{\param{wxCommandEvent\& }{event}}Initialises the command event.\membersection{wxRichTextCtrl::IsDefaultStyleShowing}\label{wxrichtextctrlisdefaultstyleshowing}\constfunc{bool}{IsDefaultStyleShowing}{\void}Returns \true if the user has recently set the default style without moving the caret,and therefore the UI needs to reflect the default style and not the style at the caret.Below is an example of code that uses this function to determine whether the UIshould show that the current style is bold.\begin{verbatim}/// Is all of the selection bold?bool wxRichTextCtrl::IsSelectionBold(){    if (HasSelection())    {        wxRichTextAttr attr;        wxRichTextRange range = GetInternalSelectionRange();        attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);        attr.SetFontWeight(wxBOLD);        return HasCharacterAttributes(range, attr);    }    else    {        // If no selection, then we need to combine current style with default style        // to see what the effect would be if we started typing.        wxRichTextAttr attr;        attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);        long pos = GetAdjustedCaretPosition(GetCaretPosition());        if (GetStyle(pos, attr))        {            if (IsDefaultStyleShowing())                wxRichTextApplyStyle(attr, GetDefaultStyleEx());            return attr.GetFontWeight() == wxBOLD;        }    }    return false;}\end{verbatim}See also \helpref{SetAndShowDefaultStyle}{wxrichtextctrlsetandshowdefaultstyle}.\membersection{wxRichTextCtrl::IsEditable}\label{wxrichtextctrliseditable}\constfunc{bool}{IsEditable}{\void}Returns \true if the control is editable.\membersection{wxRichTextCtrl::IsFrozen}\label{wxrichtextctrlisfrozen}\constfunc{bool}{IsFrozen}{\void}Returns \true if Freeze has been called without a Thaw.\membersection{wxRichTextCtrl::IsModified}\label{wxrichtextctrlismodified}\constfunc{bool}{IsModified}{\void}Returns \true if the buffer has been modified.\membersection{wxRichTextCtrl::IsMultiLine}\label{wxrichtextctrlismultiline}\constfunc{bool}{IsMultiLine}{\void}Returns \true if the control is multiline.\membersection{wxRichTextCtrl::IsPositionVisible}\label{wxrichtextctrlispositionvisible}\constfunc{bool}{IsPositionVisible}{\param{long }{pos}}Returns \true if the given position is visible on the screen.\membersection{wxRichTextCtrl::IsSelectionAligned}\label{wxrichtextctrlisselectionaligned}\constfunc{bool}{IsSelectionAligned}{\param{wxTextAttrAlignment }{alignment}}Returns \true if all of the selection is aligned according to the specified flag.\membersection{wxRichTextCtrl::IsSelectionBold}\label{wxrichtextctrlisselectionbold}\constfunc{bool}{IsSelectionBold}{\void}Returns \true if all of the selection is bold.\membersection{wxRichTextCtrl::IsSelectionItalics}\label{wxrichtextctrlisselectionitalics}\constfunc{bool}{IsSelectionItalics}{\void}Returns \true if all of the selection is italic.\membersection{wxRichTextCtrl::IsSelectionUnderlined}\label{wxrichtextctrlisselectionunderlined}\constfunc{bool}{IsSelectionUnderlined}{\void}Returns \true if all of the selection is underlined.\membersection{wxRichTextCtrl::IsSingleLine}\label{wxrichtextctrlissingleline}\constfunc{bool}{IsSingleLine}{\void}Returns \true if the control is single-line. Currently wxRichTextCtrl does notsupport single-line editing.\membersection{wxRichTextCtrl::KeyboardNavigate}\label{wxrichtextctrlkeyboardnavigate}\func{bool}{KeyboardNavigate}{\param{int }{keyCode}, \param{int }{flags}}Helper function implementing keyboard navigation.\membersection{wxRichTextCtrl::LayoutContent}\label{wxrichtextctrllayoutcontent}\func{bool}{LayoutContent}{\param{bool }{onlyVisibleRect = false}}Lays out the buffer, which must be done before certain operations, such assetting the caret position. This function should not normally be required by theapplication.\membersection{wxRichTextCtrl::LineBreak}\label{wxrichtextctrllinebreak}\func{bool}{LineBreak}{\void}Inserts a line break at the current insertion point. A line break forces wrapping within a paragraph, andcan be introduced by using this function, by appending the wxChar value {\bf wxRichTextLineBreakChar} to text content,or by typing Shift-Return.\membersection{wxRichTextCtrl::LoadFile}\label{wxrichtextctrlloadfile}\func{bool}{LoadFile}{\param{const wxString\& }{file}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}Loads content into the control's buffer 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::MarkDirty}\label{wxrichtextctrlmarkdirty}\func{void}{MarkDirty}{\void}Marks the buffer as modified.\membersection{wxRichTextCtrl::MoveCaret}\label{wxrichtextctrlmovecaret}\func{bool}{MoveCaret}{\param{long }{pos}, \param{bool }{showAtLineStart = false}}Move the caret to the given character position.\membersection{wxRichTextCtrl::MoveCaretBack}\label{wxrichtextctrlmovecaretback}\func{void}{MoveCaretBack}{\param{long }{oldPosition}}Move the caret one visual step forward: this may mean setting a flagand keeping the same position if we're going from the end of one lineto the start of the next, which may be the exact same caret position.\membersection{wxRichTextCtrl::MoveCaretForward}\label{wxrichtextctrlmovecaretforward}\func{void}{MoveCaretForward}{\param{long }{oldPosition}}Move the caret one visual step forward: this may mean setting a flagand keeping the same position if we're going from the end of one lineto the start of the next, which may be the exact same caret position.\membersection{wxRichTextCtrl::MoveDown}\label{wxrichtextctrlmovedown}\func{bool}{MoveDown}{\param{int }{noLines = 1}, \param{int }{flags = 0}}Moves the caret down.\membersection{wxRichTextCtrl::MoveEnd}\label{wxrichtextctrlmoveend}\func{bool}{MoveEnd}{\param{int }{flags = 0}}Moves to the end of the buffer.\membersection{wxRichTextCtrl::MoveHome}\label{wxrichtextctrlmovehome}\func{bool}{MoveHome}{\param{int }{flags = 0}}Moves to the start of the buffer.\membersection{wxRichTextCtrl::MoveLeft}\label{wxrichtextctrlmoveleft}\func{bool}{MoveLeft}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}Moves left.\membersection{wxRichTextCtrl::MoveRight}\label{wxrichtextctrlmoveright}\func{bool}{MoveRight}{\param{int }{noPositions = 1}, \param{int }{flags = 0}}Moves right.\membersection{wxRichTextCtrl::MoveToLineEnd}\label{wxrichtextctrlmovetolineend}\func{bool}{MoveToLineEnd}{\param{int }{flags = 0}}Moves to the end of the line.\membersection{wxRichTextCtrl::MoveToLineStart}\label{wxrichtextctrlmovetolinestart}\func{bool}{MoveToLineStart}{\param{int }{flags = 0}}Moves to the start of the line.\membersection{wxRichTextCtrl::MoveToParagraphEnd}\label{wxrichtextctrlmovetoparagraphend}\func{bool}{MoveToParagraphEnd}{\param{int }{flags = 0}}Moves to the end of the paragraph.\membersection{wxRichTextCtrl::MoveToParagraphStart}\label{wxrichtextctrlmovetoparagraphstart}\func{bool}{MoveToParagraphStart}{\param{int }{flags = 0}}Moves to the start of the paragraph.\membersection{wxRichTextCtrl::MoveUp}\label{wxrichtextctrlmoveup}\func{bool}{MoveUp}{\param{int }{noLines = 1}, \param{int }{flags = 0}}Moves up.\membersection{wxRichTextCtrl::Newline}\label{wxrichtextctrlnewline}\func{bool}{Newline}{\void}Inserts a new paragraph at the current insertion point. See also \helpref{wxRichTextCtrl::LineBreak}{wxrichtextctrllinebreak}.\membersection{wxRichTextCtrl::NumberList}\label{wxrichtextctrlnumberlist}\func{bool}{NumberList}{\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}{Number}{\param{const wxRichTextRange\& }{range}, \param{const wxString\& }{styleName}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}, \param{int}{ startFrom = -1}, \param{int}{ listLevel = -1}}Numbers the paragraphs in the given range. 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}, \helpref{wxRichTextCtrl::PromoteList}{wxrichtextctrlpromotelist}, \helpref{wxRichTextCtrl::ClearListStyle}{wxrichtextctrlclearliststyle}.\membersection{wxRichTextCtrl::OnClear}\label{wxrichtextctrlonclear}\func{void}{OnClear}{\param{wxCommandEvent\& }{event}}Standard handler for the wxID\_CLEAR command.\membersection{wxRichTextCtrl::OnContextMenu}\label{wxrichtextctrloncontextmenu}\func{void}{OnContextMenu}{\param{wxContextMenuEvent\& }{event}}Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.\membersection{wxRichTextCtrl::OnCopy}\label{wxrichtextctrloncopy}\func{void}{OnCopy}{\param{wxCommandEvent\& }{event}}Standard handler for the wxID\_COPY command.\membersection{wxRichTextCtrl::OnCut}\label{wxrichtextctrloncut}\func{void}{OnCut}{\param{wxCommandEvent\& }{event}}Standard handler for the wxID\_CUT command.\membersection{wxRichTextCtrl::OnDropFiles}\label{wxrichtextctrlondropfiles}\func{void}{OnDropFiles}{\param{wxDropFilesEvent\& }{event}}Loads the first dropped file.\membersection{wxRichTextCtrl::OnPaste}\label{wxrichtextctrlonpaste}\func{void}{OnPaste}{\param{wxCommandEvent\& }{event}}Standard handler for the wxID\_PASTE command.\membersection{wxRichTextCtrl::OnRedo}\label{wxrichtextctrlonredo}\func{void}{OnRedo}{\param{wxCommandEvent\& }{event}}Standard handler for the wxID\_REDO command.\membersection{wxRichTextCtrl::OnSelectAll}\label{wxrichtextctrlonselectall}\func{void}{OnSelectAll}{\param{wxCommandEvent\& }{event}}Standard handler for the wxID\_SELECTALL command.\membersection{wxRichTextCtrl::OnUndo}\label{wxrichtextctrlonundo}\func{void}{OnUndo}{\param{wxCommandEvent\& }{event}}Standard handler for the wxID\_PASTE command.\membersection{wxRichTextCtrl::OnUpdateClear}\label{wxrichtextctrlonupdateclear}\func{void}{OnUpdateClear}{\param{wxUpdateUIEvent\& }{event}}Standard update handler for the wxID\_CLEAR command.\membersection{wxRichTextCtrl::OnUpdateCopy}\label{wxrichtextctrlonupdatecopy}\func{void}{OnUpdateCopy}{\param{wxUpdateUIEvent\& }{event}}Standard update handler for the wxID\_COPY command.\membersection{wxRichTextCtrl::OnUpdateCut}\label{wxrichtextctrlonupdatecut}\func{void}{OnUpdateCut}{\param{wxUpdateUIEvent\& }{event}}Standard update handler for the wxID\_CUT command.

⌨️ 快捷键说明

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