1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxCaret documentation
4 %% Author: Vadim Zeitlin
8 %% Copyright: (c) Vadim Zeitlin
9 %% License: wxWidgets license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxCaret
}}\label{wxcaret
}
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.
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.
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.
25 \wxheading{Derived from
}
29 \wxheading{Include files
}
33 \wxheading{Data structures
}
35 \latexignore{\rtfignore{\wxheading{Members
}}}
37 \membersection{wxCaret::wxCaret
}\label{wxcaretwxcaret
}
39 \func{}{wxCaret
}{\void}
41 Default constructor: you must use one of Create() functions later.
43 \func{}{wxCaret
}{\param{wxWindow*
}{window
},
\param{int
}{width
},
\param{int
}{height
}}
45 \func{}{wxCaret
}{\param{wxWindowBase*
}{window
},
\param{const wxSize\&
}{size
}}
47 Create the caret of given (in pixels) width and height and associates it
48 with the given window.
50 \membersection{wxCaret::Create
}\label{wxcaretcreate
}
52 \func{bool
}{Create
}{\param{wxWindowBase*
}{window
},
\param{int
}{width
},
\param{int
}{height
}}
54 \func{bool
}{Create
}{\param{wxWindowBase*
}{window
},
\param{const wxSize\&
}{size
}}
56 Create the caret of given (in pixels) width and height and associates it
57 with the given window (same as constructor).
59 \membersection{wxCaret::GetBlinkTime
}\label{wxcaretgetblinktime
}
61 \func{static int
}{GetBlinkTime
}{\void}
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).
67 \membersection{wxCaret::GetPosition
}\label{wxcaretgetposition
}
69 \constfunc{void
}{GetPosition
}{\param{int*
}{x
},
\param{int*
}{y
}}
71 \constfunc{wxPoint
}{GetPosition
}{\void}
73 Get the caret position (in pixels).
75 \perlnote{In wxPerl there are two methods instead of a single overloaded
77 \indented{2cm
}{\begin{twocollist
}
78 \twocolitem{{\bf GetPosition()
}}{Returns a Wx::Point
}
79 \twocolitem{{\bf GetPositionXY()
}}{Returns a
2-element list
84 \membersection{wxCaret::GetSize
}\label{wxcaretgetsize
}
86 \constfunc{void
}{GetSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
88 \constfunc{wxSize
}{GetSize
}{\void}
92 \perlnote{In wxPerl there are two methods instead of a single overloaded
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 )
}}
101 \membersection{wxCaret::GetWindow
}\label{wxcaretgetwindow
}
103 \constfunc{wxWindow*
}{GetWindow
}{\void}
105 Get the window the caret is associated with.
107 \membersection{wxCaret::Hide
}\label{wxcarethide
}
109 \func{void
}{Hide
}{\void}
111 Same as
\helpref{wxCaret::Show(false)
}{wxcaretshow
}.
113 \membersection{wxCaret::IsOk
}\label{wxcaretisok
}
115 \constfunc{bool
}{IsOk
}{\void}
117 Returns true if the caret was created successfully.
119 \membersection{wxCaret::IsVisible
}\label{wxcaretisvisible
}
121 \constfunc{bool
}{IsVisible
}{\void}
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).
127 \membersection{wxCaret::Move
}\label{wxcaretmove
}
129 \func{void
}{Move
}{\param{int
}{x
},
\param{int
}{y
}}
131 \func{void
}{Move
}{\param{const wxPoint\&
}{pt
}}
133 Move the caret to given position (in logical coordinates).
135 \membersection{wxCaret::SetBlinkTime
}\label{wxcaretsetblinktime
}
137 \func{static void
}{SetBlinkTime
}{\param{int
}{milliseconds
}}
139 Sets the blink time for all the carets.
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
149 \helpref{GetBlinkTime
}{wxcaretgetblinktime
}
151 \membersection{wxCaret::SetSize
}\label{wxcaretsetsize
}
153 \func{void
}{SetSize
}{\param{int
}{width
},
\param{int
}{height
}}
155 \func{void
}{SetSize
}{\param{const wxSize\&
}{size
}}
157 Changes the size of the caret.
159 \membersection{wxCaret::Show
}\label{wxcaretshow
}
161 \func{void
}{Show
}{\param{bool
}{show = true
}}
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.