]>
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"
26 #if wxUSE_DATEPICKCTRL
28 #include "wx/datectrl.h"
35 #include "wx/dynlib.h"
37 #include "wx/dateevt.h"
42 IMPLEMENT_DYNAMIC_CLASS(wxDatePickerCtrl
, wxControl
)
44 // ============================================================================
46 // ============================================================================
48 // ----------------------------------------------------------------------------
49 // wxDatePickerCtrl creation
50 // ----------------------------------------------------------------------------
52 bool wxDatePickerCtrl::Create(wxWindow
*parent
,
58 const wxValidator
& validator
,
61 if(!wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
))
68 label
= dt
.FormatDate();
72 if(!wxControl::PalmCreateControl(selectorTriggerCtl
, label
, pos
, size
))
78 // ----------------------------------------------------------------------------
79 // wxDatePickerCtrl geometry
80 // ----------------------------------------------------------------------------
82 wxSize
wxDatePickerCtrl::DoGetBestSize() const
87 // ----------------------------------------------------------------------------
88 // wxDatePickerCtrl operations
89 // ----------------------------------------------------------------------------
91 void wxDatePickerCtrl::SetValue(const wxDateTime
& dt
)
96 SetLabel(m_dt
.FormatDate());
99 wxDateTime
wxDatePickerCtrl::GetValue() const
104 void wxDatePickerCtrl::SetRange(const wxDateTime
& dt1
, const wxDateTime
& dt2
)
109 bool wxDatePickerCtrl::GetRange(wxDateTime
*dt1
, wxDateTime
*dt2
) const
115 // ----------------------------------------------------------------------------
117 // ----------------------------------------------------------------------------
119 bool wxDatePickerCtrl::SendClickEvent()
121 int16_t month
= (int16_t)m_dt
.GetMonth() + 1;
122 int16_t day
= m_dt
.GetDay();
123 int16_t year
= m_dt
.GetYear();
125 //if(!SelectDay(selectDayByDay,&month,&day,&year,wxT("Pick date")))
126 if(!SelectDay(selectDayByDay
,&month
,&day
,&year
, "Pick date"))
129 dt
.Set((wxDateTime::wxDateTime_t
)day
,
130 (wxDateTime::Month
)(month
-1),
136 #endif // wxUSE_DATEPICKCTRL