]> git.saurik.com Git - wxWidgets.git/blob - include/wx/datectrl.h
added API, docs and Win32 implementation of wxDatePickerCtrl
[wxWidgets.git] / include / wx / datectrl.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/datectrl.h
3 // Purpose: implements wxDatePickerCtrl
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 2005-01-09
7 // RCS-ID: $Id$
8 // Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DATECTRL_H_
13 #define _WX_DATECTRL_H_
14
15 #include "wx/control.h" // the base class
16 #include "wx/datetime.h"
17
18 #define wxDatePickerCtrlNameStr _T("datectrl")
19
20 // ----------------------------------------------------------------------------
21 // wxDatePickerCtrl: allow the user to enter the date
22 // ----------------------------------------------------------------------------
23
24 class WXDLLIMPEXP_ADV wxDatePickerCtrlBase : public wxControl
25 {
26 public:
27 /*
28 The derived classes should implement ctor and Create() method with the
29 following signature:
30
31 bool Create(wxWindow *parent,
32 wxWindowID id,
33 const wxDateTime& dt = wxDefaultDateTime,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = 0,
37 const wxValidator& validator = wxDefaultValidator,
38 const wxString& name = wxDatePickerCtrlNameStr);
39 */
40
41 // set/get the date
42 virtual void SetValue(const wxDateTime& dt) = 0;
43 virtual wxDateTime GetValue() const = 0;
44
45 // set/get the allowed valid range for the dates, if either/both of them
46 // are invalid, there is no corresponding limit and if neither is set
47 // GetRange() returns false
48 virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) = 0;
49 virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0;
50 };
51
52 #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
53 #include "wx/msw/datectrl.h"
54 #else
55 // TODO: #include "wx/generic/datectrl.h"
56 #endif
57
58 #endif // _WX_DATECTRL_H_
59