]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/caret.tex
ugh. Nesting the (per class) plugin sentries can require them to
[wxWidgets.git] / docs / latex / wx / caret.tex
... / ...
CommitLineData
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: caret.tex
3%% Purpose: wxCaret documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 20.06.00
7%% RCS-ID: $Id$
8%% Copyright: (c) Vadim Zeitlin
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxCaret}}\label{wxcaret}
13
14A caret is a blinking cursor showing the position where the typed text will
15appear. The text controls usually have a caret but wxCaret class also allows
16to use a caret in other windows.
17
18Currently, the caret appears as a rectangle of the given size. In the future,
19it will be possible to specify a bitmap to be used for the caret shape.
20
21A caret is always associated with a window and the current caret can be
22retrieved using \helpref{wxWindow::GetCaret}{wxwindowgetcaret}. The same caret
23can't be reused in two different windows.
24
25\wxheading{Derived from}
26
27No base class
28
29\wxheading{Include files}
30
31<wx/caret.h>
32
33\wxheading{Data structures}
34
35\latexignore{\rtfignore{\wxheading{Members}}}
36
37\membersection{wxCaret::wxCaret}\label{wxcaretwxcaret}
38
39\func{}{wxCaret}{\void}
40
41Default constructor: you must use one of Create() functions later.
42
43\func{}{wxCaret}{\param{wxWindow* }{window}, \param{int }{width}, \param{int }{height}}
44
45\func{}{wxCaret}{\param{wxWindowBase* }{window}, \param{const wxSize\& }{size}}
46
47Create the caret of given (in pixels) width and height and associates it
48with the given window.
49
50\membersection{wxCaret::Create}\label{wxcaretcreate}
51
52\func{bool}{Create}{\param{wxWindowBase* }{window}, \param{int }{width}, \param{int }{height}}
53
54\func{bool}{Create}{\param{wxWindowBase* }{window}, \param{const wxSize\& }{size}}
55
56Create the caret of given (in pixels) width and height and associates it
57with the given window (same as constructor).
58
59\membersection{wxCaret::GetBlinkTime}\label{wxcaretgetblinktime}
60
61\func{static int}{GetBlinkTime}{\void}
62
63Returns the blink time which is measured in milliseconds and is the time elapsed
64between 2 inversions of the caret (blink time of the caret is the same
65for all carets, so this functions is static).
66
67\membersection{wxCaret::GetPosition}\label{wxcaretgetposition}
68
69\constfunc{void}{GetPosition}{\param{int* }{x}, \param{int* }{y}}
70
71\constfunc{wxPoint}{GetPosition}{\void}
72
73Get the caret position (in pixels).
74
75\perlnote{In wxPerl there are two methods instead of a single overloaded
76method:\par
77\indented{2cm}{\begin{twocollist}
78\twocolitem{{\bf GetPosition()}}{Returns a Wx::Point}
79\twocolitem{{\bf GetPositionXY()}}{Returns a 2-element list
80 {\tt ( x, y )}}
81\end{twocollist}
82}}
83
84\membersection{wxCaret::GetSize}\label{wxcaretgetsize}
85
86\constfunc{void}{GetSize}{\param{int* }{width}, \param{int* }{height}}
87
88\constfunc{wxSize}{GetSize}{\void}
89
90Get the caret size.
91
92\perlnote{In wxPerl there are two methods instead of a single overloaded
93method:\par
94\indented{2cm}{\begin{twocollist}
95\twocolitem{{\bf GetSize()}}{Returns a Wx::Size}
96\twocolitem{{\bf GetSizeWH()}}{Returns a 2-element list
97 {\tt ( width, height )}}
98\end{twocollist}
99}}
100
101\membersection{wxCaret::GetWindow}\label{wxcaretgetwindow}
102
103\constfunc{wxWindow*}{GetWindow}{\void}
104
105Get the window the caret is associated with.
106
107\membersection{wxCaret::Hide}\label{wxcarethide}
108
109\func{void}{Hide}{\void}
110
111Same as \helpref{wxCaret::Show(FALSE)}{wxcaretshow}.
112
113\membersection{wxCaret::IsOk}\label{wxcaretisok}
114
115\constfunc{bool}{IsOk}{\void}
116
117Returns TRUE if the caret was created successfully.
118
119\membersection{wxCaret::IsVisible}\label{wxcaretisvisible}
120
121\constfunc{bool}{IsVisible}{\void}
122
123Returns TRUE if the caret is visible and FALSE if it is permanently
124hidden (if it is is blinking and not shown currently but will be after the
125next blink, this method still returns TRUE).
126
127\membersection{wxCaret::Move}\label{wxcaretmove}
128
129\func{void}{Move}{\param{int }{x}, \param{int }{y}}
130
131\func{void}{Move}{\param{const wxPoint\& }{pt}}
132
133Move the caret to given position (in logical coordinates).
134
135\membersection{wxCaret::SetBlinkTime}\label{wxcaretsetblinktime}
136
137\func{static void}{SetBlinkTime}{\param{int }{milliseconds}}
138
139Sets the blink time for all the carets.
140
141\wxheading{Remarks}
142
143Under Windows, this function will change the blink time for {\bf all} carets
144permanently (until the next time it is called), even for the carets in other
145applications.
146
147\wxheading{See also}
148
149\helpref{GetBlinkTime}{wxcaretgetblinktime}
150
151\membersection{wxCaret::SetSize}\label{wxcaretsetsize}
152
153\func{void}{SetSize}{\param{int }{width}, \param{int }{height}}
154
155\func{void}{SetSize}{\param{const wxSize\& }{size}}
156
157Changes the size of the caret.
158
159\membersection{wxCaret::Show}\label{wxcaretshow}
160
161\func{void}{Show}{\param{bool }{show = TRUE}}
162
163Shows or hides the caret. Notice that if the caret was hidden $N$ times, it
164must be shown $N$ times as well to reappear on the screen.
165