]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/timectrl.h
Added wxRichToolTip class.
[wxWidgets.git] / include / wx / generic / timectrl.h
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 // RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_GENERIC_TIMECTRL_H_
12 #define _WX_GENERIC_TIMECTRL_H_
13
14 #include "wx/containr.h"
15 #include "wx/compositewin.h"
16
17 class WXDLLIMPEXP_ADV wxTimePickerCtrlGeneric
18 : public wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> >
19 {
20 public:
21 typedef wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> > Base;
22
23 // Creating the control.
24 wxTimePickerCtrlGeneric() { Init(); }
25 virtual ~wxTimePickerCtrlGeneric();
26 wxTimePickerCtrlGeneric(wxWindow *parent,
27 wxWindowID id,
28 const wxDateTime& date = wxDefaultDateTime,
29 const wxPoint& pos = wxDefaultPosition,
30 const wxSize& size = wxDefaultSize,
31 long style = wxTP_DEFAULT,
32 const wxValidator& validator = wxDefaultValidator,
33 const wxString& name = wxTimePickerCtrlNameStr)
34 {
35 Init();
36
37 (void)Create(parent, id, date, pos, size, style, validator, name);
38 }
39
40 bool Create(wxWindow *parent,
41 wxWindowID id,
42 const wxDateTime& date = wxDefaultDateTime,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 long style = wxTP_DEFAULT,
46 const wxValidator& validator = wxDefaultValidator,
47 const wxString& name = wxTimePickerCtrlNameStr);
48
49 // Implement pure virtual wxTimePickerCtrlBase methods.
50 virtual void SetValue(const wxDateTime& date);
51 virtual wxDateTime GetValue() const;
52
53 protected:
54 virtual wxSize DoGetBestSize() const;
55
56 virtual void DoMoveWindow(int x, int y, int width, int height);
57
58 // This is a really ugly hack but to compile this class in wxMSW we must
59 // define these functions even though they are never called because they're
60 // only used by the native implementation.
61 #ifdef __WXMSW__
62 virtual wxLocaleInfo MSWGetFormat() const
63 {
64 wxFAIL_MSG( "Unreachable" );
65 return wxLOCALE_TIME_FMT;
66 }
67
68 virtual bool MSWAllowsNone() const
69 {
70 wxFAIL_MSG( "Unreachable" );
71 return false;
72 }
73
74 virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE& WXUNUSED(dtch))
75 {
76 wxFAIL_MSG( "Unreachable" );
77 return false;
78 }
79 #endif // __WXMSW__
80
81 private:
82 void Init();
83
84 // Return the list of the windows composing this one.
85 virtual wxWindowList GetCompositeWindowParts() const;
86
87 // Implementation data.
88 class wxTimePickerGenericImpl* m_impl;
89
90 wxDECLARE_NO_COPY_CLASS(wxTimePickerCtrlGeneric);
91 };
92
93 #endif // _WX_GENERIC_TIMECTRL_H_