1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxCaret documentation
4 %% Author: Vadim Zeitlin
8 %% Copyright: (c) Vadim Zeitlin
9 %% License: wxWindows 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
}
35 \helpref{wxCore
}{librarieslist
}
37 \wxheading{Data structures
}
39 \latexignore{\rtfignore{\wxheading{Members
}}}
41 \membersection{wxCaret::wxCaret
}\label{wxcaretwxcaret
}
43 \func{}{wxCaret
}{\void}
45 Default constructor: you must use one of Create() functions later.
47 \func{}{wxCaret
}{\param{wxWindow*
}{window
},
\param{int
}{width
},
\param{int
}{height
}}
49 \func{}{wxCaret
}{\param{wxWindowBase*
}{window
},
\param{const wxSize\&
}{size
}}
51 Create the caret of given (in pixels) width and height and associates it
52 with the given window.
54 \membersection{wxCaret::Create
}\label{wxcaretcreate
}
56 \func{bool
}{Create
}{\param{wxWindowBase*
}{window
},
\param{int
}{width
},
\param{int
}{height
}}
58 \func{bool
}{Create
}{\param{wxWindowBase*
}{window
},
\param{const wxSize\&
}{size
}}
60 Create the caret of given (in pixels) width and height and associates it
61 with the given window (same as constructor).
63 \membersection{wxCaret::GetBlinkTime
}\label{wxcaretgetblinktime
}
65 \func{static int
}{GetBlinkTime
}{\void}
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).
71 \membersection{wxCaret::GetPosition
}\label{wxcaretgetposition
}
73 \constfunc{void
}{GetPosition
}{\param{int*
}{x
},
\param{int*
}{y
}}
75 \constfunc{wxPoint
}{GetPosition
}{\void}
77 Get the caret position (in pixels).
79 \perlnote{In wxPerl there are two methods instead of a single overloaded
81 \indented{2cm
}{\begin{twocollist
}
82 \twocolitem{{\bf GetPosition()
}}{Returns a Wx::Point
}
83 \twocolitem{{\bf GetPositionXY()
}}{Returns a
2-element list
88 \membersection{wxCaret::GetSize
}\label{wxcaretgetsize
}
90 \constfunc{void
}{GetSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
92 \constfunc{wxSize
}{GetSize
}{\void}
96 \perlnote{In wxPerl there are two methods instead of a single overloaded
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 )
}}
105 \membersection{wxCaret::GetWindow
}\label{wxcaretgetwindow
}
107 \constfunc{wxWindow*
}{GetWindow
}{\void}
109 Get the window the caret is associated with.
111 \membersection{wxCaret::Hide
}\label{wxcarethide
}
113 \func{void
}{Hide
}{\void}
115 Same as
\helpref{wxCaret::Show(false)
}{wxcaretshow
}.
117 \membersection{wxCaret::IsOk
}\label{wxcaretisok
}
119 \constfunc{bool
}{IsOk
}{\void}
121 Returns true if the caret was created successfully.
123 \membersection{wxCaret::IsVisible
}\label{wxcaretisvisible
}
125 \constfunc{bool
}{IsVisible
}{\void}
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).
131 \membersection{wxCaret::Move
}\label{wxcaretmove
}
133 \func{void
}{Move
}{\param{int
}{x
},
\param{int
}{y
}}
135 \func{void
}{Move
}{\param{const wxPoint\&
}{pt
}}
137 Move the caret to given position (in logical coordinates).
139 \membersection{wxCaret::SetBlinkTime
}\label{wxcaretsetblinktime
}
141 \func{static void
}{SetBlinkTime
}{\param{int
}{milliseconds
}}
143 Sets the blink time for all the carets.
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
153 \helpref{GetBlinkTime
}{wxcaretgetblinktime
}
155 \membersection{wxCaret::SetSize
}\label{wxcaretsetsize
}
157 \func{void
}{SetSize
}{\param{int
}{width
},
\param{int
}{height
}}
159 \func{void
}{SetSize
}{\param{const wxSize\&
}{size
}}
161 Changes the size of the caret.
163 \membersection{wxCaret::Show
}\label{wxcaretshow
}
165 \func{void
}{Show
}{\param{bool
}{show = true
}}
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.