wxWidgets/docs/latex/wx/caret.tex

166 lines
4.8 KiB
TeX
Raw Normal View History

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name: caret.tex
%% Purpose: wxCaret documentation
%% Author: Vadim Zeitlin
%% Modified by:
%% Created: 20.06.00
%% RCS-ID: $Id$
%% Copyright: (c) Vadim Zeitlin
%% License: wxWidgets license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxCaret}}\label{wxcaret}
A caret is a blinking cursor showing the position where the typed text will
appear. The text controls usually have a caret but wxCaret class also allows
to use a caret in other windows.
Currently, the caret appears as a rectangle of the given size. In the future,
it will be possible to specify a bitmap to be used for the caret shape.
A caret is always associated with a window and the current caret can be
retrieved using \helpref{wxWindow::GetCaret}{wxwindowgetcaret}. The same caret
can't be reused in two different windows.
\wxheading{Derived from}
No base class
\wxheading{Include files}
<wx/caret.h>
\wxheading{Data structures}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxCaret::wxCaret}\label{wxcaretwxcaret}
\func{}{wxCaret}{\void}
Default constructor: you must use one of Create() functions later.
\func{}{wxCaret}{\param{wxWindow* }{window}, \param{int }{width}, \param{int }{height}}
\func{}{wxCaret}{\param{wxWindowBase* }{window}, \param{const wxSize\& }{size}}
Create the caret of given (in pixels) width and height and associates it
with the given window.
\membersection{wxCaret::Create}\label{wxcaretcreate}
\func{bool}{Create}{\param{wxWindowBase* }{window}, \param{int }{width}, \param{int }{height}}
\func{bool}{Create}{\param{wxWindowBase* }{window}, \param{const wxSize\& }{size}}
Create the caret of given (in pixels) width and height and associates it
with the given window (same as constructor).
\membersection{wxCaret::GetBlinkTime}\label{wxcaretgetblinktime}
\func{static int}{GetBlinkTime}{\void}
Returns the blink time which is measured in milliseconds and is the time elapsed
between 2 inversions of the caret (blink time of the caret is the same
for all carets, so this functions is static).
\membersection{wxCaret::GetPosition}\label{wxcaretgetposition}
\constfunc{void}{GetPosition}{\param{int* }{x}, \param{int* }{y}}
\constfunc{wxPoint}{GetPosition}{\void}
Get the caret position (in pixels).
\perlnote{In wxPerl there are two methods instead of a single overloaded
method:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetPosition()}}{Returns a Wx::Point}
\twocolitem{{\bf GetPositionXY()}}{Returns a 2-element list
{\tt ( x, y )}}
\end{twocollist}
}}
\membersection{wxCaret::GetSize}\label{wxcaretgetsize}
\constfunc{void}{GetSize}{\param{int* }{width}, \param{int* }{height}}
\constfunc{wxSize}{GetSize}{\void}
Get the caret size.
\perlnote{In wxPerl there are two methods instead of a single overloaded
method:\par
\indented{2cm}{\begin{twocollist}
\twocolitem{{\bf GetSize()}}{Returns a Wx::Size}
\twocolitem{{\bf GetSizeWH()}}{Returns a 2-element list
{\tt ( width, height )}}
\end{twocollist}
}}
\membersection{wxCaret::GetWindow}\label{wxcaretgetwindow}
\constfunc{wxWindow*}{GetWindow}{\void}
Get the window the caret is associated with.
\membersection{wxCaret::Hide}\label{wxcarethide}
\func{void}{Hide}{\void}
Same as \helpref{wxCaret::Show(false)}{wxcaretshow}.
\membersection{wxCaret::IsOk}\label{wxcaretisok}
\constfunc{bool}{IsOk}{\void}
Returns true if the caret was created successfully.
\membersection{wxCaret::IsVisible}\label{wxcaretisvisible}
\constfunc{bool}{IsVisible}{\void}
Returns true if the caret is visible and false if it is permanently
hidden (if it is is blinking and not shown currently but will be after the
next blink, this method still returns true).
\membersection{wxCaret::Move}\label{wxcaretmove}
\func{void}{Move}{\param{int }{x}, \param{int }{y}}
\func{void}{Move}{\param{const wxPoint\& }{pt}}
Move the caret to given position (in logical coordinates).
\membersection{wxCaret::SetBlinkTime}\label{wxcaretsetblinktime}
\func{static void}{SetBlinkTime}{\param{int }{milliseconds}}
Sets the blink time for all the carets.
\wxheading{Remarks}
Under Windows, this function will change the blink time for {\bf all} carets
permanently (until the next time it is called), even for the carets in other
applications.
\wxheading{See also}
\helpref{GetBlinkTime}{wxcaretgetblinktime}
\membersection{wxCaret::SetSize}\label{wxcaretsetsize}
\func{void}{SetSize}{\param{int }{width}, \param{int }{height}}
\func{void}{SetSize}{\param{const wxSize\& }{size}}
Changes the size of the caret.
\membersection{wxCaret::Show}\label{wxcaretshow}
\func{void}{Show}{\param{bool }{show = true}}
Shows or hides the caret. Notice that if the caret was hidden $N$ times, it
must be shown $N$ times as well to reappear on the screen.