]>
git.saurik.com Git - wxWidgets.git/blob - interface/caret.h
2a12a4f258d80c3deda29f7654d2ffa79f11e90a
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxCaret class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A caret is a blinking cursor showing the position where the typed text will
14 appear. The text controls usually have a caret but wxCaret class also allows
15 to use a caret in other windows.
17 Currently, the caret appears as a rectangle of the given size. In the future,
18 it will be possible to specify a bitmap to be used for the caret shape.
20 A caret is always associated with a window and the current caret can be
21 retrieved using wxWindow::GetCaret. The same caret
22 can't be reused in two different windows.
35 Create the caret of given (in pixels) width and height and associates it
36 with the given window.
39 wxCaret(wxWindow
* window
, int width
, int height
);
40 wxCaret(wxWindowBase
* window
, const wxSize
& size
);
45 Create the caret of given (in pixels) width and height and associates it
46 with the given window (same as constructor).
48 bool Create(wxWindowBase
* window
, int width
, int height
);
49 bool Create(wxWindowBase
* window
, const wxSize
& size
);
53 Returns the blink time which is measured in milliseconds and is the time elapsed
54 between 2 inversions of the caret (blink time of the caret is the same
55 for all carets, so this functions is static).
57 static int GetBlinkTime();
61 Get the caret position (in pixels).
73 Returns a 2-element list
76 void GetPosition(int* x
, int* y
);
77 wxPoint
GetPosition();
94 Returns a 2-element list
97 void GetSize(int* width
, int* height
);
102 Get the window the caret is associated with.
104 wxWindow
* GetWindow();
107 Same as wxCaret::Show(@false).
112 Returns @true if the caret was created successfully.
114 #define bool IsOk() /* implementation is private */
117 Returns @true if the caret is visible and @false if it is permanently
118 hidden (if it is is blinking and not shown currently but will be after the
119 next blink, this method still returns @true).
125 Move the caret to given position (in logical coordinates).
127 void Move(int x
, int y
);
128 void Move(const wxPoint
& pt
);
132 Sets the blink time for all the carets.
134 @remarks Under Windows, this function will change the blink time for all
135 carets permanently (until the next time it is
136 called), even for the carets in other applications.
140 static void SetBlinkTime(int milliseconds
);
144 Changes the size of the caret.
146 void SetSize(int width
, int height
);
147 void SetSize(const wxSize
& size
);
151 Shows or hides the caret. Notice that if the caret was hidden N times, it
152 must be shown N times as well to reappear on the screen.
154 void Show(bool show
= @
true);