X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23324ae1c7938ba904770fc456d3c07764b9c5e9..3e8ec9540118e43f48507ba2f222a3f8e361b4bb:/interface/caret.h diff --git a/interface/caret.h b/interface/caret.h index dd642a6ba2..4182c41f60 100644 --- a/interface/caret.h +++ b/interface/caret.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: caret.h -// Purpose: documentation for wxCaret class +// Purpose: interface of wxCaret // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -9,133 +9,109 @@ /** @class wxCaret @wxheader{caret.h} - + A caret is a blinking cursor showing the position where the typed text will - appear. The text controls usually have a caret but wxCaret class also allows - to use a caret in other windows. - - Currently, the caret appears as a rectangle of the given size. In the future, - it will be possible to specify a bitmap to be used for the caret shape. - + appear. Text controls usually have their own caret but wxCaret provides a + way to use a caret in other windows. + + Currently, the caret appears as a rectangle of the given size. In the + future, it will be possible to specify a bitmap to be used for the caret + shape. + A caret is always associated with a window and the current caret can be - retrieved using wxWindow::GetCaret. The same caret - can't be reused in two different windows. - + retrieved using wxWindow::GetCaret(). The same caret can't be reused in two + different windows. + @library{wxcore} @category{misc} - - @seealso - wxCaret::GetBlinkTime */ -class wxCaret +class wxCaret { public: - //@{ /** - Create the caret of given (in pixels) width and height and associates it - with the given window. + Default constructor. */ wxCaret(); - wxCaret(wxWindow* window, int width, int height); - wxCaret(wxWindowBase* window, const wxSize& size); + + //@{ + /** + Creates a caret with the given size (in pixels) and associates it with + the @a window. + */ + wxCaret(wxWindow* window, int width, int height); + wxCaret(wxWindowBase* window, const wxSize& size); //@} //@{ /** - Create the caret of given (in pixels) width and height and associates it - with the given window (same as constructor). + Creates a caret with the given size (in pixels) and associates it with + the @a window (same as the equivalent constructors). */ bool Create(wxWindowBase* window, int width, int height); - bool Create(wxWindowBase* window, const wxSize& size); + bool Create(wxWindowBase* window, const wxSize& size); //@} /** - Returns the blink time which is measured in milliseconds and is the time elapsed - between 2 inversions of the caret (blink time of the caret is the same - for all carets, so this functions is static). + Returns the blink time which is measured in milliseconds and is the + time elapsed between 2 inversions of the caret (blink time of the caret + is the same for all carets, so this functions is static). */ static int GetBlinkTime(); //@{ /** Get the caret position (in pixels). - - - - @b GetPosition() - - - Returns a Wx::Point - - @b GetPositionXY() - - - Returns a 2-element list - @c ( x, y ) */ - void GetPosition(int* x, int* y); - wxPoint GetPosition(); + void GetPosition(int* x, int* y) const; + const wxPoint GetPosition() const; //@} //@{ /** Get the caret size. - - - - @b GetSize() - - - Returns a Wx::Size - - @b GetSizeWH() - - - Returns a 2-element list - @c ( width, height ) */ - void GetSize(int* width, int* height); - wxSize GetSize(); + void GetSize(int* width, int* height) const; + const wxSize GetSize() const; //@} /** Get the window the caret is associated with. */ - wxWindow* GetWindow(); + wxWindow* GetWindow() const; /** - Same as wxCaret::Show(@false). + Hides the caret, same as Show(@false). */ void Hide(); /** Returns @true if the caret was created successfully. */ -#define bool IsOk() /* implementation is private */ + bool IsOk() const; /** Returns @true if the caret is visible and @false if it is permanently - hidden (if it is is blinking and not shown currently but will be after the - next blink, this method still returns @true). + hidden (if it is is blinking and not shown currently but will be after + the next blink, this method still returns @true). */ - bool IsVisible(); + bool IsVisible() const; //@{ /** Move the caret to given position (in logical coordinates). */ void Move(int x, int y); - void Move(const wxPoint& pt); + void Move(const wxPoint& pt); //@} /** Sets the blink time for all the carets. - - @remarks Under Windows, this function will change the blink time for all - carets permanently (until the next time it is - called), even for the carets in other applications. - - @sa GetBlinkTime() + + @warning Under Windows, this function will change the blink time for + all carets permanently (until the next time it is called), + even for carets in other applications. + + @see GetBlinkTime() */ static void SetBlinkTime(int milliseconds); @@ -144,12 +120,13 @@ public: Changes the size of the caret. */ void SetSize(int width, int height); - void SetSize(const wxSize& size); + void SetSize(const wxSize& size); //@} /** - Shows or hides the caret. Notice that if the caret was hidden N times, it - must be shown N times as well to reappear on the screen. + Shows or hides the caret. Notice that if the caret was hidden N times, + it must be shown N times as well to reappear on the screen. */ - void Show(bool show = @true); + void Show(bool show = true); }; +