]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/datectrl.cpp
Replaced TRUE and FALSE with true and false
[wxWidgets.git] / src / msw / datectrl.cpp
index 3be0445eeb7805d239048329520ed06783b95490..71ba127e719ab3f731262d69bc8c24ad3d30a37f 100644 (file)
 #include "wx/msw/wrapcctl.h"
 #include "wx/msw/private.h"
 
+#if defined(__GNUWIN32__) && ! wxCHECK_W32API_VERSION( 2, 4 )
+typedef struct tagNMDATETIMECHANGE
+{
+    NMHDR       nmhdr;
+    DWORD       dwFlags;
+    SYSTEMTIME  st;
+} NMDATETIMECHANGE, FAR * LPNMDATETIMECHANGE;
+#endif
+
 // ============================================================================
 // implementation
 // ============================================================================
@@ -60,8 +69,8 @@ static inline void wxToSystemTime(SYSTEMTIME *st, const wxDateTime& dt)
 {
     const wxDateTime::Tm tm(dt.GetTm());
 
-    st->wYear = tm.year;
-    st->wMonth = tm.mon - wxDateTime::Jan + 1;
+    st->wYear = (WXWORD)tm.year;
+    st->wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
     st->wDay = tm.mday;
 
     st->wDayOfWeek =
@@ -146,7 +155,12 @@ WXDWORD wxDatePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
         styleMSW |= DTS_UPDOWN;
     //else: drop down by default
 
-    styleMSW |= DTS_SHORTDATEFORMAT;
+#ifdef DTS_SHORTDATECENTURYFORMAT
+    if ( style & wxDP_SHOWCENTURY )
+        styleMSW |= DTS_SHORTDATECENTURYFORMAT;
+    else
+#endif // DTS_SHORTDATECENTURYFORMAT
+        styleMSW |= DTS_SHORTDATEFORMAT;
 
     return styleMSW;
 }
@@ -168,6 +182,14 @@ wxSize wxDatePickerCtrl::DoGetBestSize() const
 // wxDatePickerCtrl operations
 // ----------------------------------------------------------------------------
 
+#ifndef DateTime_GetSystemtime
+    #define DateTime_GetSystemtime DateTime_GetSystemTime
+#endif
+
+#ifndef DateTime_SetSystemtime
+    #define DateTime_SetSystemtime DateTime_SetSystemTime
+#endif
+
 void wxDatePickerCtrl::SetValue(const wxDateTime& dt)
 {
     // as we don't support DTS_SHOWNONE style so far, we don't allow setting