Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: xfa/fwl/core/cfwl_comboboxproxy.cpp

Issue 2530993002: Cleanup FWL Event and Message code. (Closed)
Patch Set: Review feedback Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
(...skipping 13 matching lines...) Expand all
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;
33 33
34 switch (pMessage->GetClassID()) { 34 switch (pMessage->GetType()) {
35 case CFWL_MessageType::Mouse: { 35 case CFWL_Message::Type::Mouse: {
36 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); 36 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
37 switch (pMsg->m_dwCmd) { 37 switch (pMsg->m_dwCmd) {
38 case FWL_MouseCommand::LeftButtonDown: 38 case FWL_MouseCommand::LeftButtonDown:
39 OnLButtonDown(pMsg); 39 OnLButtonDown(pMsg);
40 break; 40 break;
41 case FWL_MouseCommand::LeftButtonUp: 41 case FWL_MouseCommand::LeftButtonUp:
42 OnLButtonUp(pMsg); 42 OnLButtonUp(pMsg);
43 break; 43 break;
44 default: 44 default:
45 break; 45 break;
46 } 46 }
47 break; 47 break;
48 } 48 }
49 case CFWL_MessageType::KillFocus: 49 case CFWL_Message::Type::KillFocus:
50 OnFocusChanged(pMessage, false); 50 OnFocusChanged(pMessage, false);
51 break; 51 break;
52 case CFWL_MessageType::SetFocus: 52 case CFWL_Message::Type::SetFocus:
53 OnFocusChanged(pMessage, true); 53 OnFocusChanged(pMessage, true);
54 break; 54 break;
55 default: 55 default:
56 break; 56 break;
57 } 57 }
58 CFWL_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) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698