X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2d50a41fc5c7f5be37e2daa0cfb8e506d7c31cf..fcf77487edae715c75f0f802a96e203d88dd56c6:/docs/latex/wx/text.tex

diff --git a/docs/latex/wx/text.tex b/docs/latex/wx/text.tex
index 2e7e589b34..32527801c3 100644
--- a/docs/latex/wx/text.tex
+++ b/docs/latex/wx/text.tex
@@ -95,7 +95,7 @@ streambuf\\
 the message wxEVENT\_TYPE\_TEXT\_ENTER\_COMMAND (otherwise pressing <Enter> is
 either processed internally by the control or used for navigation between
 dialog controls).}
-\twocolitem{\windowstyle{wxTE\_PROCESS\_TAB}}{The control will receieve
+\twocolitem{\windowstyle{wxTE\_PROCESS\_TAB}}{The control will receive
 EVT\_CHAR messages for TAB pressed - normally, TAB is used for passing to the
 next control in a dialog instead. For the control created with this style,
 you can still use Ctrl-Enter to pass to the next control from the keyboard.}
@@ -114,14 +114,40 @@ under Win32 only and requires wxTE\_RICH.}
 doesn't show the selection when it doesn't have focus - use this style to force
 it to always show it. It doesn't do anything under other platforms.}
 \twocolitem{\windowstyle{wxHSCROLL}}{A horizontal scrollbar will be created. No effect under GTK+.}
+\twocolitem{\windowstyle{wxTE\_LEFT}}{The text control will be left-justified (default).}
+\twocolitem{\windowstyle{wxTE\_CENTRE}}{The text control will be centre-justified.}
+\twocolitem{\windowstyle{wxTE\_RIGHT}}{The text control will be right-justified.}
 \twocolitem{\windowstyle{wxTE\_DONTWRAP}}{Same as {\tt wxHSCROLL} style.}
-\twocolitem{\windowstyle{wxTE\_LINEWRAP}}{Wrap the lines too long to be shown entirely at any position (wxUniv only currently)}
-\twocolitem{\windowstyle{wxTE\_WORDWRAP}}{Wrap the lines too long to be shown entirely at word boundaries only (wxUniv only currently)}
+\twocolitem{\windowstyle{wxTE\_LINEWRAP}}{Wrap the lines too long to be shown entirely at any position (wxUniv only currently).}
+\twocolitem{\windowstyle{wxTE\_WORDWRAP}}{Wrap the lines too long to be shown entirely at word boundaries only (wxUniv only currently).}
 \end{twocollist}
 
 See also \helpref{window styles overview}{windowstyles} and
 \helpref{wxTextCtrl::wxTextCtrl}{wxtextctrlconstr}.
 
+\wxheading{wxTextCtrl text format}
+
+The multiline text controls always store the text as a sequence of lines
+separated by {\tt $\backslash$n} characters, i.e. in the Unix text format even
+on non-Unix platforms. This allows the user code to ignore the differences
+between the platforms but at a price: the indices in the control such as those
+returned by \helpref{GetInsertionPoint}{wxtextctrlgetinsertionpoint} or 
+\helpref{GetSelection}{wxtextctrlgetselection} can {\bf not} be used as
+indices into the string returned by \helpref{GetValue}{wxtextctrlgetvalue} as
+they're going to be slightly off for platforms using 
+{\tt $\backslash$r$\backslash$n} as separator (as Windows does), for example.
+
+Instead, if you need to obtain a substring between the $2$ indices obtained
+from the control with the help of the functions mentioned above, you should
+use \helpref{GetRange}{wxtextctrlgetrange}. And the indices themselves can
+only be passed to other methods, for example 
+\helpref{SetInsertionPoint}{wxtextctrlsetinsertionpoint} or 
+\helpref{SetSelection}{wxtextctrlsetselection}.
+
+To summarize: never use the indices returned by (multiline) wxTextCtrl as
+indices into the string it contains, but only as arguments to be passed back
+to the other wxTextCtrl methods.
+
 \wxheading{wxTextCtrl styles}
 
 Multi-line text controls support the styles, i.e. provide a possibility to set
@@ -367,6 +393,9 @@ can be undone.
 
 Clears the text in the control.
 
+Note that this function will generate a {\tt wxEVT\_COMMAND\_TEXT\_UPDATED}
+event.
+
 \membersection{wxTextCtrl::Copy}\label{wxtextctrlcopy}
 
 \func{virtual void}{Copy}{\void}
@@ -548,8 +577,9 @@ returned string is empty.
 \constfunc{wxString}{GetValue}{\void}
 
 Gets the contents of the control. Notice that for a multiline text control,
-the lines will be separated by (Unix-style) $\backslash$n characters, even under
-Windows where they are separated by a $\backslash$r$\backslash$n sequence in the native control.
+the lines will be separated by (Unix-style) $\backslash$n characters, even
+under Windows where they are separated by a $\backslash$r$\backslash$n
+sequence in the native control.
 
 \membersection{wxTextCtrl::IsEditable}\label{wxtextctrliseditable}
 
@@ -567,6 +597,28 @@ read-only mode by a previous call to
 Returns {\tt TRUE} if the text has been modified by user. Note that calling 
 \helpref{SetValue}{wxtextctrlsetvalue} doesn't make the control modified.
 
+\membersection{wxTextCtrl::IsMultiLine}\label{wxtextctrlismultiline}
+
+\constfunc{bool}{IsMultiLine}{\void}
+
+Returns {\tt TRUE} if this is a multi line edit control and {\tt FALSE}
+otherwise.
+
+\wxheading{See also}
+
+\helpref{IsSingleLine}{wxtextctrlissingleline}
+
+\membersection{wxTextCtrl::IsSingleLine}\label{wxtextctrlissingleline}
+
+\constfunc{bool}{IsSingleLine}{\void}
+
+Returns {\tt TRUE} if this is a single line edit control and {\tt FALSE}
+otherwise.
+
+\wxheading{See also}
+
+\helpref{IsMultiLine}{wxtextctrlissingleline}
+
 \membersection{wxTextCtrl::LoadFile}\label{wxtextctrlloadfile}
 
 \func{bool}{LoadFile}{\param{const wxString\& }{ filename}}
@@ -784,7 +836,7 @@ This function sets the maximum number of characters the user can enter into the
 control. In other words, it allows to limit the text value length to {\it len}
 not counting the terminating {\tt NUL} character.
 
-If {\it len} is $0$, the previously set max length limi, if any, is discarded
+If {\it len} is $0$, the previously set max length limit, if any, is discarded
 and the user may enter as much text as the underlying native text control
 widget supports (typically at least 32Kb).
 
@@ -804,7 +856,9 @@ Only implemented in wxMSW/wxGTK starting with wxWindows 2.3.2.
 
 \func{virtual void}{SetSelection}{\param{long}{ from}, \param{long}{ to}}
 
-Selects the text starting at the first position up to (but not including) the character at the last position.
+Selects the text starting at the first position up to (but not including) the
+character at the last position. If both parameters are equal to $-1$ all text
+in the control is selected.
 
 \wxheading{Parameters}
 
@@ -841,6 +895,9 @@ Sets the text value and marks the control as not-modified (which means that
 \helpref{IsModified}{wxtextctrlismodified} would return {\tt FALSE} immediately
 after the call to SetValue).
 
+Note that this function will generate a {\tt wxEVT\_COMMAND\_TEXT\_UPDATED}
+event.
+
 \wxheading{Parameters}
 
 \docparam{value}{The new value to set. It may contain newline characters if the text control is multi-line.}
