]> git.saurik.com Git - wxWidgets.git/blob - include/wx/datectrl.h
PalmOS description.
[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 // wxDatePickerCtrl styles
21 enum
22 {
23 // default style on this platform, either wxDP_SPIN or wxDP_DROPDOWN
24 wxDP_DEFAULT = 0,
25
26 // a spin control-like date picker (not supported in generic version)
27 wxDP_SPIN = 1,
28
29 // a combobox-like date picker (not supported in mac version)
30 wxDP_DROPDOWN = 2
31 };
32
33 // ----------------------------------------------------------------------------
34 // wxDatePickerCtrl: allow the user to enter the date
35 // ----------------------------------------------------------------------------
36
37 class WXDLLIMPEXP_ADV wxDatePickerCtrlBase : public wxControl
38 {
39 public:
40 /*
41 The derived classes should implement ctor and Create() method with the
42 following signature:
43
44 bool Create(wxWindow *parent,
45 wxWindowID id,
46 const wxDateTime& dt = wxDefaultDateTime,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
49 long style = wxDP_DEFAULT,
50 const wxValidator& validator = wxDefaultValidator,
51 const wxString& name = wxDatePickerCtrlNameStr);
52 */
53
54 // set/get the date
55 virtual void SetValue(const wxDateTime& dt) = 0;
56 virtual wxDateTime GetValue() const = 0;
57
58 // set/get the allowed valid range for the dates, if either/both of them
59 // are invalid, there is no corresponding limit and if neither is set
60 // GetRange() returns false
61 virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) = 0;
62 virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0;
63 };
64
65 #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
66 #include "wx/msw/datectrl.h"
67 #else
68 #include "wx/generic/datectrl.h"
69 #endif
70
71 #endif // _WX_DATECTRL_H_
72