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/cfwl_comboboxproxy.h" | 7 #include "xfa/fwl/core/cfwl_comboboxproxy.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "xfa/fwl/core/cfwl_app.h" | 12 #include "xfa/fwl/core/cfwl_app.h" |
| 13 #include "xfa/fwl/core/cfwl_combobox.h" |
13 #include "xfa/fwl/core/cfwl_msgkillfocus.h" | 14 #include "xfa/fwl/core/cfwl_msgkillfocus.h" |
14 #include "xfa/fwl/core/cfwl_msgmouse.h" | 15 #include "xfa/fwl/core/cfwl_msgmouse.h" |
15 #include "xfa/fwl/core/cfwl_notedriver.h" | 16 #include "xfa/fwl/core/cfwl_notedriver.h" |
16 #include "xfa/fwl/core/ifwl_combobox.h" | |
17 | 17 |
18 CFWL_ComboBoxProxy::CFWL_ComboBoxProxy( | 18 CFWL_ComboBoxProxy::CFWL_ComboBoxProxy( |
19 IFWL_ComboBox* pComboBox, | 19 CFWL_ComboBox* pComboBox, |
20 const CFWL_App* app, | 20 const CFWL_App* app, |
21 std::unique_ptr<CFWL_WidgetProperties> properties, | 21 std::unique_ptr<CFWL_WidgetProperties> properties, |
22 IFWL_Widget* pOuter) | 22 CFWL_Widget* pOuter) |
23 : CFWL_FormProxy(app, std::move(properties), pOuter), | 23 : CFWL_FormProxy(app, std::move(properties), pOuter), |
24 m_bLButtonDown(false), | 24 m_bLButtonDown(false), |
25 m_bLButtonUpSelf(false), | 25 m_bLButtonUpSelf(false), |
26 m_pComboBox(pComboBox) {} | 26 m_pComboBox(pComboBox) {} |
27 | 27 |
28 CFWL_ComboBoxProxy::~CFWL_ComboBoxProxy() {} | 28 CFWL_ComboBoxProxy::~CFWL_ComboBoxProxy() {} |
29 | 29 |
30 void CFWL_ComboBoxProxy::OnProcessMessage(CFWL_Message* pMessage) { | 30 void CFWL_ComboBoxProxy::OnProcessMessage(CFWL_Message* pMessage) { |
31 if (!pMessage) | 31 if (!pMessage) |
32 return; | 32 return; |
(...skipping 15 matching lines...) Expand all Loading... |
48 } | 48 } |
49 case CFWL_MessageType::KillFocus: | 49 case CFWL_MessageType::KillFocus: |
50 OnFocusChanged(pMessage, false); | 50 OnFocusChanged(pMessage, false); |
51 break; | 51 break; |
52 case CFWL_MessageType::SetFocus: | 52 case CFWL_MessageType::SetFocus: |
53 OnFocusChanged(pMessage, true); | 53 OnFocusChanged(pMessage, true); |
54 break; | 54 break; |
55 default: | 55 default: |
56 break; | 56 break; |
57 } | 57 } |
58 IFWL_Widget::OnProcessMessage(pMessage); | 58 CFWL_Widget::OnProcessMessage(pMessage); |
59 } | 59 } |
60 | 60 |
61 void CFWL_ComboBoxProxy::OnDrawWidget(CFX_Graphics* pGraphics, | 61 void CFWL_ComboBoxProxy::OnDrawWidget(CFX_Graphics* pGraphics, |
62 const CFX_Matrix* pMatrix) { | 62 const CFX_Matrix* pMatrix) { |
63 m_pComboBox->DrawStretchHandler(pGraphics, pMatrix); | 63 m_pComboBox->DrawStretchHandler(pGraphics, pMatrix); |
64 } | 64 } |
65 | 65 |
66 void CFWL_ComboBoxProxy::OnLButtonDown(CFWL_Message* pMessage) { | 66 void CFWL_ComboBoxProxy::OnLButtonDown(CFWL_Message* pMessage) { |
67 const CFWL_App* pApp = GetOwnerApp(); | 67 const CFWL_App* pApp = GetOwnerApp(); |
68 if (!pApp) | 68 if (!pApp) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 void CFWL_ComboBoxProxy::OnFocusChanged(CFWL_Message* pMessage, bool bSet) { | 112 void CFWL_ComboBoxProxy::OnFocusChanged(CFWL_Message* pMessage, bool bSet) { |
113 if (bSet) | 113 if (bSet) |
114 return; | 114 return; |
115 | 115 |
116 CFWL_MsgKillFocus* pMsg = static_cast<CFWL_MsgKillFocus*>(pMessage); | 116 CFWL_MsgKillFocus* pMsg = static_cast<CFWL_MsgKillFocus*>(pMessage); |
117 if (!pMsg->m_pSetFocus) | 117 if (!pMsg->m_pSetFocus) |
118 m_pComboBox->ShowDropList(false); | 118 m_pComboBox->ShowDropList(false); |
119 } | 119 } |
OLD | NEW |