]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/caret.tex
Deprecated SetItemImage with 2 image ids
[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: wxWidgets 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{Data structures}
34
35 \latexignore{\rtfignore{\wxheading{Members}}}
36
37 \membersection{wxCaret::wxCaret}\label{wxcaretwxcaret}
38
39 \func{}{wxCaret}{\void}
40
41 Default 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
47 Create the caret of given (in pixels) width and height and associates it
48 with 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
56 Create the caret of given (in pixels) width and height and associates it
57 with the given window (same as constructor).
58
59 \membersection{wxCaret::GetBlinkTime}\label{wxcaretgetblinktime}
60
61 \func{static int}{GetBlinkTime}{\void}
62
63 Returns the blink time which is measured in milliseconds and is the time elapsed
64 between 2 inversions of the caret (blink time of the caret is the same
65 for 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
73 Get the caret position (in pixels).
74
75 \perlnote{In wxPerl there are two methods instead of a single overloaded
76 method:\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
90 Get the caret size.
91
92 \perlnote{In wxPerl there are two methods instead of a single overloaded
93 method:\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
105 Get the window the caret is associated with.
106
107 \membersection{wxCaret::Hide}\label{wxcarethide}
108
109 \func{void}{Hide}{\void}
110
111 Same as \helpref{wxCaret::Show(false)}{wxcaretshow}.
112
113 \membersection{wxCaret::IsOk}\label{wxcaretisok}
114
115 \constfunc{bool}{IsOk}{\void}
116
117 Returns true if the caret was created successfully.
118
119 \membersection{wxCaret::IsVisible}\label{wxcaretisvisible}
120
121 \constfunc{bool}{IsVisible}{\void}
122
123 Returns true if the caret is visible and false if it is permanently
124 hidden (if it is is blinking and not shown currently but will be after the
125 next 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
133 Move 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
139 Sets the blink time for all the carets.
140
141 \wxheading{Remarks}
142
143 Under Windows, this function will change the blink time for {\bf all} carets
144 permanently (until the next time it is called), even for the carets in other
145 applications.
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
157 Changes the size of the caret.
158
159 \membersection{wxCaret::Show}\label{wxcaretshow}
160
161 \func{void}{Show}{\param{bool }{show = true}}
162
163 Shows or hides the caret. Notice that if the caret was hidden $N$ times, it
164 must be shown $N$ times as well to reappear on the screen.
165