]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/datectrl.h
Use correct reload flags on all platforms to avoid compilation errors
[wxWidgets.git] / include / wx / generic / datectrl.h
CommitLineData
39df3acd 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/generic/datectrl.h
39df3acd
VZ
3// Purpose: generic wxDatePickerCtrl implementation
4// Author: Andreas Pflug
5// Modified by:
6// Created: 2005-01-19
7// RCS-ID: $Id$
8// Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_GENERIC_DATECTRL_H_
13#define _WX_GENERIC_DATECTRL_H_
14
a9e41db7
VZ
15#include "wx/compositewin.h"
16
4a40cd9b 17class WXDLLIMPEXP_FWD_CORE wxComboCtrl;
c245a012 18
4a40cd9b 19class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl;
b5dbe15d 20class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup;
d5ae99f5 21
a9e41db7
VZ
22class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric
23 : public wxCompositeWindow<wxDatePickerCtrlBase>
39df3acd
VZ
24{
25public:
4b134bb2 26 // creating the control
7ae712f5 27 wxDatePickerCtrlGeneric() { Init(); }
85fa9d60 28 virtual ~wxDatePickerCtrlGeneric();
7ae712f5
VZ
29 wxDatePickerCtrlGeneric(wxWindow *parent,
30 wxWindowID id,
31 const wxDateTime& date = wxDefaultDateTime,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
807f5038 35 const wxValidator& validator = wxDefaultValidator,
7ae712f5
VZ
36 const wxString& name = wxDatePickerCtrlNameStr)
37 {
38 Init();
39
807f5038 40 (void)Create(parent, id, date, pos, size, style, validator, name);
7ae712f5 41 }
39df3acd
VZ
42
43 bool Create(wxWindow *parent,
2cfbeac8
VZ
44 wxWindowID id,
45 const wxDateTime& date = wxDefaultDateTime,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
807f5038 49 const wxValidator& validator = wxDefaultValidator,
2cfbeac8 50 const wxString& name = wxDatePickerCtrlNameStr);
39df3acd 51
4b134bb2 52 // wxDatePickerCtrl methods
39df3acd
VZ
53 void SetValue(const wxDateTime& date);
54 wxDateTime GetValue() const;
4b134bb2 55
39df3acd
VZ
56 bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
57 void SetRange(const wxDateTime &dt1, const wxDateTime &dt2);
58
4b134bb2
VZ
59 bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
60 const wxDateTime& upperdate = wxDefaultDateTime);
61
62 // extra methods available only in this (generic) implementation
c245a012 63 wxCalendarCtrl *GetCalendar() const;
39df3acd 64
39df3acd 65
4b134bb2
VZ
66 // implementation only from now on
67 // -------------------------------
39df3acd 68
4b134bb2
VZ
69 // overridden base class methods
70 virtual bool Destroy();
39df3acd 71
4b134bb2 72protected:
39df3acd 73 virtual wxSize DoGetBestSize() const;
39df3acd
VZ
74
75private:
39df3acd 76 void Init();
39df3acd 77
a9e41db7
VZ
78 // return the list of the windows composing this one
79 virtual wxWindowList GetCompositeWindowParts() const;
80
1721a8c0 81 void OnText(wxCommandEvent &event);
18fefee7 82 void OnSize(wxSizeEvent& event);
4427c0a3 83 void OnFocus(wxFocusEvent& event);
39df3acd 84
85fa9d60
VZ
85 wxComboCtrl* m_combo;
86 wxCalendarComboPopup* m_popup;
77670008 87
39df3acd 88 DECLARE_EVENT_TABLE()
c0c133e1 89 wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric);
39df3acd
VZ
90};
91
92#endif // _WX_GENERIC_DATECTRL_H_
93