| OLD | NEW | 
|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 
| 6 | 6 | 
| 7 #include "xfa/fwl/core/ifwl_datetimecalendar.h" | 7 #include "xfa/fwl/core/ifwl_datetimecalendar.h" | 
| 8 | 8 | 
| 9 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 9 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 
| 10 #include "xfa/fwl/core/ifwl_datetimepicker.h" | 10 #include "xfa/fwl/core/ifwl_datetimepicker.h" | 
| 11 #include "xfa/fwl/core/ifwl_formproxy.h" | 11 #include "xfa/fwl/core/ifwl_formproxy.h" | 
| 12 | 12 | 
| 13 IFWL_DateTimeCalendar::IFWL_DateTimeCalendar( | 13 IFWL_DateTimeCalendar::IFWL_DateTimeCalendar( | 
| 14     const CFWL_WidgetImpProperties& properties, | 14     const CFWL_WidgetImpProperties& properties, | 
| 15     IFWL_Widget* pOuter) | 15     IFWL_Widget* pOuter) | 
| 16     : IFWL_MonthCalendar(properties, pOuter) {} | 16     : IFWL_MonthCalendar(properties, pOuter) {} | 
| 17 | 17 | 
| 18 FWL_Error IFWL_DateTimeCalendar::Initialize() { | 18 FWL_Error IFWL_DateTimeCalendar::Initialize() { | 
| 19   if (IFWL_MonthCalendar::Initialize() != FWL_Error::Succeeded) | 19   if (IFWL_MonthCalendar::Initialize() != FWL_Error::Succeeded) | 
| 20     return FWL_Error::Indefinite; | 20     return FWL_Error::Indefinite; | 
| 21   delete m_pDelegate; | 21   delete m_pDelegate; | 
| 22   m_pDelegate = new CFWL_DateTimeCalendarImpDelegate(this); | 22   m_pDelegate = new CFWL_DateTimeCalendarImpDelegate(this); | 
| 23   return FWL_Error::Succeeded; | 23   return FWL_Error::Succeeded; | 
| 24 } | 24 } | 
| 25 | 25 | 
| 26 FWL_Error IFWL_DateTimeCalendar::Finalize() { | 26 void IFWL_DateTimeCalendar::Finalize() { | 
| 27   delete m_pDelegate; | 27   delete m_pDelegate; | 
| 28   m_pDelegate = nullptr; | 28   m_pDelegate = nullptr; | 
| 29   return IFWL_MonthCalendar::Finalize(); | 29   IFWL_MonthCalendar::Finalize(); | 
| 30 } | 30 } | 
| 31 | 31 | 
| 32 CFWL_DateTimeCalendarImpDelegate::CFWL_DateTimeCalendarImpDelegate( | 32 CFWL_DateTimeCalendarImpDelegate::CFWL_DateTimeCalendarImpDelegate( | 
| 33     IFWL_DateTimeCalendar* pOwner) | 33     IFWL_DateTimeCalendar* pOwner) | 
| 34     : CFWL_MonthCalendarImpDelegate(pOwner), m_pOwner(pOwner) { | 34     : CFWL_MonthCalendarImpDelegate(pOwner), m_pOwner(pOwner) { | 
| 35   m_bFlag = FALSE; | 35   m_bFlag = FALSE; | 
| 36 } | 36 } | 
| 37 | 37 | 
| 38 void CFWL_DateTimeCalendarImpDelegate::OnProcessMessage( | 38 void CFWL_DateTimeCalendarImpDelegate::OnProcessMessage( | 
| 39     CFWL_Message* pMessage) { | 39     CFWL_Message* pMessage) { | 
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 206       rtInvalidate.Union(lpDatesInfo->rect); | 206       rtInvalidate.Union(lpDatesInfo->rect); | 
| 207     } | 207     } | 
| 208     m_pOwner->AddSelDay(iCurSel); | 208     m_pOwner->AddSelDay(iCurSel); | 
| 209     IFWL_DateTimePicker* pDateTime = | 209     IFWL_DateTimePicker* pDateTime = | 
| 210         static_cast<IFWL_DateTimePicker*>(m_pOwner->m_pOuter); | 210         static_cast<IFWL_DateTimePicker*>(m_pOwner->m_pOuter); | 
| 211     pDateTime->ProcessSelChanged(m_pOwner->m_iCurYear, m_pOwner->m_iCurMonth, | 211     pDateTime->ProcessSelChanged(m_pOwner->m_iCurYear, m_pOwner->m_iCurMonth, | 
| 212                                  iCurSel); | 212                                  iCurSel); | 
| 213     pDateTime->ShowMonthCalendar(FALSE); | 213     pDateTime->ShowMonthCalendar(FALSE); | 
| 214   } | 214   } | 
| 215 } | 215 } | 
| OLD | NEW | 
|---|