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_comboboxproxy.h" | 7 #include "xfa/fwl/core/ifwl_comboboxproxy.h" |
8 | 8 |
9 #include "xfa/fwl/core/fwl_noteimp.h" | 9 #include "xfa/fwl/core/fwl_noteimp.h" |
10 #include "xfa/fwl/core/ifwl_app.h" | 10 #include "xfa/fwl/core/ifwl_app.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 switch (pMessage->GetClassID()) { | 29 switch (pMessage->GetClassID()) { |
30 case CFWL_MessageType::Mouse: { | 30 case CFWL_MessageType::Mouse: { |
31 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); | 31 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); |
32 switch (pMsg->m_dwCmd) { | 32 switch (pMsg->m_dwCmd) { |
33 case FWL_MouseCommand::LeftButtonDown: | 33 case FWL_MouseCommand::LeftButtonDown: |
34 OnLButtonDown(pMsg); | 34 OnLButtonDown(pMsg); |
35 break; | 35 break; |
36 case FWL_MouseCommand::LeftButtonUp: | 36 case FWL_MouseCommand::LeftButtonUp: |
37 OnLButtonUp(pMsg); | 37 OnLButtonUp(pMsg); |
38 break; | 38 break; |
39 case FWL_MouseCommand::Move: | |
40 break; | |
41 default: | 39 default: |
42 break; | 40 break; |
43 } | 41 } |
44 break; | 42 break; |
45 } | 43 } |
46 case CFWL_MessageType::Deactivate: | 44 case CFWL_MessageType::Deactivate: |
47 OnDeactive(static_cast<CFWL_MsgDeactivate*>(pMessage)); | 45 OnDeactive(static_cast<CFWL_MsgDeactivate*>(pMessage)); |
48 break; | 46 break; |
49 case CFWL_MessageType::KillFocus: | 47 case CFWL_MessageType::KillFocus: |
50 OnFocusChanged(static_cast<CFWL_MsgKillFocus*>(pMessage), false); | 48 OnFocusChanged(static_cast<CFWL_MsgKillFocus*>(pMessage), false); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return; | 88 return; |
91 | 89 |
92 CFWL_NoteDriver* pDriver = | 90 CFWL_NoteDriver* pDriver = |
93 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); | 91 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); |
94 pDriver->SetGrab(this, false); | 92 pDriver->SetGrab(this, false); |
95 if (m_bLButtonUpSelf) { | 93 if (m_bLButtonUpSelf) { |
96 CFX_RectF rect; | 94 CFX_RectF rect; |
97 GetWidgetRect(rect); | 95 GetWidgetRect(rect); |
98 rect.left = rect.top = 0; | 96 rect.left = rect.top = 0; |
99 if (!rect.Contains(pMsg->m_fx, pMsg->m_fy) && | 97 if (!rect.Contains(pMsg->m_fx, pMsg->m_fy) && |
100 m_pComboBox->IsDropListShowed()) { | 98 m_pComboBox->IsDropListVisible()) { |
101 m_pComboBox->ShowDropList(false); | 99 m_pComboBox->ShowDropList(false); |
102 } | 100 } |
103 } else { | 101 } else { |
104 m_bLButtonUpSelf = true; | 102 m_bLButtonUpSelf = true; |
105 } | 103 } |
106 } | 104 } |
107 | 105 |
108 void IFWL_ComboBoxProxy::OnDeactive(CFWL_MsgDeactivate* pMsg) { | 106 void IFWL_ComboBoxProxy::OnDeactive(CFWL_MsgDeactivate* pMsg) { |
109 m_pComboBox->ShowDropList(false); | 107 m_pComboBox->ShowDropList(false); |
110 } | 108 } |
111 | 109 |
112 void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_MsgKillFocus* pMsg, bool bSet) { | 110 void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_MsgKillFocus* pMsg, bool bSet) { |
113 if (bSet) | 111 if (bSet) |
114 return; | 112 return; |
115 | 113 |
116 if (!pMsg->m_pSetFocus) | 114 if (!pMsg->m_pSetFocus) |
117 m_pComboBox->ShowDropList(false); | 115 m_pComboBox->ShowDropList(false); |
118 } | 116 } |
OLD | NEW |