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_datetimeedit.h" | 7 #include "xfa/fwl/core/ifwl_datetimeedit.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_widgetmgr.h" | 10 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 void CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 24 void CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
25 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { | 25 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { |
26 DisForm_OnProcessMessage(pMessage); | 26 DisForm_OnProcessMessage(pMessage); |
27 return; | 27 return; |
28 } | 28 } |
29 | 29 |
30 CFWL_MessageType dwHashCode = pMessage->GetClassID(); | 30 CFWL_MessageType dwHashCode = pMessage->GetClassID(); |
31 if (dwHashCode == CFWL_MessageType::SetFocus || | 31 if (dwHashCode == CFWL_MessageType::SetFocus || |
32 dwHashCode == CFWL_MessageType::KillFocus) { | 32 dwHashCode == CFWL_MessageType::KillFocus) { |
33 IFWL_Widget* pOuter = m_pOwner->GetOuter(); | 33 IFWL_Widget* pOuter = m_pOwner->GetOuter(); |
34 pOuter->GetCurrentDelegate()->OnProcessMessage(pMessage); | 34 pOuter->GetDelegate()->OnProcessMessage(pMessage); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 void CFWL_DateTimeEditImpDelegate::DisForm_OnProcessMessage( | 38 void CFWL_DateTimeEditImpDelegate::DisForm_OnProcessMessage( |
39 CFWL_Message* pMessage) { | 39 CFWL_Message* pMessage) { |
40 CFWL_MessageType dwHashCode = pMessage->GetClassID(); | 40 CFWL_MessageType dwHashCode = pMessage->GetClassID(); |
41 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { | 41 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { |
42 if (dwHashCode == CFWL_MessageType::Mouse) { | 42 if (dwHashCode == CFWL_MessageType::Mouse) { |
43 CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage); | 43 CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage); |
44 if (pMouse->m_dwCmd == FWL_MouseCommand::LeftButtonDown || | 44 if (pMouse->m_dwCmd == FWL_MouseCommand::LeftButtonDown || |
45 pMouse->m_dwCmd == FWL_MouseCommand::RightButtonDown) { | 45 pMouse->m_dwCmd == FWL_MouseCommand::RightButtonDown) { |
46 if ((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) { | 46 if ((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) { |
47 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 47 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
48 } | 48 } |
49 IFWL_DateTimePicker* pDateTime = | 49 IFWL_DateTimePicker* pDateTime = |
50 static_cast<IFWL_DateTimePicker*>(m_pOwner->m_pOuter); | 50 static_cast<IFWL_DateTimePicker*>(m_pOwner->m_pOuter); |
51 if (pDateTime->IsMonthCalendarShowed()) { | 51 if (pDateTime->IsMonthCalendarShowed()) { |
52 CFX_RectF rtInvalidate; | 52 CFX_RectF rtInvalidate; |
53 pDateTime->GetWidgetRect(rtInvalidate); | 53 pDateTime->GetWidgetRect(rtInvalidate); |
54 pDateTime->ShowMonthCalendar(FALSE); | 54 pDateTime->ShowMonthCalendar(FALSE); |
55 rtInvalidate.Offset(-rtInvalidate.left, -rtInvalidate.top); | 55 rtInvalidate.Offset(-rtInvalidate.left, -rtInvalidate.top); |
56 pDateTime->Repaint(&rtInvalidate); | 56 pDateTime->Repaint(&rtInvalidate); |
57 } | 57 } |
58 } | 58 } |
59 } | 59 } |
60 } | 60 } |
61 CFWL_EditImpDelegate::OnProcessMessage(pMessage); | 61 CFWL_EditImpDelegate::OnProcessMessage(pMessage); |
62 } | 62 } |
OLD | NEW |