2000-07-15 19:51:35 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
%% Name: caret.tex
|
|
|
|
%% Purpose: wxCaret documentation
|
|
|
|
%% Author: Vadim Zeitlin
|
|
|
|
%% Modified by:
|
|
|
|
%% Created: 20.06.00
|
|
|
|
%% RCS-ID: $Id$
|
|
|
|
%% Copyright: (c) Vadim Zeitlin
|
2004-05-04 08:27:20 +00:00
|
|
|
%% License: wxWidgets license
|
2000-07-15 19:51:35 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\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
|
|
|
|
|
2000-08-09 06:25:38 +00:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/caret.h>
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
\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).
|
|
|
|
|
2001-04-14 19:46:05 +00:00
|
|
|
\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}
|
|
|
|
}}
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
\membersection{wxCaret::GetSize}\label{wxcaretgetsize}
|
|
|
|
|
|
|
|
\constfunc{void}{GetSize}{\param{int* }{width}, \param{int* }{height}}
|
|
|
|
|
|
|
|
\constfunc{wxSize}{GetSize}{\void}
|
|
|
|
|
|
|
|
Get the caret size.
|
|
|
|
|
2001-04-14 19:46:05 +00:00
|
|
|
\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}
|
|
|
|
}}
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
\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}
|
|
|
|
|
2003-01-18 00:16:34 +00:00
|
|
|
Same as \helpref{wxCaret::Show(false)}{wxcaretshow}.
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
\membersection{wxCaret::IsOk}\label{wxcaretisok}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsOk}{\void}
|
|
|
|
|
2003-01-18 00:16:34 +00:00
|
|
|
Returns true if the caret was created successfully.
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
\membersection{wxCaret::IsVisible}\label{wxcaretisvisible}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsVisible}{\void}
|
|
|
|
|
2003-01-18 00:16:34 +00:00
|
|
|
Returns true if the caret is visible and false if it is permanently
|
2000-07-15 19:51:35 +00:00
|
|
|
hidden (if it is is blinking and not shown currently but will be after the
|
2003-01-18 00:16:34 +00:00
|
|
|
next blink, this method still returns true).
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
\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}
|
|
|
|
|
2003-01-18 00:16:34 +00:00
|
|
|
\func{void}{Show}{\param{bool }{show = true}}
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|