timectrl.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/generic/timectrl.h
  3. // Purpose: Generic implementation of wxTimePickerCtrl.
  4. // Author: Paul Breen, Vadim Zeitlin
  5. // Created: 2011-09-22
  6. // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
  7. // Licence: wxWindows licence
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_GENERIC_TIMECTRL_H_
  10. #define _WX_GENERIC_TIMECTRL_H_
  11. #include "wx/containr.h"
  12. #include "wx/compositewin.h"
  13. class WXDLLIMPEXP_ADV wxTimePickerCtrlGeneric
  14. : public wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> >
  15. {
  16. public:
  17. typedef wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> > Base;
  18. // Creating the control.
  19. wxTimePickerCtrlGeneric() { Init(); }
  20. virtual ~wxTimePickerCtrlGeneric();
  21. wxTimePickerCtrlGeneric(wxWindow *parent,
  22. wxWindowID id,
  23. const wxDateTime& date = wxDefaultDateTime,
  24. const wxPoint& pos = wxDefaultPosition,
  25. const wxSize& size = wxDefaultSize,
  26. long style = wxTP_DEFAULT,
  27. const wxValidator& validator = wxDefaultValidator,
  28. const wxString& name = wxTimePickerCtrlNameStr)
  29. {
  30. Init();
  31. (void)Create(parent, id, date, pos, size, style, validator, name);
  32. }
  33. bool Create(wxWindow *parent,
  34. wxWindowID id,
  35. const wxDateTime& date = wxDefaultDateTime,
  36. const wxPoint& pos = wxDefaultPosition,
  37. const wxSize& size = wxDefaultSize,
  38. long style = wxTP_DEFAULT,
  39. const wxValidator& validator = wxDefaultValidator,
  40. const wxString& name = wxTimePickerCtrlNameStr);
  41. // Implement pure virtual wxTimePickerCtrlBase methods.
  42. virtual void SetValue(const wxDateTime& date);
  43. virtual wxDateTime GetValue() const;
  44. protected:
  45. virtual wxSize DoGetBestSize() const;
  46. virtual void DoMoveWindow(int x, int y, int width, int height);
  47. private:
  48. void Init();
  49. // Return the list of the windows composing this one.
  50. virtual wxWindowList GetCompositeWindowParts() const;
  51. // Implementation data.
  52. class wxTimePickerGenericImpl* m_impl;
  53. wxDECLARE_NO_COPY_CLASS(wxTimePickerCtrlGeneric);
  54. };
  55. #endif // _WX_GENERIC_TIMECTRL_H_