caret.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/caret.h
  3. // Purpose: wxCaret class - the MSW implementation of wxCaret
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 23.05.99
  7. // Copyright: (c) wxWidgets team
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_CARET_H_
  11. #define _WX_CARET_H_
  12. class WXDLLIMPEXP_CORE wxCaret : public wxCaretBase
  13. {
  14. public:
  15. wxCaret() { Init(); }
  16. // create the caret of given (in pixels) width and height and associate
  17. // with the given window
  18. wxCaret(wxWindow *window, int width, int height)
  19. {
  20. Init();
  21. (void)Create(window, width, height);
  22. }
  23. // same as above
  24. wxCaret(wxWindowBase *window, const wxSize& size)
  25. {
  26. Init();
  27. (void)Create(window, size);
  28. }
  29. // process wxWindow notifications
  30. virtual void OnSetFocus();
  31. virtual void OnKillFocus();
  32. protected:
  33. void Init()
  34. {
  35. wxCaretBase::Init();
  36. m_hasCaret = false;
  37. }
  38. // override base class virtuals
  39. virtual void DoMove();
  40. virtual void DoShow();
  41. virtual void DoHide();
  42. virtual void DoSize();
  43. // helper function which creates the system caret
  44. bool MSWCreateCaret();
  45. private:
  46. bool m_hasCaret;
  47. wxDECLARE_NO_COPY_CLASS(wxCaret);
  48. };
  49. #endif // _WX_CARET_H_