X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f35b46aabdab414602d27bb92034c371bc09d2e..78cb09ec439962b53ba75fef814b9a3871412287:/docs/latex/wx/text.tex diff --git a/docs/latex/wx/text.tex b/docs/latex/wx/text.tex index 5992858843..9f2d342360 100644 --- a/docs/latex/wx/text.tex +++ b/docs/latex/wx/text.tex @@ -17,6 +17,10 @@ streambuf\\ +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \wxheading{Window styles} \twocolwidtha{5cm} @@ -45,6 +49,10 @@ 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 and used, so that text won't be wrapped. No effect under wxGTK1.} +\twocolitem{\windowstyle{wxTE\_NO\_VSCROLL}}{For multiline controls only: +vertical scrollbar will never be created. This limits the amount of text which +can be entered into the control to what can be displayed in it under MSW but +not under GTK2. Currently not implemented for the other platforms.} \twocolitem{\windowstyle{wxTE\_LEFT}}{The text in the control will be left-justified (default).} \twocolitem{\windowstyle{wxTE\_CENTRE}}{The text in the control will be centered (currently wxMSW and wxGTK2 only).} \twocolitem{\windowstyle{wxTE\_RIGHT}}{The text in the control will be right-justified (currently wxMSW and wxGTK2 only).} @@ -57,6 +65,14 @@ used, so that text won't be wrapped. No effect under wxGTK1.} See also \helpref{window styles overview}{windowstyles} and \helpref{wxTextCtrl::wxTextCtrl}{wxtextctrlctor}. +Note that alignment styles (\windowstyle{wxTE\_LEFT}, +\windowstyle{wxTE\_CENTRE} and \windowstyle{wxTE\_RIGHT}) can be changed +dynamically after control creation on wxMSW and wxGTK. +\windowstyle{wxTE\_READONLY}, \windowstyle{wxTE\_PASSWORD} and wrapping styles +can be dynamically changed under wxGTK but not wxMSW. The other styles can be +only set during control creation. + + \wxheading{wxTextCtrl text format} The multiline text controls always store the text as a sequence of lines @@ -218,9 +234,10 @@ functions that take a \helpref{wxCommandEvent}{wxcommandevent} argument. \twocolwidtha{7cm}% \begin{twocollist}\itemsep=0pt \twocolitem{{\bf EVT\_TEXT(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_UPDATED event, -generated when the text changes. Notice that this event will always be sent +generated when the text changes. Notice that this event will be sent when the text controls contents changes - whether this is due to user input or -comes from the program itself (for example, if SetValue() is called)} +comes from the program itself (for example, if SetValue() is called); see ChangeValue() for +a function which does not send this event.} \twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Respond to a wxEVT\_COMMAND\_TEXT\_ENTER event, generated when enter is pressed in a text control (which must have wxTE\_PROCESS\_ENTER style for this event to be generated).} @@ -311,6 +328,50 @@ the programmer should use \helpref{GetInsertionPoint}{wxtextctrlgetinsertionpoin \helpref{wxTextCtrl::WriteText}{wxtextctrlwritetext} +\membersection{wxTextCtrl::AutoComplete}\label{wxtextctrlautocomplete} + +\func{bool}{AutoComplete}{\param{const wxArrayString\& }{choices}} + +Call this function to enable auto-completion of the text typed in a single-line +text control using the given \arg{choices}. + +Notice that currently this function is only implemented in wxGTK2 and wxMSW +ports and does nothing under the other platforms. + +\newsince{2.9.0} + +\wxheading{Return value} + +\true if the auto-completion was enabled or \false if the operation failed, +typically because auto-completion is not supported by the current platform. + +\wxheading{See also} + +\helpref{AutoCompleteFileNames}{wxtextctrlautocompletefilenames} + + +\membersection{wxTextCtrl::AutoCompleteFileNames}\label{wxtextctrlautocompletefilenames} + +\func{bool}{AutoCompleteFileNames}{\void} + +Call this function to enable auto-completion of the text typed in a single-line +text control using all valid file system paths. + +Notice that currently this function is only implemented in wxGTK2 port and does +nothing under the other platforms. + +\newsince{2.9.0} + +\wxheading{Return value} + +\true if the auto-completion was enabled or \false if the operation failed, +typically because auto-completion is not supported by the current platform. + +\wxheading{See also} + +\helpref{AutoComplete}{wxtextctrlautocomplete} + + \membersection{wxTextCtrl::CanCopy}\label{wxtextctrlcancopy} \func{virtual bool}{CanCopy}{\void} @@ -604,6 +665,7 @@ wxMSW and wxGTK2 ports. \perlnote{In wxPerl this function takes only the position argument and returns a 3-element list \texttt{(result, col, row)}}. + \membersection{wxTextCtrl::IsEditable}\label{wxtextctrliseditable} \constfunc{bool}{IsEditable}{\void} @@ -614,6 +676,17 @@ read-only mode by a previous call to \helpref{SetEditable}{wxtextctrlseteditable}. +\membersection{wxTextCtrl::IsEmpty}\label{wxtextctrlisempty} + +\constfunc{bool}{IsEmpty}{\void} + +Returns \true if the control is currently empty. This is the same as +\texttt{GetValue().empty()} but can be much more efficient for the multiline +controls containing big amounts of text. + +\newsince{2.7.1} + + \membersection{wxTextCtrl::IsModified}\label{wxtextctrlismodified} \constfunc{bool}{IsModified}{\void} @@ -652,7 +725,7 @@ otherwise. \membersection{wxTextCtrl::LoadFile}\label{wxtextctrlloadfile} -\func{bool}{LoadFile}{\param{const wxString\& }{ filename}} +\func{bool}{LoadFile}{\param{const wxString\& }{ filename}, \param{int }{fileType = wxTEXT\_TYPE\_ANY}} Loads and displays the named file, if it exists. @@ -660,6 +733,8 @@ Loads and displays the named file, if it exists. \docparam{filename}{The filename of the file to load.} +\docparam{fileType}{The type of file to load. This is currently ignored in wxTextCtrl.} + \wxheading{Return value} {\tt true} if successful, {\tt false} otherwise. @@ -804,7 +879,7 @@ the character at the last position with the given text. \membersection{wxTextCtrl::SaveFile}\label{wxtextctrlsavefile} -\func{bool}{SaveFile}{\param{const wxString\& }{ filename}} +\func{bool}{SaveFile}{\param{const wxString\& }{ filename}, \param{int }{fileType = wxTEXT\_TYPE\_ANY}} Saves the contents of the control in a text file. @@ -812,6 +887,8 @@ Saves the contents of the control in a text file. \docparam{filename}{The name of the file in which to save the text.} +\docparam{fileType}{The type of file to save. This is currently ignored in wxTextCtrl.} + \wxheading{Return value} {\tt true} if the operation was successful, {\tt false} otherwise. @@ -969,6 +1046,29 @@ after the call to SetValue). Note that this function will generate a {\tt wxEVT\_COMMAND\_TEXT\_UPDATED} event. +This function is deprecated and should not be used in new code. Please use the +\helpref{ChangeValue}{wxtextctrlchangevalue} function instead. + +\wxheading{Parameters} + +\docparam{value}{The new value to set. It may contain newline characters if the text control is multi-line.} + + +\membersection{wxTextCtrl::ChangeValue}\label{wxtextctrlchangevalue} + +\func{virtual void}{ChangeValue}{\param{const wxString\& }{ value}} + +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 \emph{not} generate the {\tt wxEVT\_COMMAND\_TEXT\_UPDATED} +event. +This is the only difference with \helpref{SetValue}{wxtextctrlsetvalue}. +See \helpref{this topic}{progevent} for more information. + +\newsince{2.7.1} + \wxheading{Parameters} \docparam{value}{The new value to set. It may contain newline characters if the text control is multi-line.}