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_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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 CFWL_MessageType dwHashCode = pMessage->GetClassID(); | 80 CFWL_MessageType dwHashCode = pMessage->GetClassID(); |
81 bool backDefault = true; | 81 bool backDefault = true; |
82 if (dwHashCode == CFWL_MessageType::SetFocus || | 82 if (dwHashCode == CFWL_MessageType::SetFocus || |
83 dwHashCode == CFWL_MessageType::KillFocus) { | 83 dwHashCode == CFWL_MessageType::KillFocus) { |
84 OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); | 84 OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus); |
85 } else if (dwHashCode == CFWL_MessageType::Mouse) { | 85 } else if (dwHashCode == CFWL_MessageType::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, false); |
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; |
96 } | 96 } |
97 } | 97 } |
98 switch (pMsg->m_dwCmd) { | 98 switch (pMsg->m_dwCmd) { |
99 case FWL_MouseCommand::Move: { | 99 case FWL_MouseCommand::Move: { |
100 backDefault = false; | 100 backDefault = false; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 void CFWL_ComboList::OnDropListMouseMove(CFWL_MsgMouse* pMsg) { | 136 void CFWL_ComboList::OnDropListMouseMove(CFWL_MsgMouse* pMsg) { |
137 if (GetRTClient().Contains(pMsg->m_fx, pMsg->m_fy)) { | 137 if (GetRTClient().Contains(pMsg->m_fx, pMsg->m_fy)) { |
138 if (m_bNotifyOwner) | 138 if (m_bNotifyOwner) |
139 m_bNotifyOwner = false; | 139 m_bNotifyOwner = false; |
140 | 140 |
141 CFWL_ScrollBar* vertSB = GetVertScrollBar(); | 141 CFWL_ScrollBar* vertSB = GetVertScrollBar(); |
142 if (IsShowScrollBar(true) && vertSB) { | 142 if (IsShowScrollBar(true) && vertSB) { |
143 CFX_RectF rect; | 143 CFX_RectF rect; |
144 vertSB->GetWidgetRect(rect); | 144 vertSB->GetWidgetRect(rect, false); |
145 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) | 145 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) |
146 return; | 146 return; |
147 } | 147 } |
148 | 148 |
149 CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); | 149 CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); |
150 if (!hItem) | 150 if (!hItem) |
151 return; | 151 return; |
152 | 152 |
153 ChangeSelected(GetItemIndex(this, hItem)); | 153 ChangeSelected(GetItemIndex(this, hItem)); |
154 } else if (m_bNotifyOwner) { | 154 } else if (m_bNotifyOwner) { |
(...skipping 15 matching lines...) Expand all Loading... |
170 CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); | 170 CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); |
171 if (m_bNotifyOwner) { | 171 if (m_bNotifyOwner) { |
172 ClientToOuter(pMsg->m_fx, pMsg->m_fy); | 172 ClientToOuter(pMsg->m_fx, pMsg->m_fy); |
173 pOuter->GetDelegate()->OnProcessMessage(pMsg); | 173 pOuter->GetDelegate()->OnProcessMessage(pMsg); |
174 return; | 174 return; |
175 } | 175 } |
176 | 176 |
177 CFWL_ScrollBar* vertSB = GetVertScrollBar(); | 177 CFWL_ScrollBar* vertSB = GetVertScrollBar(); |
178 if (IsShowScrollBar(true) && vertSB) { | 178 if (IsShowScrollBar(true) && vertSB) { |
179 CFX_RectF rect; | 179 CFX_RectF rect; |
180 vertSB->GetWidgetRect(rect); | 180 vertSB->GetWidgetRect(rect, false); |
181 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) | 181 if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) |
182 return; | 182 return; |
183 } | 183 } |
184 pOuter->ShowDropList(false); | 184 pOuter->ShowDropList(false); |
185 | 185 |
186 CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); | 186 CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); |
187 if (hItem) | 187 if (hItem) |
188 pOuter->ProcessSelChanged(true); | 188 pOuter->ProcessSelChanged(true); |
189 } | 189 } |
190 | 190 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |