]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/caret.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: generic/caret.h
3 // Purpose: generic wxCaret class
4 // Author: Vadim Zeitlin (original code by Robert Roebling)
8 // Copyright: (c) wxWidgets team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
17 class WXDLLIMPEXP_CORE wxCaret
;
19 class WXDLLEXPORT wxCaretTimer
: public wxTimer
22 wxCaretTimer(wxCaret
*caret
);
23 virtual void Notify();
30 #if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS
31 #define wxUSE_OVERLAY 1
33 #define wxUSE_OVERLAY 0
41 class WXDLLIMPEXP_CORE wxCaret
: public wxCaretBase
46 // default - use Create()
47 wxCaret() : m_timer(this) { InitGeneric(); }
48 // creates a block caret associated with the given window
49 wxCaret(wxWindowBase
*window
, int width
, int height
)
50 : wxCaretBase(window
, width
, height
), m_timer(this) { InitGeneric(); }
51 wxCaret(wxWindowBase
*window
, const wxSize
& size
)
52 : wxCaretBase(window
, size
), m_timer(this) { InitGeneric(); }
59 // called by wxWindow (not using the event tables)
60 virtual void OnSetFocus();
61 virtual void OnKillFocus();
63 // called by wxCaretTimer
67 virtual void DoShow();
68 virtual void DoHide();
69 virtual void DoMove();
70 virtual void DoSize();
72 // blink the caret once
78 // draw the caret on the given DC
79 void DoDraw(wxDC
*dc
);
82 // GTK specific initialization
86 // the overlay for displaying the caret
89 // the bitmap holding the part of window hidden by the caret when it was
90 // at (m_xOld, m_yOld)
91 wxBitmap m_bmpUnderCaret
;
97 bool m_blinkedOut
, // true => caret hidden right now
98 m_hasFocus
; // true => our window has focus
101 #endif // _WX_CARET_H_