]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/caret.tex
fix ReceiveTimeout() reference
[wxWidgets.git] / docs / latex / wx / caret.tex
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
14 A caret is a blinking cursor showing the position where the typed text will
15 appear. The text controls usually have a caret but wxCaret class also allows
16 to use a caret in other windows.
17
18 Currently, the caret appears as a rectangle of the given size. In the future,
19 it will be possible to specify a bitmap to be used for the caret shape.
20
21 A caret is always associated with a window and the current caret can be
22 retrieved using \helpref{wxWindow::GetCaret}{wxwindowgetcaret}. The same caret
23 can't be reused in two different windows.
24
25 \wxheading{Derived from}
26
27 No base class
28
29 \wxheading{Include files}
30
31 <wx/caret.h>
32
33 \wxheading{Library}
34
35 \helpref{wxCore}{librarieslist}
36
37 \wxheading{Data structures}
38
39 \latexignore{\rtfignore{\wxheading{Members}}}
40
41 \membersection{wxCaret::wxCaret}\label{wxcaretwxcaret}
42
43 \func{}{wxCaret}{\void}
44
45 Default 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
51 Create the caret of given (in pixels) width and height and associates it
52 with 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
60 Create the caret of given (in pixels) width and height and associates it
61 with the given window (same as constructor).
62
63 \membersection{wxCaret::GetBlinkTime}\label{wxcaretgetblinktime}
64
65 \func{static int}{GetBlinkTime}{\void}
66
67 Returns the blink time which is measured in milliseconds and is the time elapsed
68 between 2 inversions of the caret (blink time of the caret is the same
69 for 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
77 Get the caret position (in pixels).
78
79 \perlnote{In wxPerl there are two methods instead of a single overloaded
80 method:\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
88 \membersection{wxCaret::GetSize}\label{wxcaretgetsize}
89
90 \constfunc{void}{GetSize}{\param{int* }{width}, \param{int* }{height}}
91
92 \constfunc{wxSize}{GetSize}{\void}
93
94 Get the caret size.
95
96 \perlnote{In wxPerl there are two methods instead of a single overloaded
97 method:\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
105 \membersection{wxCaret::GetWindow}\label{wxcaretgetwindow}
106
107 \constfunc{wxWindow*}{GetWindow}{\void}
108
109 Get the window the caret is associated with.
110
111 \membersection{wxCaret::Hide}\label{wxcarethide}
112
113 \func{void}{Hide}{\void}
114
115 Same as \helpref{wxCaret::Show(false)}{wxcaretshow}.
116
117 \membersection{wxCaret::IsOk}\label{wxcaretisok}
118
119 \constfunc{bool}{IsOk}{\void}
120
121 Returns true if the caret was created successfully.
122
123 \membersection{wxCaret::IsVisible}\label{wxcaretisvisible}
124
125 \constfunc{bool}{IsVisible}{\void}
126
127 Returns true if the caret is visible and false if it is permanently
128 hidden (if it is is blinking and not shown currently but will be after the
129 next blink, this method still returns true).
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
137 Move 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
143 Sets the blink time for all the carets.
144
145 \wxheading{Remarks}
146
147 Under Windows, this function will change the blink time for {\bf all} carets
148 permanently (until the next time it is called), even for the carets in other
149 applications.
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
161 Changes the size of the caret.
162
163 \membersection{wxCaret::Show}\label{wxcaretshow}
164
165 \func{void}{Show}{\param{bool }{show = true}}
166
167 Shows or hides the caret. Notice that if the caret was hidden $N$ times, it
168 must be shown $N$ times as well to reappear on the screen.
169