1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _core.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13class wxCaret
14{
15    %Docstring
16        Caret(window, width, height)
17        Caret(window, size)
18        Caret()
19
20        A caret is a blinking cursor showing the position where the typed text
21        will appear.
22    %End
23    %TypeHeaderCode
24        #include <wx/caret.h>
25    %End
26
27public:
28    wxCaret(
29        wxWindow * window,
30        int width,
31        int height
32    );
33    %PreMethodCode
34        if (!wxPyCheckForApp()) return NULL;
35    %End
36
37    wxCaret(
38        wxWindow * window,
39        const wxSize & size
40    );
41    %PreMethodCode
42        if (!wxPyCheckForApp()) return NULL;
43    %End
44
45    wxCaret();
46    %PreMethodCode
47        if (!wxPyCheckForApp()) return NULL;
48    %End
49
50    bool Create(
51        wxWindow * window,
52        int width,
53        int height
54    );
55    %Docstring
56        Create(window, width, height) -> bool
57        Create(window, size) -> bool
58
59        Creates a caret with the given size (in pixels) and associates it with
60        the window (same as the equivalent constructors).
61    %End
62
63    bool Create(
64        wxWindow * window,
65        const wxSize & size
66    );
67
68    wxPoint GetPosition() const;
69    %Docstring
70        GetPosition() -> Point
71
72        Get the caret position (in pixels).
73    %End
74
75    wxSize GetSize() const;
76    %Docstring
77        GetSize() -> Size
78
79        Get the caret size.
80    %End
81
82    void Move(
83        int x,
84        int y
85    );
86    %Docstring
87        Move(x, y)
88        Move(pt)
89
90        Move the caret to given position (in logical coordinates).
91    %End
92
93    void Move(
94        const wxPoint & pt
95    );
96
97    void SetSize(
98        int width,
99        int height
100    );
101    %Docstring
102        SetSize(width, height)
103        SetSize(size)
104
105        Changes the size of the caret.
106    %End
107
108    void SetSize(
109        const wxSize & size
110    );
111
112    wxWindow * GetWindow() const;
113    %Docstring
114        GetWindow() -> Window
115
116        Get the window the caret is associated with.
117    %End
118
119    virtual
120    void Hide();
121    %Docstring
122        Hide()
123
124        Hides the caret, same as Show(false).
125    %End
126
127    bool IsOk() const;
128    %Docstring
129        IsOk() -> bool
130
131        Returns true if the caret was created successfully.
132    %End
133
134    bool IsVisible() const;
135    %Docstring
136        IsVisible() -> bool
137
138        Returns true if the caret is visible and false if it is permanently
139        hidden (if it is blinking and not shown currently but will be after
140        the next blink, this method still returns true).
141    %End
142
143    virtual
144    void Show(
145        bool show = true
146    );
147    %Docstring
148        Show(show=True)
149
150        Shows or hides the caret.
151    %End
152
153    static
154    int GetBlinkTime();
155    %Docstring
156        GetBlinkTime() -> int
157
158        Returns the blink time which is measured in milliseconds and is the
159        time elapsed between 2 inversions of the caret (blink time of the
160        caret is the same for all carets, so this functions is static).
161    %End
162
163    static
164    void SetBlinkTime(
165        int milliseconds
166    );
167    %Docstring
168        SetBlinkTime(milliseconds)
169
170        Sets the blink time for all the carets.
171    %End
172
173    private:
174        wxCaret(const wxCaret&);
175
176
177    int __nonzero__();
178    %Docstring
179        __nonzero__() -> int
180    %End
181    %MethodCode
182        PyErr_Clear();
183        Py_BEGIN_ALLOW_THREADS
184        sipRes = _wxCaret___nonzero__(sipCpp);
185        Py_END_ALLOW_THREADS
186        if (PyErr_Occurred()) sipIsErr = 1;
187    %End
188    %TypeCode
189    int _wxCaret___nonzero__(wxCaret* self)
190    {
191        return self->IsOk();
192    }
193    %End
194
195    int __bool__();
196    %Docstring
197        __bool__() -> int
198    %End
199    %MethodCode
200        PyErr_Clear();
201        Py_BEGIN_ALLOW_THREADS
202        sipRes = _wxCaret___bool__(sipCpp);
203        Py_END_ALLOW_THREADS
204        if (PyErr_Occurred()) sipIsErr = 1;
205    %End
206    %TypeCode
207    int _wxCaret___bool__(wxCaret* self)
208    {
209        return self->IsOk();
210    }
211    %End
212
213    public:
214
215
216    %Property(name=Position, get=GetPosition)
217    %Property(name=Size, get=GetSize, set=SetSize)
218    %Property(name=Window, get=GetWindow)
219};  // end of class wxCaret
220
221
222
223//---------------------------------------------------------------------------
224
225