Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: xfa/fwl/core/ifwl_datetimepicker.cpp

Issue 2466273003: Change IFWL_Widget to store a single delegate. (Closed)
Patch Set: Fix Mac Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_datetimeedit.cpp ('k') | xfa/fwl/core/ifwl_form.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "third_party/base/ptr_util.h" 9 #include "third_party/base/ptr_util.h"
10 #include "xfa/fwl/core/cfwl_message.h" 10 #include "xfa/fwl/core/cfwl_message.h"
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 if (m_iYear > 0 && m_iMonth > 0 && m_iDay > 0) { 513 if (m_iYear > 0 && m_iMonth > 0 && m_iDay > 0) {
514 m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay); 514 m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay);
515 } 515 }
516 m_pMonthCal->Update(); 516 m_pMonthCal->Update();
517 } 517 }
518 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); 518 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate);
519 if (bActivate) { 519 if (bActivate) {
520 CFWL_MsgSetFocus msg; 520 CFWL_MsgSetFocus msg;
521 msg.m_pDstTarget = m_pMonthCal.get(); 521 msg.m_pDstTarget = m_pMonthCal.get();
522 msg.m_pSrcTarget = m_pEdit.get(); 522 msg.m_pSrcTarget = m_pEdit.get();
523 m_pEdit->GetCurrentDelegate()->OnProcessMessage(&msg); 523 m_pEdit->GetDelegate()->OnProcessMessage(&msg);
524 } 524 }
525 CFX_RectF rtInvalidate, rtCal; 525 CFX_RectF rtInvalidate, rtCal;
526 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, 526 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width,
527 m_pProperties->m_rtWidget.height); 527 m_pProperties->m_rtWidget.height);
528 m_pMonthCal->GetWidgetRect(rtCal); 528 m_pMonthCal->GetWidgetRect(rtCal);
529 rtInvalidate.Union(rtCal); 529 rtInvalidate.Union(rtCal);
530 rtInvalidate.Inflate(2, 2); 530 rtInvalidate.Inflate(2, 2);
531 Repaint(&rtInvalidate); 531 Repaint(&rtInvalidate);
532 } 532 }
533 533
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 OnMouseLeave(pMouse); 679 OnMouseLeave(pMouse);
680 break; 680 break;
681 } 681 }
682 default: 682 default:
683 break; 683 break;
684 } 684 }
685 break; 685 break;
686 } 686 }
687 case CFWL_MessageType::Key: { 687 case CFWL_MessageType::Key: {
688 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { 688 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
689 m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMessage); 689 m_pOwner->m_pEdit->GetDelegate()->OnProcessMessage(pMessage);
690 return; 690 return;
691 } 691 }
692 break; 692 break;
693 } 693 }
694 default: 694 default:
695 break; 695 break;
696 } 696 }
697 697
698 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); 698 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage);
699 } 699 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 if (bSet) { 782 if (bSet) {
783 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; 783 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
784 if (m_pOwner->m_pEdit && 784 if (m_pOwner->m_pEdit &&
785 !(m_pOwner->m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly)) { 785 !(m_pOwner->m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly)) {
786 m_pOwner->m_rtBtn.Set(m_pOwner->m_pProperties->m_rtWidget.width, 0, 786 m_pOwner->m_rtBtn.Set(m_pOwner->m_pProperties->m_rtWidget.width, 0,
787 m_pOwner->m_fBtn, 787 m_pOwner->m_fBtn,
788 m_pOwner->m_pProperties->m_rtWidget.height - 1); 788 m_pOwner->m_pProperties->m_rtWidget.height - 1);
789 } 789 }
790 rtInvalidate = m_pOwner->m_rtBtn; 790 rtInvalidate = m_pOwner->m_rtBtn;
791 pMsg->m_pDstTarget = m_pOwner->m_pEdit.get(); 791 pMsg->m_pDstTarget = m_pOwner->m_pEdit.get();
792 m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg); 792 m_pOwner->m_pEdit->GetDelegate()->OnProcessMessage(pMsg);
793 } else { 793 } else {
794 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; 794 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
795 m_pOwner->m_rtBtn.Set(0, 0, 0, 0); 795 m_pOwner->m_rtBtn.Set(0, 0, 0, 0);
796 if (m_pOwner->DisForm_IsMonthCalendarShowed()) { 796 if (m_pOwner->DisForm_IsMonthCalendarShowed()) {
797 m_pOwner->ShowMonthCalendar(FALSE); 797 m_pOwner->ShowMonthCalendar(FALSE);
798 } 798 }
799 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { 799 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
800 pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get(); 800 pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get();
801 m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg); 801 m_pOwner->m_pEdit->GetDelegate()->OnProcessMessage(pMsg);
802 } 802 }
803 } 803 }
804 rtInvalidate.Inflate(2, 2); 804 rtInvalidate.Inflate(2, 2);
805 m_pOwner->Repaint(&rtInvalidate); 805 m_pOwner->Repaint(&rtInvalidate);
806 } 806 }
807 807
808 IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::CFWL_MonthCalendarImpDP() { 808 IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::CFWL_MonthCalendarImpDP() {
809 m_iCurYear = 2010; 809 m_iCurYear = 2010;
810 m_iCurMonth = 3; 810 m_iCurMonth = 3;
811 m_iCurDay = 29; 811 m_iCurDay = 29;
(...skipping 12 matching lines...) Expand all
824 824
825 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurMonth( 825 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurMonth(
826 IFWL_Widget* pWidget) { 826 IFWL_Widget* pWidget) {
827 return m_iCurMonth; 827 return m_iCurMonth;
828 } 828 }
829 829
830 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurYear( 830 int32_t IFWL_DateTimePicker::CFWL_MonthCalendarImpDP::GetCurYear(
831 IFWL_Widget* pWidget) { 831 IFWL_Widget* pWidget) {
832 return m_iCurYear; 832 return m_iCurYear;
833 } 833 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/ifwl_datetimeedit.cpp ('k') | xfa/fwl/core/ifwl_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698