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
}
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 \membersection{wxCaret::GetSize
}\label{wxcaretgetsize
}
77 \constfunc{void
}{GetSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
79 \constfunc{wxSize
}{GetSize
}{\void}
83 \membersection{wxCaret::GetWindow
}\label{wxcaretgetwindow
}
85 \constfunc{wxWindow*
}{GetWindow
}{\void}
87 Get the window the caret is associated with.
89 \membersection{wxCaret::Hide
}\label{wxcarethide
}
91 \func{void
}{Hide
}{\void}
93 Same as
\helpref{wxCaret::Show(FALSE)
}{wxcaretshow
}.
95 \membersection{wxCaret::IsOk
}\label{wxcaretisok
}
97 \constfunc{bool
}{IsOk
}{\void}
99 Returns TRUE if the caret was created successfully.
101 \membersection{wxCaret::IsVisible
}\label{wxcaretisvisible
}
103 \constfunc{bool
}{IsVisible
}{\void}
105 Returns TRUE if the caret is visible and FALSE if it is permanently
106 hidden (if it is is blinking and not shown currently but will be after the
107 next blink, this method still returns TRUE).
109 \membersection{wxCaret::Move
}\label{wxcaretmove
}
111 \func{void
}{Move
}{\param{int
}{x
},
\param{int
}{y
}}
113 \func{void
}{Move
}{\param{const wxPoint\&
}{pt
}}
115 Move the caret to given position (in logical coordinates).
117 \membersection{wxCaret::SetBlinkTime
}\label{wxcaretsetblinktime
}
119 \func{static void
}{SetBlinkTime
}{\param{int
}{milliseconds
}}
121 Sets the blink time for all the carets.
125 Under Windows, this function will change the blink time for
{\bf all
} carets
126 permanently (until the next time it is called), even for the carets in other
131 \helpref{GetBlinkTime
}{wxcaretgetblinktime
}
133 \membersection{wxCaret::SetSize
}\label{wxcaretsetsize
}
135 \func{void
}{SetSize
}{\param{int
}{width
},
\param{int
}{height
}}
137 \func{void
}{SetSize
}{\param{const wxSize\&
}{size
}}
139 Changes the size of the caret.
141 \membersection{wxCaret::Show
}\label{wxcaretshow
}
143 \func{void
}{Show
}{\param{bool
}{show = TRUE
}}
145 Shows or hides the caret. Notice that if the caret was hidden $N$ times, it
146 must be shown $N$ times as well to reappear on the screen.