]>
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 // namespace for the helper functions related to the date controls
15 namespace wxMSWDateControls
18 // do the one time only initialization of date classes of comctl32.dll, return
19 // true if ok or log an error and return false if we failed (this can only
20 // happen with a very old version of common controls DLL, i.e. before 4.70)
21 extern bool CheckInitialization();
23 // convert SYSTEMTIME to wxDateTime
24 inline void FromSystemTime(wxDateTime
*dt
, const SYSTEMTIME
& st
)
27 wx_static_cast(wxDateTime::Month
, wxDateTime::Jan
+ st
.wMonth
- 1),
32 // convert wxDateTime to SYSTEMTIME
33 inline void ToSystemTime(SYSTEMTIME
*st
, const wxDateTime
& dt
)
35 const wxDateTime::Tm
tm(dt
.GetTm());
37 st
->wYear
= (WXWORD
)tm
.year
;
38 st
->wMonth
= (WXWORD
)(tm
.mon
- wxDateTime::Jan
+ 1);
45 st
->wMilliseconds
= 0;
48 } // namespace wxMSWDateControls
50 #endif // _MSW_PRIVATE_DATECONTROLS_H_