?? text.tex
字號:
\helpref{IsModified}{wxtextctrlismodified}
\membersection{wxTextCtrl::OnDropFiles}\label{wxtextctrlondropfiles}
\func{void}{OnDropFiles}{\param{wxDropFilesEvent\& }{event}}
This event handler function implements default drag and drop behaviour, which
is to load the first dropped file into the control.
\wxheading{Parameters}
\docparam{event}{The drop files event.}
\wxheading{Remarks}
This is not implemented on non-Windows platforms.
\wxheading{See also}
\helpref{wxDropFilesEvent}{wxdropfilesevent}
\membersection{wxTextCtrl::Paste}\label{wxtextctrlpaste}
\func{virtual void}{Paste}{\void}
Pastes text from the clipboard to the text item.
\membersection{wxTextCtrl::PositionToXY}\label{wxtextctrlpositiontoxy}
\constfunc{bool}{PositionToXY}{\param{long }{pos}, \param{long *}{x}, \param{long *}{y}}
Converts given position to a zero-based column, line number pair.
\wxheading{Parameters}
\docparam{pos}{Position.}
\docparam{x}{Receives zero based column number.}
\docparam{y}{Receives zero based line number.}
\wxheading{Return value}
{\tt true} on success, {\tt false} on failure (most likely due to a too large position
parameter).
\wxheading{See also}
\helpref{wxTextCtrl::XYToPosition}{wxtextctrlxytoposition}
\pythonnote{In Python, PositionToXY() returns a tuple containing the x and
y values, so (x,y) = PositionToXY() is equivalent to the call described
above.}
\perlnote{In wxPerl this method only takes the {\tt pos} parameter, and
returns a 2-element list {\tt ( x, y )}.}
\membersection{wxTextCtrl::Redo}\label{wxtextctrlredo}
\func{virtual void}{Redo}{\void}
If there is a redo facility and the last operation can be redone, redoes the last operation. Does nothing
if there is no redo facility.
\membersection{wxTextCtrl::Remove}\label{wxtextctrlremove}
\func{virtual void}{Remove}{\param{long}{ from}, \param{long}{ to}}
Removes the text starting at the first given position up to (but not including)
the character at the last position.
\wxheading{Parameters}
\docparam{from}{The first position.}
\docparam{to}{The last position.}
\membersection{wxTextCtrl::Replace}\label{wxtextctrlreplace}
\func{virtual void}{Replace}{\param{long}{ from}, \param{long}{ to}, \param{const wxString\& }{value}}
Replaces the text starting at the first position up to (but not including)
the character at the last position with the given text.
\wxheading{Parameters}
\docparam{from}{The first position.}
\docparam{to}{The last position.}
\docparam{value}{The value to replace the existing text with.}
\membersection{wxTextCtrl::SaveFile}\label{wxtextctrlsavefile}
\func{bool}{SaveFile}{\param{const wxString\& }{ filename}}
Saves the contents of the control in a text file.
\wxheading{Parameters}
\docparam{filename}{The name of the file in which to save the text.}
\wxheading{Return value}
{\tt true} if the operation was successful, {\tt false} otherwise.
\membersection{wxTextCtrl::SetDefaultStyle}\label{wxtextctrlsetdefaultstyle}
\func{bool}{SetDefaultStyle}{\param{const wxTextAttr\& }{style}}
Changes the default style to use for the new text which is going to be added
to the control using \helpref{WriteText}{wxtextctrlwritetext} or\rtfsp
\helpref{AppendText}{wxtextctrlappendtext}.
If either of the font, foreground, or background colour is not set in\rtfsp
{\it style}, the values of the previous default style are used for them. If
the previous default style didn't set them neither, the global font or colours
of the text control itself are used as fall back.
However if the {\it style} parameter is the default wxTextAttr, then the
default style is just reset (instead of being combined with the new style which
wouldn't change it at all).
\wxheading{Parameters}
\docparam{style}{The style for the new text.}
\wxheading{Return value}
{\tt true} on success, {\tt false} if an error occurred - may also mean that
the styles are not supported under this platform.
\wxheading{See also}
\helpref{GetDefaultStyle}{wxtextctrlgetdefaultstyle}
\membersection{wxTextCtrl::SetEditable}\label{wxtextctrlseteditable}
\func{virtual void}{SetEditable}{\param{const bool}{ editable}}
Makes the text item editable or read-only, overriding the {\bf wxTE\_READONLY} flag.
\wxheading{Parameters}
\docparam{editable}{If {\tt true}, the control is editable. If {\tt false}, the control is read-only.}
\wxheading{See also}
\helpref{IsEditable}{wxtextctrliseditable}
\membersection{wxTextCtrl::SetInsertionPoint}\label{wxtextctrlsetinsertionpoint}
\func{virtual void}{SetInsertionPoint}{\param{long}{ pos}}
Sets the insertion point at the given position.
\wxheading{Parameters}
\docparam{pos}{Position to set.}
\membersection{wxTextCtrl::SetInsertionPointEnd}\label{wxtextctrlsetinsertionpointend}
\func{virtual void}{SetInsertionPointEnd}{\void}
Sets the insertion point at the end of the text control. This is equivalent
to \helpref{SetInsertionPoint}{wxtextctrlsetinsertionpoint}(\helpref{GetLastPosition}{wxtextctrlgetlastposition}()).
\membersection{wxTextCtrl::SetMaxLength}\label{wxtextctrlsetmaxlength}
\func{virtual void}{SetMaxLength}{\param{unsigned long }{len}}
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 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).
If the user tries to enter more characters into the text control when it
already is filled up to the maximal length, a
{\tt wxEVT\_COMMAND\_TEXT\_MAXLEN} event is sent to notify the program about it
(giving it the possibility to show an explanatory message, for example) and the
extra input is discarded.
Note that under GTK+, this function may only be used with single line text controls.
\wxheading{Compatibility}
Only implemented in wxMSW/wxGTK starting with wxWidgets 2.3.2.
\membersection{wxTextCtrl::SetModified}\label{wxtextctrlsetmodified}
\func{void}{SetModified}{\param{bool }{modified}}
Marks the control as being modified by the user or not.
\wxheading{See also}
\helpref{MarkDirty}{wxtextctrlmarkdirty}, \helpref{DiscardEdits}{wxtextctrldiscardedits}
\membersection{wxTextCtrl::SetSelection}\label{wxtextctrlsetselection}
\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. If both parameters are equal to $-1$ all text
in the control is selected.
\wxheading{Parameters}
\docparam{from}{The first position.}
\docparam{to}{The last position.}
\membersection{wxTextCtrl::SetStyle}\label{wxtextctrlsetstyle}
\func{bool}{SetStyle}{\param{long }{start}, \param{long }{end}, \param{const wxTextAttr\& }{style}}
Changes the style of the given range. If any attribute within {\it style} is
not set, the corresponding attribute from \helpref{GetDefaultStyle()}{wxtextctrlgetdefaultstyle} is used.
\wxheading{Parameters}
\docparam{start}{The start of the range to change.}
\docparam{end}{The end of the range to change.}
\docparam{style}{The new style for the range.}
\wxheading{Return value}
{\tt true} on success, {\tt false} if an error occurred - it may also mean that
the styles are not supported under this platform.
\wxheading{See also}
\helpref{wxTextCtrl::GetStyle}{wxtextctrlgetstyle}, \helpref{wxTextAttr}{wxtextattr}
\membersection{wxTextCtrl::SetValue}\label{wxtextctrlsetvalue}
\func{virtual void}{SetValue}{\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 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.}
\membersection{wxTextCtrl::ShowPosition}\label{wxtextctrlshowposition}
\func{void}{ShowPosition}{\param{long}{ pos}}
Makes the line containing the given position visible.
\wxheading{Parameters}
\docparam{pos}{The position that should be visible.}
\membersection{wxTextCtrl::Undo}\label{wxtextctrlundo}
\func{virtual void}{Undo}{\void}
If there is an undo facility and the last operation can be undone, undoes the last operation. Does nothing
if there is no undo facility.
\membersection{wxTextCtrl::WriteText}\label{wxtextctrlwritetext}
\func{void}{WriteText}{\param{const wxString\& }{ text}}
Writes the text into the text control at the current insertion position.
\wxheading{Parameters}
\docparam{text}{Text to write to the text control.}
\wxheading{Remarks}
Newlines in the text string
are the only control characters allowed, and they will cause appropriate
line breaks. See \helpref{wxTextCtrl::\cinsert}{wxtextctrlinsert} and \helpref{wxTextCtrl::AppendText}{wxtextctrlappendtext} for more convenient ways of writing to the window.
After the write operation, the insertion point will be at the end of the inserted text, so subsequent write operations will be appended. To append text after the user may have interacted with the control, call \helpref{wxTextCtrl::SetInsertionPointEnd}{wxtextctrlsetinsertionpointend} before writing.
\membersection{wxTextCtrl::XYToPosition}\label{wxtextctrlxytoposition}
\func{long}{XYToPosition}{\param{long}{ x}, \param{long}{ y}}
Converts the given zero based column and line number to a position.
\wxheading{Parameters}
\docparam{x}{The column number.}
\docparam{y}{The line number.}
\wxheading{Return value}
The position value, or -1 if {\tt x} or {\tt y} was invalid.
\membersection{wxTextCtrl::operator \cinsert}\label{wxtextctrlinsert}
\func{wxTextCtrl\&}{operator \cinsert}{\param{const wxString\& }{s}}
\func{wxTextCtrl\&}{operator \cinsert}{\param{int}{ i}}
\func{wxTextCtrl\&}{operator \cinsert}{\param{long}{ i}}
\func{wxTextCtrl\&}{operator \cinsert}{\param{float}{ f}}
\func{wxTextCtrl\&}{operator \cinsert}{\param{double}{ d}}
\func{wxTextCtrl\&}{operator \cinsert}{\param{char}{ c}}
Operator definitions for appending to a text control, for example:
\begin{verbatim}
wxTextCtrl *wnd = new wxTextCtrl(my_frame);
(*wnd) << "Welcome to text control number " << 1 << ".\n";
\end{verbatim}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -