]>
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 // ============================================================================
41 // ============================================================================
43 // ----------------------------------------------------------------------------
44 // wxDatePickerCtrl creation
45 // ----------------------------------------------------------------------------
47 bool wxDatePickerCtrl::Create(wxWindow
*parent
,
53 const wxValidator
& validator
,
56 if(!wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
))
62 label
= dt
.FormatDate();
64 if(!wxControl::PalmCreateControl(selectorTriggerCtl
, label
, pos
, size
))
70 // ----------------------------------------------------------------------------
71 // wxDatePickerCtrl geometry
72 // ----------------------------------------------------------------------------
74 wxSize
wxDatePickerCtrl::DoGetBestSize() const
79 // ----------------------------------------------------------------------------
80 // wxDatePickerCtrl operations
81 // ----------------------------------------------------------------------------
83 void wxDatePickerCtrl::SetValue(const wxDateTime
& dt
)
86 SetLabel(dt
.FormatDate());
88 SetLabel(wxEmptyString
);
91 wxDateTime
wxDatePickerCtrl::GetValue() const
98 void wxDatePickerCtrl::SetRange(const wxDateTime
& dt1
, const wxDateTime
& dt2
)
103 bool wxDatePickerCtrl::GetRange(wxDateTime
*dt1
, wxDateTime
*dt2
) const
109 // ----------------------------------------------------------------------------
111 // ----------------------------------------------------------------------------
113 bool wxDatePickerCtrl::SendClickEvent()
115 wxDateTime
dt(wxDateTime::Today());
116 int16_t month
= dt
.GetMonth();
117 int16_t day
= dt
.GetDay();
118 int16_t year
= dt
.GetYear();
120 if(SelectDay(selectDayByMonth
,&month
,&day
,&year
,_T("Pick date")));
123 #endif // wxUSE_DATEPICKCTRL