]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/datectrl.h
move the grid-specific workaround for scrollbar hysteresis to wxScrollHelper itself...
[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
330e8ab9 60 bool SetFormat(const wxString& fmt);
c245a012 61 wxCalendarCtrl *GetCalendar() const;
39df3acd 62
39df3acd 63
4b134bb2
VZ
64 // implementation only from now on
65 // -------------------------------
39df3acd 66
4b134bb2
VZ
67 // overridden base class methods
68 virtual bool Destroy();
39df3acd 69
4b134bb2 70protected:
39df3acd 71 virtual wxSize DoGetBestSize() const;
39df3acd
VZ
72
73private:
39df3acd 74 void Init();
39df3acd 75
1721a8c0 76 void OnText(wxCommandEvent &event);
18fefee7 77 void OnSize(wxSizeEvent& event);
4427c0a3 78 void OnFocus(wxFocusEvent& event);
39df3acd 79
85fa9d60
VZ
80 wxComboCtrl* m_combo;
81 wxCalendarComboPopup* m_popup;
77670008 82
39df3acd 83 DECLARE_EVENT_TABLE()
7ae712f5 84 DECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric)
39df3acd
VZ
85};
86
87#endif // _WX_GENERIC_DATECTRL_H_
88