]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/private/datecontrols.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/private/datecontrols.h
3 // Purpose: implementation helpers for wxDatePickerCtrl and wxCalendarCtrl
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _MSW_PRIVATE_DATECONTROLS_H_
12 #define _MSW_PRIVATE_DATECONTROLS_H_
14 #include "wx/datetime.h"
16 #include "wx/msw/wrapwin.h"
18 // namespace for the helper functions related to the date controls
19 namespace wxMSWDateControls
22 // do the one time only initialization of date classes of comctl32.dll, return
23 // true if ok or log an error and return false if we failed (this can only
24 // happen with a very old version of common controls DLL, i.e. before 4.70)
25 extern bool CheckInitialization();
27 // convert SYSTEMTIME to wxDateTime
28 inline void FromSystemTime(wxDateTime
*dt
, const SYSTEMTIME
& st
)
31 wx_static_cast(wxDateTime::Month
, wxDateTime::Jan
+ st
.wMonth
- 1),
36 // convert wxDateTime to SYSTEMTIME
37 inline void ToSystemTime(SYSTEMTIME
*st
, const wxDateTime
& dt
)
39 const wxDateTime::Tm
tm(dt
.GetTm());
41 st
->wYear
= (WXWORD
)tm
.year
;
42 st
->wMonth
= (WXWORD
)(tm
.mon
- wxDateTime::Jan
+ 1);
49 st
->wMilliseconds
= 0;
52 } // namespace wxMSWDateControls
54 #endif // _MSW_PRIVATE_DATECONTROLS_H_