]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/caret.tex
More warning and error fixes (work in progress with Tinderbox).
[wxWidgets.git] / docs / latex / wx / caret.tex
CommitLineData
f6bcfd97
BP
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
8795498c 9%% License: wxWindows license
f6bcfd97
BP
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
9ec98f7c
JS
29\wxheading{Include files}
30
31<wx/caret.h>
32
f6bcfd97
BP
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
f3539882
VZ
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
f6bcfd97
BP
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
f3539882
VZ
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
f6bcfd97
BP
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
cc81d32f 111Same as \helpref{wxCaret::Show(false)}{wxcaretshow}.
f6bcfd97
BP
112
113\membersection{wxCaret::IsOk}\label{wxcaretisok}
114
115\constfunc{bool}{IsOk}{\void}
116
cc81d32f 117Returns true if the caret was created successfully.
f6bcfd97
BP
118
119\membersection{wxCaret::IsVisible}\label{wxcaretisvisible}
120
121\constfunc{bool}{IsVisible}{\void}
122
cc81d32f 123Returns true if the caret is visible and false if it is permanently
f6bcfd97 124hidden (if it is is blinking and not shown currently but will be after the
cc81d32f 125next blink, this method still returns true).
f6bcfd97
BP
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
cc81d32f 161\func{void}{Show}{\param{bool }{show = true}}
f6bcfd97
BP
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