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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 void IFWL_ComboBoxProxy::OnLButtonUp(CFWL_MsgMouse* pMsg) { | 81 void IFWL_ComboBoxProxy::OnLButtonUp(CFWL_MsgMouse* pMsg) { |
82 m_bLButtonDown = false; | 82 m_bLButtonDown = false; |
83 const IFWL_App* pApp = GetOwnerApp(); | 83 const IFWL_App* pApp = GetOwnerApp(); |
84 if (!pApp) | 84 if (!pApp) |
85 return; | 85 return; |
86 | 86 |
87 CFWL_NoteDriver* pDriver = | 87 CFWL_NoteDriver* pDriver = |
88 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); | 88 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); |
89 pDriver->SetGrab(this, false); | 89 pDriver->SetGrab(this, false); |
90 if (m_bLButtonUpSelf) { | 90 if (!m_bLButtonUpSelf) { |
91 CFX_RectF rect; | |
92 GetWidgetRect(rect); | |
93 rect.left = rect.top = 0; | |
94 if (!rect.Contains(pMsg->m_fx, pMsg->m_fy) && | |
95 m_pComboBox->IsDropListVisible()) { | |
96 m_pComboBox->ShowDropList(false); | |
97 } | |
98 } else { | |
99 m_bLButtonUpSelf = true; | 91 m_bLButtonUpSelf = true; |
| 92 return; |
| 93 } |
| 94 |
| 95 CFX_RectF rect; |
| 96 GetWidgetRect(rect); |
| 97 rect.left = rect.top = 0; |
| 98 if (!rect.Contains(pMsg->m_fx, pMsg->m_fy) && |
| 99 m_pComboBox->IsDropListVisible()) { |
| 100 m_pComboBox->ShowDropList(false); |
100 } | 101 } |
101 } | 102 } |
102 | 103 |
103 void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_MsgKillFocus* pMsg, bool bSet) { | 104 void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_MsgKillFocus* pMsg, bool bSet) { |
104 if (bSet) | 105 if (bSet) |
105 return; | 106 return; |
106 | |
107 if (!pMsg->m_pSetFocus) | 107 if (!pMsg->m_pSetFocus) |
108 m_pComboBox->ShowDropList(false); | 108 m_pComboBox->ShowDropList(false); |
109 } | 109 } |
OLD | NEW |