]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/datectrl.h
Fix another line somehow missing from the wxGraphicsBitmap forward port.
[wxWidgets.git] / include / wx / generic / datectrl.h
CommitLineData
39df3acd
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: generic/datectrl.h
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
c245a012
VZ
15#include "wx/calctrl.h"
16#include "wx/combo.h"
17
b5dbe15d 18class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup;
d5ae99f5 19
7ae712f5 20class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric : public wxDatePickerCtrlBase
39df3acd
VZ
21{
22public:
4b134bb2 23 // creating the control
7ae712f5 24 wxDatePickerCtrlGeneric() { Init(); }
85fa9d60 25 virtual ~wxDatePickerCtrlGeneric();
7ae712f5
VZ
26 wxDatePickerCtrlGeneric(wxWindow *parent,
27 wxWindowID id,
28 const wxDateTime& date = wxDefaultDateTime,
29 const wxPoint& pos = wxDefaultPosition,
30 const wxSize& size = wxDefaultSize,
31 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
807f5038 32 const wxValidator& validator = wxDefaultValidator,
7ae712f5
VZ
33 const wxString& name = wxDatePickerCtrlNameStr)
34 {
35 Init();
36
807f5038 37 (void)Create(parent, id, date, pos, size, style, validator, name);
7ae712f5 38 }
39df3acd
VZ
39
40 bool Create(wxWindow *parent,
2cfbeac8
VZ
41 wxWindowID id,
42 const wxDateTime& date = wxDefaultDateTime,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
807f5038 46 const wxValidator& validator = wxDefaultValidator,
2cfbeac8 47 const wxString& name = wxDatePickerCtrlNameStr);
39df3acd 48
4b134bb2 49 // wxDatePickerCtrl methods
39df3acd
VZ
50 void SetValue(const wxDateTime& date);
51 wxDateTime GetValue() const;
4b134bb2 52
39df3acd
VZ
53 bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
54 void SetRange(const wxDateTime &dt1, const wxDateTime &dt2);
55
4b134bb2
VZ
56 bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
57 const wxDateTime& upperdate = wxDefaultDateTime);
58
59 // extra methods available only in this (generic) implementation
c245a012 60 wxCalendarCtrl *GetCalendar() const;
39df3acd 61
39df3acd 62
4b134bb2
VZ
63 // implementation only from now on
64 // -------------------------------
39df3acd 65
4b134bb2
VZ
66 // overridden base class methods
67 virtual bool Destroy();
39df3acd 68
4b134bb2 69protected:
39df3acd 70 virtual wxSize DoGetBestSize() const;
39df3acd
VZ
71
72private:
39df3acd 73 void Init();
39df3acd 74
1721a8c0 75 void OnText(wxCommandEvent &event);
18fefee7 76 void OnSize(wxSizeEvent& event);
4427c0a3 77 void OnFocus(wxFocusEvent& event);
39df3acd 78
85fa9d60
VZ
79 wxComboCtrl* m_combo;
80 wxCalendarComboPopup* m_popup;
77670008 81
39df3acd 82 DECLARE_EVENT_TABLE()
c0c133e1 83 wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric);
39df3acd
VZ
84};
85
86#endif // _WX_GENERIC_DATECTRL_H_
87