| 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_datetimepicker.h" | 7 #include "xfa/fwl/core/ifwl_datetimepicker.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/core/cfwl_message.h" | 9 #include "xfa/fwl/core/cfwl_message.h" |
| 10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 if (m_iYear > 0 && m_iMonth > 0 && m_iDay > 0) { | 538 if (m_iYear > 0 && m_iMonth > 0 && m_iDay > 0) { |
| 539 m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay); | 539 m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay); |
| 540 } | 540 } |
| 541 m_pMonthCal->Update(); | 541 m_pMonthCal->Update(); |
| 542 } | 542 } |
| 543 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); | 543 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); |
| 544 if (bActivate) { | 544 if (bActivate) { |
| 545 CFWL_MsgSetFocus msg; | 545 CFWL_MsgSetFocus msg; |
| 546 msg.m_pDstTarget = m_pMonthCal.get(); | 546 msg.m_pDstTarget = m_pMonthCal.get(); |
| 547 msg.m_pSrcTarget = m_pEdit.get(); | 547 msg.m_pSrcTarget = m_pEdit.get(); |
| 548 IFWL_WidgetDelegate* pDelegate = m_pEdit->SetDelegate(nullptr); | 548 m_pEdit->GetCurrentDelegate()->OnProcessMessage(&msg); |
| 549 pDelegate->OnProcessMessage(&msg); | |
| 550 } | 549 } |
| 551 CFX_RectF rtInvalidate, rtCal; | 550 CFX_RectF rtInvalidate, rtCal; |
| 552 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, | 551 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, |
| 553 m_pProperties->m_rtWidget.height); | 552 m_pProperties->m_rtWidget.height); |
| 554 m_pMonthCal->GetWidgetRect(rtCal); | 553 m_pMonthCal->GetWidgetRect(rtCal); |
| 555 rtInvalidate.Union(rtCal); | 554 rtInvalidate.Union(rtCal); |
| 556 rtInvalidate.Inflate(2, 2); | 555 rtInvalidate.Inflate(2, 2); |
| 557 Repaint(&rtInvalidate); | 556 Repaint(&rtInvalidate); |
| 558 } | 557 } |
| 559 | 558 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 OnMouseLeave(pMouse); | 704 OnMouseLeave(pMouse); |
| 706 break; | 705 break; |
| 707 } | 706 } |
| 708 default: | 707 default: |
| 709 break; | 708 break; |
| 710 } | 709 } |
| 711 break; | 710 break; |
| 712 } | 711 } |
| 713 case CFWL_MessageType::Key: { | 712 case CFWL_MessageType::Key: { |
| 714 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { | 713 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { |
| 715 IFWL_WidgetDelegate* pDelegate = | 714 m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMessage); |
| 716 m_pOwner->m_pEdit->SetDelegate(nullptr); | |
| 717 pDelegate->OnProcessMessage(pMessage); | |
| 718 return; | 715 return; |
| 719 } | 716 } |
| 720 break; | 717 break; |
| 721 } | 718 } |
| 722 default: | 719 default: |
| 723 break; | 720 break; |
| 724 } | 721 } |
| 725 | 722 |
| 726 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 723 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
| 727 } | 724 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 if (bSet) { | 807 if (bSet) { |
| 811 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 808 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
| 812 if (m_pOwner->m_pEdit && | 809 if (m_pOwner->m_pEdit && |
| 813 !(m_pOwner->m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly)) { | 810 !(m_pOwner->m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly)) { |
| 814 m_pOwner->m_rtBtn.Set(m_pOwner->m_pProperties->m_rtWidget.width, 0, | 811 m_pOwner->m_rtBtn.Set(m_pOwner->m_pProperties->m_rtWidget.width, 0, |
| 815 m_pOwner->m_fBtn, | 812 m_pOwner->m_fBtn, |
| 816 m_pOwner->m_pProperties->m_rtWidget.height - 1); | 813 m_pOwner->m_pProperties->m_rtWidget.height - 1); |
| 817 } | 814 } |
| 818 rtInvalidate = m_pOwner->m_rtBtn; | 815 rtInvalidate = m_pOwner->m_rtBtn; |
| 819 pMsg->m_pDstTarget = m_pOwner->m_pEdit.get(); | 816 pMsg->m_pDstTarget = m_pOwner->m_pEdit.get(); |
| 820 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); | 817 m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg); |
| 821 pDelegate->OnProcessMessage(pMsg); | |
| 822 } else { | 818 } else { |
| 823 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 819 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
| 824 m_pOwner->m_rtBtn.Set(0, 0, 0, 0); | 820 m_pOwner->m_rtBtn.Set(0, 0, 0, 0); |
| 825 if (m_pOwner->DisForm_IsMonthCalendarShowed()) { | 821 if (m_pOwner->DisForm_IsMonthCalendarShowed()) { |
| 826 m_pOwner->ShowMonthCalendar(FALSE); | 822 m_pOwner->ShowMonthCalendar(FALSE); |
| 827 } | 823 } |
| 828 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { | 824 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { |
| 829 pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get(); | 825 pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get(); |
| 830 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr); | 826 m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg); |
| 831 pDelegate->OnProcessMessage(pMsg); | |
| 832 } | 827 } |
| 833 } | 828 } |
| 834 rtInvalidate.Inflate(2, 2); | 829 rtInvalidate.Inflate(2, 2); |
| 835 m_pOwner->Repaint(&rtInvalidate); | 830 m_pOwner->Repaint(&rtInvalidate); |
| 836 } | 831 } |
| 837 | 832 |
| 838 IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::CFWL_MonthCalendarImpDP() { | 833 IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::CFWL_MonthCalendarImpDP() { |
| 839 m_iCurYear = 2010; | 834 m_iCurYear = 2010; |
| 840 m_iCurMonth = 3; | 835 m_iCurMonth = 3; |
| 841 m_iCurDay = 29; | 836 m_iCurDay = 29; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 854 | 849 |
| 855 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurMonth( | 850 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurMonth( |
| 856 IFWL_Widget* pWidget) { | 851 IFWL_Widget* pWidget) { |
| 857 return m_iCurMonth; | 852 return m_iCurMonth; |
| 858 } | 853 } |
| 859 | 854 |
| 860 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurYear( | 855 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurYear( |
| 861 IFWL_Widget* pWidget) { | 856 IFWL_Widget* pWidget) { |
| 862 return m_iCurYear; | 857 return m_iCurYear; |
| 863 } | 858 } |
| OLD | NEW |