]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/caret.tex
remove C++ comment
[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
a7af285d
VZ
33\wxheading{Library}
34
35\helpref{wxCore}{librarieslist}
36
f6bcfd97
BP
37\wxheading{Data structures}
38
39\latexignore{\rtfignore{\wxheading{Members}}}
40
41\membersection{wxCaret::wxCaret}\label{wxcaretwxcaret}
42
43\func{}{wxCaret}{\void}
44
45Default constructor: you must use one of Create() functions later.
46
47\func{}{wxCaret}{\param{wxWindow* }{window}, \param{int }{width}, \param{int }{height}}
48
49\func{}{wxCaret}{\param{wxWindowBase* }{window}, \param{const wxSize\& }{size}}
50
51Create the caret of given (in pixels) width and height and associates it
52with the given window.
53
54\membersection{wxCaret::Create}\label{wxcaretcreate}
55
56\func{bool}{Create}{\param{wxWindowBase* }{window}, \param{int }{width}, \param{int }{height}}
57
58\func{bool}{Create}{\param{wxWindowBase* }{window}, \param{const wxSize\& }{size}}
59
60Create the caret of given (in pixels) width and height and associates it
61with the given window (same as constructor).
62
63\membersection{wxCaret::GetBlinkTime}\label{wxcaretgetblinktime}
64
65\func{static int}{GetBlinkTime}{\void}
66
67Returns the blink time which is measured in milliseconds and is the time elapsed
68between 2 inversions of the caret (blink time of the caret is the same
69for all carets, so this functions is static).
70
71\membersection{wxCaret::GetPosition}\label{wxcaretgetposition}
72
73\constfunc{void}{GetPosition}{\param{int* }{x}, \param{int* }{y}}
74
75\constfunc{wxPoint}{GetPosition}{\void}
76
77Get the caret position (in pixels).
78
f3539882
VZ
79\perlnote{In wxPerl there are two methods instead of a single overloaded
80method:\par
81\indented{2cm}{\begin{twocollist}
82\twocolitem{{\bf GetPosition()}}{Returns a Wx::Point}
83\twocolitem{{\bf GetPositionXY()}}{Returns a 2-element list
84 {\tt ( x, y )}}
85\end{twocollist}
86}}
87
f6bcfd97
BP
88\membersection{wxCaret::GetSize}\label{wxcaretgetsize}
89
90\constfunc{void}{GetSize}{\param{int* }{width}, \param{int* }{height}}
91
92\constfunc{wxSize}{GetSize}{\void}
93
94Get the caret size.
95
f3539882
VZ
96\perlnote{In wxPerl there are two methods instead of a single overloaded
97method:\par
98\indented{2cm}{\begin{twocollist}
99\twocolitem{{\bf GetSize()}}{Returns a Wx::Size}
100\twocolitem{{\bf GetSizeWH()}}{Returns a 2-element list
101 {\tt ( width, height )}}
102\end{twocollist}
103}}
104
f6bcfd97
BP
105\membersection{wxCaret::GetWindow}\label{wxcaretgetwindow}
106
107\constfunc{wxWindow*}{GetWindow}{\void}
108
109Get the window the caret is associated with.
110
111\membersection{wxCaret::Hide}\label{wxcarethide}
112
113\func{void}{Hide}{\void}
114
cc81d32f 115Same as \helpref{wxCaret::Show(false)}{wxcaretshow}.
f6bcfd97
BP
116
117\membersection{wxCaret::IsOk}\label{wxcaretisok}
118
119\constfunc{bool}{IsOk}{\void}
120
cc81d32f 121Returns true if the caret was created successfully.
f6bcfd97
BP
122
123\membersection{wxCaret::IsVisible}\label{wxcaretisvisible}
124
125\constfunc{bool}{IsVisible}{\void}
126
cc81d32f 127Returns true if the caret is visible and false if it is permanently
f6bcfd97 128hidden (if it is is blinking and not shown currently but will be after the
cc81d32f 129next blink, this method still returns true).
f6bcfd97
BP
130
131\membersection{wxCaret::Move}\label{wxcaretmove}
132
133\func{void}{Move}{\param{int }{x}, \param{int }{y}}
134
135\func{void}{Move}{\param{const wxPoint\& }{pt}}
136
137Move the caret to given position (in logical coordinates).
138
139\membersection{wxCaret::SetBlinkTime}\label{wxcaretsetblinktime}
140
141\func{static void}{SetBlinkTime}{\param{int }{milliseconds}}
142
143Sets the blink time for all the carets.
144
145\wxheading{Remarks}
146
147Under Windows, this function will change the blink time for {\bf all} carets
148permanently (until the next time it is called), even for the carets in other
149applications.
150
151\wxheading{See also}
152
153\helpref{GetBlinkTime}{wxcaretgetblinktime}
154
155\membersection{wxCaret::SetSize}\label{wxcaretsetsize}
156
157\func{void}{SetSize}{\param{int }{width}, \param{int }{height}}
158
159\func{void}{SetSize}{\param{const wxSize\& }{size}}
160
161Changes the size of the caret.
162
163\membersection{wxCaret::Show}\label{wxcaretshow}
164
cc81d32f 165\func{void}{Show}{\param{bool }{show = true}}
f6bcfd97
BP
166
167Shows or hides the caret. Notice that if the caret was hidden $N$ times, it
168must be shown $N$ times as well to reappear on the screen.
169