X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62a268cc71a93c9fd2d696bc85b323e232f44a20..a75124d0da255513e83d2e62f963dd849829466b:/docs/latex/wx/richtextctrl.tex diff --git a/docs/latex/wx/richtextctrl.tex b/docs/latex/wx/richtextctrl.tex index 62d1834713..790038530b 100644 --- a/docs/latex/wx/richtextctrl.tex +++ b/docs/latex/wx/richtextctrl.tex @@ -3,6 +3,12 @@ wxRichTextCtrl provides a generic, ground-up implementation of a text control capable 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 @@ -11,6 +17,10 @@ wxTextCtrlBase +\wxheading{Library} + +\helpref{wxRichtext}{librarieslist} + \wxheading{Data structures} \latexignore{\rtfignore{\wxheading{Members}}} @@ -19,7 +29,9 @@ wxTextCtrlBase \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}} +\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. @@ -53,7 +65,7 @@ Sets the insertion point to the end of the buffer and writes the text. Applies the given alignment to the selection (undoable). -For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}. +For alignment values, see \helpref{wxTextAttr}{wxtextattr}. \membersection{wxRichTextCtrl::ApplyBoldToSelection}\label{wxrichtextctrlapplyboldtoselection} @@ -101,7 +113,7 @@ Returns \true if undo commands are being batched. Begins using alignment -For alignment values, see \helpref{wxTextAttrEx}{wxtextattrex}. +For alignment values, see \helpref{wxTextAttr}{wxtextattr}. \membersection{wxRichTextCtrl::BeginBatchUndo}\label{wxrichtextctrlbeginbatchundo} @@ -171,6 +183,12 @@ defined for convenience: \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}} @@ -186,16 +204,22 @@ application should take care of incrementing the numbering. {\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 +#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} } @@ -225,7 +249,7 @@ Begins a right indent, specified in tenths of a millimetre. \membersection{wxRichTextCtrl::BeginStyle}\label{wxrichtextctrlbeginstyle} -\func{bool}{BeginStyle}{\param{const wxTextAttrEx\& }{style}} +\func{bool}{BeginStyle}{\param{const wxTextAttr\& }{style}} Begins applying a style. @@ -254,6 +278,13 @@ Begins using this colour. 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} @@ -296,6 +327,22 @@ Returns \true if there is a command in the command history that can be undone. 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}} @@ -310,7 +357,9 @@ 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}} +\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. @@ -321,6 +370,12 @@ Creates the underlying window. 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. + \membersection{wxRichTextCtrl::DeleteSelectedContent}\label{wxrichtextctrldeleteselectedcontent} \func{bool}{DeleteSelectedContent}{\param{long* }{newPos = NULL}} @@ -407,6 +462,12 @@ Ends left indent. Ends line spacing. +\membersection{wxRichTextCtrl::EndListStyle}\label{wxrichtextctrlendliststyle} + +\func{bool}{EndListStyle}{\void} + +Ends using a specified list style. + \membersection{wxRichTextCtrl::EndNumberedBullet}\label{wxrichtextctrlendnumberedbullet} \func{bool}{EndNumberedBullet}{\void} @@ -461,6 +522,12 @@ Ends applying a text colour. End applying underlining. +\membersection{wxRichTextCtrl::EndURL}\label{wxrichtextctrlendurl} + +\func{bool}{EndURL}{\void} + +Ends applying a URL. + \membersection{wxRichTextCtrl::ExtendSelection}\label{wxrichtextctrlextendselection} \func{bool}{ExtendSelection}{\param{long }{oldPosition}, \param{long }{newPosition}, \param{int }{flags}} @@ -484,7 +551,7 @@ refresh the control. \membersection{wxRichTextCtrl::GetBasicStyle}\label{wxrichtextctrlgetbasicstyle} -\constfunc{const wxTextAttrEx\&}{GetBasicStyle}{\void} +\constfunc{const wxTextAttr\&}{GetBasicStyle}{\void} Gets the basic (overall) style. This is the style of the whole buffer before further styles are applied, unlike the default style, which @@ -517,13 +584,12 @@ Returns the caret height and position for the given character position Gets the command processor associated with the control's buffer. -\membersection{wxRichTextCtrl::GetDefaultStyleEx}\label{wxrichtextctrlgetdefaultstyleex} +\membersection{wxRichTextCtrl::GetDefaultStyle}\label{wxrichtextctrlgetdefaultstyle} -\constfunc{const wxTextAttrEx\&}{GetDefaultStyleEx}{\void} +\constfunc{const wxTextAttr\&}{GetDefaultStyle}{\void} Returns the current default style, which can be used to change how subsequently inserted -text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function -will become GetDefaultStyle. +text is displayed. \membersection{wxRichTextCtrl::GetDelayedLayoutThreshold}\label{wxrichtextctrlgetdelayedlayoutthreshold} @@ -544,6 +610,13 @@ Gets the current filename associated with the control. Returns the first visible position in the current view. +\membersection{wxRichTextCtrl::GetHandlerFlags}\label{wxrichtextfilehandlergethandlerflags} + +\constfunc{int}{GetHandlerFlags}{\void} + +Returns flags that change the behaviour of loading or saving. See the documentation for each +handler class to see what flags are relevant for each handler. + \membersection{wxRichTextCtrl::GetInsertionPoint}\label{wxrichtextctrlgetinsertionpoint} \constfunc{long}{GetInsertionPoint}{\void} @@ -618,19 +691,21 @@ Returns the text within the current selection range, if any. \membersection{wxRichTextCtrl::GetStyle}\label{wxrichtextctrlgetstyle} -\func{bool}{GetStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}} - -\func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}} - \func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}} -Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient -because it does not use wxFont objects. +Gets the attributes at the given position. This function gets the combined style - that is, the style you see on the screen as a result of combining base style, paragraph style and character style attributes. To get the character or paragraph style alone, use \helpref{GetUncombinedStyle}{wxrichtextctrlgetuncombinedstyle}. +\membersection{wxRichTextCtrl::GetStyleForRange}\label{wxrichtextctrlgetstyleforrange} + +\func{bool}{GetStyleForRange}{\param{const wxRichTextRange\& }{range}, \param{wxTextAttr\& }{style}} + +Gets the attributes common to the specified range. Attributes that differ in value within the range will +not be included in {\it style}'s flags. + \membersection{wxRichTextCtrl::GetStyleSheet}\label{wxrichtextctrlgetstylesheet} \constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void} @@ -640,14 +715,9 @@ character and paragraph styles to be applied. \membersection{wxRichTextCtrl::GetUncombinedStyle}\label{wxrichtextctrlgetuncombinedstyle} -\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}} - -\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}} - \func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttr\& }{style}} -Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient -because it does not use wxFont objects. +Gets the attributes at the given position. This function gets the {\it uncombined style} - that is, the attributes associated with the paragraph or character content, and not necessarily the combined attributes you see on the @@ -673,9 +743,7 @@ if 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}} +\constfunc{bool}{HasCharacterAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttr\& }{style}} Test if this whole range has character attributes of the specified kind. If any of the attributes are different within the range, the test fails. You @@ -684,9 +752,7 @@ flags 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}} +\constfunc{bool}{HasParagraphAttributes}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttr\& }{style}} Test if this whole range has paragraph attributes of the specified kind. If any of the attributes are different within the range, the test fails. You @@ -737,7 +803,7 @@ bool wxRichTextCtrl::IsSelectionBold() { if (HasSelection()) { - wxRichTextAttr attr; + wxTextAttr attr; wxRichTextRange range = GetInternalSelectionRange(); attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT); attr.SetFontWeight(wxBOLD); @@ -748,7 +814,7 @@ bool wxRichTextCtrl::IsSelectionBold() { // 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; + wxTextAttr attr; attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT); long pos = GetAdjustedCaretPosition(GetCaretPosition()); @@ -840,6 +906,14 @@ Lays out the buffer, which must be done before certain operations, such as setting the caret position. This function should not normally be required by the application. +\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, and +can 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}} @@ -941,7 +1015,26 @@ Moves up. \func{bool}{Newline}{\void} -Insert a newline (actually paragraph) at the current insertion point. +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} @@ -1075,6 +1168,26 @@ Internal function to position the visible caret according to the current caret p 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 number +produces 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} @@ -1122,7 +1235,7 @@ Cancels any selection. \membersection{wxRichTextCtrl::SetAndShowDefaultStyle}\label{wxrichtextctrlsetandshowdefaultstyle} -\func{void}{SetAndShowDefaultStyle}{\param{const wxRichTextAttr\& }{attr}} +\func{void}{SetAndShowDefaultStyle}{\param{const wxTextAttr\& }{attr}} Sets {\it attr} as the default style and tells the control that the UI should reflect this attribute until the user moves the caret. @@ -1131,9 +1244,7 @@ See also \helpref{IsDefaultStyleShowing}{wxrichtextctrlisdefaultstyleshowing}. \membersection{wxRichTextCtrl::SetBasicStyle}\label{wxrichtextctrlsetbasicstyle} -\func{void}{SetBasicStyle}{\param{const wxRichTextAttr\& }{style}} - -\func{void}{SetBasicStyle}{\param{const wxTextAttrEx\& }{style}} +\func{void}{SetBasicStyle}{\param{const wxTextAttr\& }{style}} Sets the basic (overall) style. This is the style of the whole buffer before further styles are applied, unlike the default style, which @@ -1149,7 +1260,7 @@ 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}} +\func{bool}{SetDefaultStyle}{\param{const wxTextAttr\& }{style}} Sets the current default style, which can be used to change how subsequently inserted text is displayed. @@ -1185,6 +1296,13 @@ Sets the current filename. 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 each +handler class to see what flags are relevant for each handler. + \membersection{wxRichTextCtrl::SetInsertionPoint}\label{wxrichtextctrlsetinsertionpoint} \func{void}{SetInsertionPoint}{\param{long }{pos}} @@ -1197,6 +1315,25 @@ Sets the insertion point. 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}} @@ -1204,7 +1341,7 @@ Sets the insertion point to the end of the text control. 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). +So, for example, to set the selection for a character at position 5, use the range (5,6). \membersection{wxRichTextCtrl::SetSelectionRange}\label{wxrichtextctrlsetselectionrange} @@ -1213,58 +1350,44 @@ So, for example, to set the style for a character at position 5, use the 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). +So, for example, to set the selection 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{const wxRichTextRange\& }{range}, \param{const wxTextAttr\& }{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 efficient -because it does not use wxFont objects. +Sets the attributes for 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::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{const wxRichTextRange\& }{range}, \param{const wxTextAttr\& }{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}} +\func{bool}{SetStyleEx}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{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 efficient -because it does not use wxFont objects. +Sets the attributes for the given range, passing flags to determine how the attributes are set. 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{verbatim} -#define wxRICHTEXT_SETSTYLE_NONE 0x00 - -// Specifies that this operation should be undoable -#define wxRICHTEXT_SETSTYLE_WITH_UNDO 0x01 - -// Specifies that the style should not be applied if the -// combined style at this point is already the style in question. -#define wxRICHTEXT_SETSTYLE_OPTIMIZE 0x02 - -// 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. -#define wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY 0x04 - -// 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. -#define wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY 0x08 -\end{verbatim} +\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 the +combined 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. +\item wxRICHTEXT\_SETSTYLE\_REMOVE: removes the specified style. Only the style flags are used in this operation. +\end{itemize} \membersection{wxRichTextCtrl::SetStyleSheet}\label{wxrichtextctrlsetstylesheet}