1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/caret.h
3 // Purpose: generic wxCaret class
4 // Author: Vadim Zeitlin (original code by Robert Roebling)
7 // Copyright: (c) wxWidgets team
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
16 #include "wx/overlay.h"
18 #ifdef wxHAS_NATIVE_OVERLAY
19 #define wxHAS_CARET_USING_OVERLAYS
22 class WXDLLIMPEXP_FWD_CORE wxCaret
;
24 class WXDLLIMPEXP_CORE wxCaretTimer
: public wxTimer
27 wxCaretTimer(wxCaret
*caret
);
28 virtual void Notify();
34 class WXDLLIMPEXP_CORE wxCaret
: public wxCaretBase
39 // default - use Create()
40 wxCaret() : m_timer(this) { InitGeneric(); }
41 // creates a block caret associated with the given window
42 wxCaret(wxWindowBase
*window
, int width
, int height
)
43 : wxCaretBase(window
, width
, height
), m_timer(this) { InitGeneric(); }
44 wxCaret(wxWindowBase
*window
, const wxSize
& size
)
45 : wxCaretBase(window
, size
), m_timer(this) { InitGeneric(); }
52 // called by wxWindow (not using the event tables)
53 virtual void OnSetFocus();
54 virtual void OnKillFocus();
56 // called by wxCaretTimer
60 virtual void DoShow();
61 virtual void DoHide();
62 virtual void DoMove();
63 virtual void DoSize();
65 // blink the caret once
71 // draw the caret on the given DC
72 void DoDraw(wxDC
*dc
, wxWindow
* win
);
75 // GTK specific initialization
78 #ifdef wxHAS_CARET_USING_OVERLAYS
79 // the overlay for displaying the caret
82 // the bitmap holding the part of window hidden by the caret when it was
83 // at (m_xOld, m_yOld)
84 wxBitmap m_bmpUnderCaret
;
90 bool m_blinkedOut
, // true => caret hidden right now
91 m_hasFocus
; // true => our window has focus
94 #endif // _WX_CARET_H_