]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/datectrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/datectrl.cpp
3 // Purpose: wxDatePickerCtrl implementation
4 // Author: Wlodzimierz ABX Skiba
8 // Copyright: (c) Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
29 #if wxUSE_DATEPICKCTRL
31 #include "wx/datectrl.h"
34 #include "wx/dynlib.h"
36 #define _WX_DEFINE_DATE_EVENTS_
37 #include "wx/dateevt.h"
39 IMPLEMENT_DYNAMIC_CLASS(wxDatePickerCtrl
, wxControl
)
41 // ============================================================================
43 // ============================================================================
45 // ----------------------------------------------------------------------------
46 // wxDatePickerCtrl creation
47 // ----------------------------------------------------------------------------
49 bool wxDatePickerCtrl::Create(wxWindow
*parent
,
55 const wxValidator
& validator
,
58 if(!wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
))
65 label
= dt
.FormatDate();
69 if(!wxControl::PalmCreateControl(selectorTriggerCtl
, label
, pos
, size
))
75 // ----------------------------------------------------------------------------
76 // wxDatePickerCtrl geometry
77 // ----------------------------------------------------------------------------
79 wxSize
wxDatePickerCtrl::DoGetBestSize() const
84 // ----------------------------------------------------------------------------
85 // wxDatePickerCtrl operations
86 // ----------------------------------------------------------------------------
88 void wxDatePickerCtrl::SetValue(const wxDateTime
& dt
)
93 SetLabel(m_dt
.FormatDate());
96 wxDateTime
wxDatePickerCtrl::GetValue() const
101 void wxDatePickerCtrl::SetRange(const wxDateTime
& dt1
, const wxDateTime
& dt2
)
106 bool wxDatePickerCtrl::GetRange(wxDateTime
*dt1
, wxDateTime
*dt2
) const
112 // ----------------------------------------------------------------------------
114 // ----------------------------------------------------------------------------
116 bool wxDatePickerCtrl::SendClickEvent()
118 int16_t month
= (int16_t)m_dt
.GetMonth() + 1;
119 int16_t day
= m_dt
.GetDay();
120 int16_t year
= m_dt
.GetYear();
122 if(!SelectDay(selectDayByDay
,&month
,&day
,&year
,_T("Pick date")))
125 dt
.Set((wxDateTime::wxDateTime_t
)day
,
126 (wxDateTime::Month
)(month
-1),
132 #endif // wxUSE_DATEPICKCTRL