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

Side by Side Diff: xfa/fwl/core/cfwl_combolist.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_combolist.h" 7 #include "xfa/fwl/core/cfwl_combolist.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 CFWL_Widget* pOwner = GetOwner(); 70 CFWL_Widget* pOwner = GetOwner();
71 if (!pOwner) 71 if (!pOwner)
72 return; 72 return;
73 pOwner->TransformTo(m_pOuter, fx, fy); 73 pOwner->TransformTo(m_pOuter, fx, fy);
74 } 74 }
75 75
76 void CFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) { 76 void CFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) {
77 if (!pMessage) 77 if (!pMessage)
78 return; 78 return;
79 79
80 CFWL_MessageType dwHashCode = pMessage->GetClassID(); 80 CFWL_Message::Type type = pMessage->GetType();
81 bool backDefault = true; 81 bool backDefault = true;
82 if (dwHashCode == CFWL_MessageType::SetFocus || 82 if (type == CFWL_Message::Type::SetFocus ||
83 dwHashCode == CFWL_MessageType::KillFocus) { 83 type == CFWL_Message::Type::KillFocus) {
84 OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); 84 OnDropListFocusChanged(pMessage, type == CFWL_Message::Type::SetFocus);
85 } else if (dwHashCode == CFWL_MessageType::Mouse) { 85 } else if (type == CFWL_Message::Type::Mouse) {
86 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); 86 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
87 CFWL_ScrollBar* vertSB = GetVertScrollBar(); 87 CFWL_ScrollBar* vertSB = GetVertScrollBar();
88 if (IsShowScrollBar(true) && vertSB) { 88 if (IsShowScrollBar(true) && vertSB) {
89 CFX_RectF rect; 89 CFX_RectF rect;
90 vertSB->GetWidgetRect(rect); 90 vertSB->GetWidgetRect(rect);
91 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { 91 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) {
92 pMsg->m_fx -= rect.left; 92 pMsg->m_fx -= rect.left;
93 pMsg->m_fy -= rect.top; 93 pMsg->m_fy -= rect.top;
94 vertSB->GetDelegate()->OnProcessMessage(pMsg); 94 vertSB->GetDelegate()->OnProcessMessage(pMsg);
95 return; 95 return;
(...skipping 11 matching lines...) Expand all
107 break; 107 break;
108 } 108 }
109 case FWL_MouseCommand::LeftButtonUp: { 109 case FWL_MouseCommand::LeftButtonUp: {
110 backDefault = false; 110 backDefault = false;
111 OnDropListLButtonUp(pMsg); 111 OnDropListLButtonUp(pMsg);
112 break; 112 break;
113 } 113 }
114 default: 114 default:
115 break; 115 break;
116 } 116 }
117 } else if (dwHashCode == CFWL_MessageType::Key) { 117 } else if (type == CFWL_Message::Type::Key) {
118 backDefault = !OnDropListKey(static_cast<CFWL_MsgKey*>(pMessage)); 118 backDefault = !OnDropListKey(static_cast<CFWL_MsgKey*>(pMessage));
119 } 119 }
120 if (backDefault) 120 if (backDefault)
121 CFWL_ListBox::OnProcessMessage(pMessage); 121 CFWL_ListBox::OnProcessMessage(pMessage);
122 } 122 }
123 123
124 void CFWL_ComboList::OnDropListFocusChanged(CFWL_Message* pMsg, bool bSet) { 124 void CFWL_ComboList::OnDropListFocusChanged(CFWL_Message* pMsg, bool bSet) {
125 if (bSet) 125 if (bSet)
126 return; 126 return;
127 127
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 CFX_RectF rtInvalidate; 239 CFX_RectF rtInvalidate;
240 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, 240 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width,
241 m_pProperties->m_rtWidget.height); 241 m_pProperties->m_rtWidget.height);
242 Repaint(&rtInvalidate); 242 Repaint(&rtInvalidate);
243 break; 243 break;
244 } 244 }
245 default: 245 default:
246 break; 246 break;
247 } 247 }
248 } 248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698