OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_comboedit.h" | 7 #include "xfa/fwl/core/ifwl_comboedit.h" |
8 | 8 |
9 #include "xfa/fde/cfde_txtedtengine.h" | 9 #include "xfa/fde/cfde_txtedtengine.h" |
10 #include "xfa/fwl/core/ifwl_combobox.h" | 10 #include "xfa/fwl/core/ifwl_combobox.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 } else { | 37 } else { |
38 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 38 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
39 ShowCaret(FALSE); | 39 ShowCaret(FALSE); |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 void IFWL_ComboEdit::SetComboBoxFocus(FX_BOOL bSet) { | 43 void IFWL_ComboEdit::SetComboBoxFocus(FX_BOOL bSet) { |
44 m_pOuter->SetFocus(bSet); | 44 m_pOuter->SetFocus(bSet); |
45 } | 45 } |
46 | 46 |
47 CFWL_ComboEditImpDelegate::CFWL_ComboEditImpDelegate(IFWL_ComboEdit* pOwner) | 47 void IFWL_ComboEdit::OnProcessMessage(CFWL_Message* pMessage) { |
48 : CFWL_EditImpDelegate(pOwner), m_pOwner(pOwner) {} | |
49 | |
50 void CFWL_ComboEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | |
51 if (!pMessage) | 48 if (!pMessage) |
52 return; | 49 return; |
53 | 50 |
54 FX_BOOL backDefault = TRUE; | 51 FX_BOOL backDefault = TRUE; |
55 switch (pMessage->GetClassID()) { | 52 switch (pMessage->GetClassID()) { |
56 case CFWL_MessageType::SetFocus: { | 53 case CFWL_MessageType::SetFocus: { |
57 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 54 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
58 backDefault = FALSE; | 55 backDefault = FALSE; |
59 break; | 56 break; |
60 } | 57 } |
61 case CFWL_MessageType::KillFocus: { | 58 case CFWL_MessageType::KillFocus: { |
62 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 59 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
63 backDefault = FALSE; | 60 backDefault = FALSE; |
64 break; | 61 break; |
65 } | 62 } |
66 case CFWL_MessageType::Mouse: { | 63 case CFWL_MessageType::Mouse: { |
67 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); | 64 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); |
68 if ((pMsg->m_dwCmd == FWL_MouseCommand::LeftButtonDown) && | 65 if ((pMsg->m_dwCmd == FWL_MouseCommand::LeftButtonDown) && |
69 ((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)) { | 66 ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)) { |
70 m_pOwner->SetSelected(); | 67 SetSelected(); |
71 m_pOwner->SetComboBoxFocus(TRUE); | 68 SetComboBoxFocus(TRUE); |
72 } | 69 } |
73 break; | 70 break; |
74 } | 71 } |
75 default: | 72 default: |
76 break; | 73 break; |
77 } | 74 } |
78 if (backDefault) | 75 if (backDefault) |
79 CFWL_EditImpDelegate::OnProcessMessage(pMessage); | 76 IFWL_Edit::OnProcessMessage(pMessage); |
80 } | 77 } |
OLD | NEW |