| 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/cfwl_datetimepicker.h" | 7 #include "xfa/fwl/cfwl_datetimepicker.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 new CFWL_MonthCalendar(m_pOwnerApp, std::move(monthProp), this)); | 46 new CFWL_MonthCalendar(m_pOwnerApp, std::move(monthProp), this)); |
| 47 | 47 |
| 48 CFX_RectF rtMonthCal = m_pMonthCal->GetAutosizedWidgetRect(); | 48 CFX_RectF rtMonthCal = m_pMonthCal->GetAutosizedWidgetRect(); |
| 49 rtMonthCal.Set(0, 0, rtMonthCal.width, rtMonthCal.height); | 49 rtMonthCal.Set(0, 0, rtMonthCal.width, rtMonthCal.height); |
| 50 m_pMonthCal->SetWidgetRect(rtMonthCal); | 50 m_pMonthCal->SetWidgetRect(rtMonthCal); |
| 51 | 51 |
| 52 auto editProp = pdfium::MakeUnique<CFWL_WidgetProperties>(); | 52 auto editProp = pdfium::MakeUnique<CFWL_WidgetProperties>(); |
| 53 editProp->m_pParent = this; | 53 editProp->m_pParent = this; |
| 54 editProp->m_pThemeProvider = m_pProperties->m_pThemeProvider; | 54 editProp->m_pThemeProvider = m_pProperties->m_pThemeProvider; |
| 55 | 55 |
| 56 m_pEdit.reset(new CFWL_DateTimeEdit(m_pOwnerApp, std::move(editProp), this)); | 56 m_pEdit = pdfium::MakeUnique<CFWL_DateTimeEdit>(m_pOwnerApp, |
| 57 std::move(editProp), this); |
| 57 RegisterEventTarget(m_pMonthCal.get()); | 58 RegisterEventTarget(m_pMonthCal.get()); |
| 58 RegisterEventTarget(m_pEdit.get()); | 59 RegisterEventTarget(m_pEdit.get()); |
| 59 } | 60 } |
| 60 | 61 |
| 61 CFWL_DateTimePicker::~CFWL_DateTimePicker() { | 62 CFWL_DateTimePicker::~CFWL_DateTimePicker() { |
| 62 UnregisterEventTarget(); | 63 UnregisterEventTarget(); |
| 63 } | 64 } |
| 64 | 65 |
| 65 FWL_Type CFWL_DateTimePicker::GetClassID() const { | 66 FWL_Type CFWL_DateTimePicker::GetClassID() const { |
| 66 return FWL_Type::DateTimePicker; | 67 return FWL_Type::DateTimePicker; |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 if (DisForm_IsMonthCalendarVisible()) | 617 if (DisForm_IsMonthCalendarVisible()) |
| 617 ShowMonthCalendar(false); | 618 ShowMonthCalendar(false); |
| 618 if (m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { | 619 if (m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { |
| 619 pMsg->m_pSrcTarget = m_pEdit.get(); | 620 pMsg->m_pSrcTarget = m_pEdit.get(); |
| 620 m_pEdit->GetDelegate()->OnProcessMessage(pMsg); | 621 m_pEdit->GetDelegate()->OnProcessMessage(pMsg); |
| 621 } | 622 } |
| 622 } | 623 } |
| 623 rtInvalidate.Inflate(2, 2); | 624 rtInvalidate.Inflate(2, 2); |
| 624 RepaintRect(rtInvalidate); | 625 RepaintRect(rtInvalidate); |
| 625 } | 626 } |
| OLD | NEW |