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_combolist.h" | 7 #include "xfa/fwl/core/ifwl_combolist.h" |
8 | 8 |
9 #include "xfa/fwl/core/ifwl_combobox.h" | 9 #include "xfa/fwl/core/ifwl_combobox.h" |
10 #include "xfa/fwl/core/ifwl_comboedit.h" | 10 #include "xfa/fwl/core/ifwl_comboedit.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 dwHashCode == CFWL_MessageType::KillFocus) { | 117 dwHashCode == CFWL_MessageType::KillFocus) { |
118 OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); | 118 OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); |
119 } else if (dwHashCode == CFWL_MessageType::Mouse) { | 119 } else if (dwHashCode == CFWL_MessageType::Mouse) { |
120 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); | 120 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); |
121 if (m_pOwner->IsShowScrollBar(TRUE) && m_pOwner->m_pVertScrollBar) { | 121 if (m_pOwner->IsShowScrollBar(TRUE) && m_pOwner->m_pVertScrollBar) { |
122 CFX_RectF rect; | 122 CFX_RectF rect; |
123 m_pOwner->m_pVertScrollBar->GetWidgetRect(rect); | 123 m_pOwner->m_pVertScrollBar->GetWidgetRect(rect); |
124 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { | 124 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { |
125 pMsg->m_fx -= rect.left; | 125 pMsg->m_fx -= rect.left; |
126 pMsg->m_fy -= rect.top; | 126 pMsg->m_fy -= rect.top; |
127 IFWL_WidgetDelegate* pDelegate = | 127 m_pOwner->m_pVertScrollBar->GetCurrentDelegate()->OnProcessMessage( |
128 m_pOwner->m_pVertScrollBar->SetDelegate(nullptr); | 128 pMsg); |
129 pDelegate->OnProcessMessage(pMsg); | |
130 return; | 129 return; |
131 } | 130 } |
132 } | 131 } |
133 switch (pMsg->m_dwCmd) { | 132 switch (pMsg->m_dwCmd) { |
134 case FWL_MouseCommand::Move: { | 133 case FWL_MouseCommand::Move: { |
135 backDefault = FALSE; | 134 backDefault = FALSE; |
136 OnDropListMouseMove(pMsg); | 135 OnDropListMouseMove(pMsg); |
137 break; | 136 break; |
138 } | 137 } |
139 case FWL_MouseCommand::LeftButtonDown: { | 138 case FWL_MouseCommand::LeftButtonDown: { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 uint32_t dwKeyCode = pKey->m_dwKeyCode; | 238 uint32_t dwKeyCode = pKey->m_dwKeyCode; |
240 switch (dwKeyCode) { | 239 switch (dwKeyCode) { |
241 case FWL_VKEY_Return: | 240 case FWL_VKEY_Return: |
242 case FWL_VKEY_Escape: { | 241 case FWL_VKEY_Escape: { |
243 pOuter->ShowDropList(FALSE); | 242 pOuter->ShowDropList(FALSE); |
244 return 1; | 243 return 1; |
245 } | 244 } |
246 case FWL_VKEY_Up: | 245 case FWL_VKEY_Up: |
247 case FWL_VKEY_Down: { | 246 case FWL_VKEY_Down: { |
248 OnDropListKeyDown(pKey); | 247 OnDropListKeyDown(pKey); |
249 pOuter->SetDelegate(nullptr); | |
250 pOuter->ProcessSelChanged(FALSE); | 248 pOuter->ProcessSelChanged(FALSE); |
251 return 1; | 249 return 1; |
252 } | 250 } |
253 default: { bPropagate = TRUE; } | 251 default: { bPropagate = TRUE; } |
254 } | 252 } |
255 } else if (pKey->m_dwCmd == FWL_KeyCommand::Char) { | 253 } else if (pKey->m_dwCmd == FWL_KeyCommand::Char) { |
256 bPropagate = TRUE; | 254 bPropagate = TRUE; |
257 } | 255 } |
258 if (bPropagate) { | 256 if (bPropagate) { |
259 pKey->m_pDstTarget = m_pOwner->m_pOuter; | 257 pKey->m_pDstTarget = m_pOwner->m_pOuter; |
(...skipping 23 matching lines...) Expand all Loading... |
283 CFX_RectF rtInvalidate; | 281 CFX_RectF rtInvalidate; |
284 rtInvalidate.Set(0, 0, m_pOwner->m_pProperties->m_rtWidget.width, | 282 rtInvalidate.Set(0, 0, m_pOwner->m_pProperties->m_rtWidget.width, |
285 m_pOwner->m_pProperties->m_rtWidget.height); | 283 m_pOwner->m_pProperties->m_rtWidget.height); |
286 m_pOwner->Repaint(&rtInvalidate); | 284 m_pOwner->Repaint(&rtInvalidate); |
287 break; | 285 break; |
288 } | 286 } |
289 default: | 287 default: |
290 break; | 288 break; |
291 } | 289 } |
292 } | 290 } |
OLD | NEW |