OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_listbox.h" | 7 #include "xfa/fwl/core/ifwl_listbox.h" |
8 | 8 |
9 #include "third_party/base/ptr_util.h" | 9 #include "third_party/base/ptr_util.h" |
10 #include "xfa/fde/tto/fde_textout.h" | 10 #include "xfa/fde/tto/fde_textout.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void IFWL_ListBox::GetItemText(CFWL_ListItem* pItem, CFX_WideString& wsText) { | 228 void IFWL_ListBox::GetItemText(CFWL_ListItem* pItem, CFX_WideString& wsText) { |
229 if (!m_pProperties->m_pDataProvider) | 229 if (!m_pProperties->m_pDataProvider) |
230 return; | 230 return; |
231 IFWL_ListBoxDP* pData = | 231 IFWL_ListBoxDP* pData = |
232 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); | 232 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); |
233 if (!pItem) | 233 if (!pItem) |
234 return; | 234 return; |
235 pData->GetItemText(this, pItem, wsText); | 235 pData->GetItemText(this, pItem, wsText); |
236 } | 236 } |
237 | 237 |
238 void IFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, bool bVert) { | |
239 if ((bVert && IsShowScrollBar(true)) || (!bVert && IsShowScrollBar(false))) { | |
240 IFWL_ScrollBar* pScrollBar = | |
241 bVert ? m_pVertScrollBar.get() : m_pHorzScrollBar.get(); | |
242 fPos = pScrollBar->GetPos(); | |
243 } | |
244 } | |
245 | |
246 CFWL_ListItem* IFWL_ListBox::GetItem(CFWL_ListItem* pItem, uint32_t dwKeyCode) { | 238 CFWL_ListItem* IFWL_ListBox::GetItem(CFWL_ListItem* pItem, uint32_t dwKeyCode) { |
247 CFWL_ListItem* hRet = nullptr; | 239 CFWL_ListItem* hRet = nullptr; |
248 switch (dwKeyCode) { | 240 switch (dwKeyCode) { |
249 case FWL_VKEY_Up: | 241 case FWL_VKEY_Up: |
250 case FWL_VKEY_Down: | 242 case FWL_VKEY_Down: |
251 case FWL_VKEY_Home: | 243 case FWL_VKEY_Home: |
252 case FWL_VKEY_End: { | 244 case FWL_VKEY_End: { |
253 const bool bUp = dwKeyCode == FWL_VKEY_Up; | 245 const bool bUp = dwKeyCode == FWL_VKEY_Up; |
254 const bool bDown = dwKeyCode == FWL_VKEY_Down; | 246 const bool bDown = dwKeyCode == FWL_VKEY_Down; |
255 const bool bHome = dwKeyCode == FWL_VKEY_Home; | 247 const bool bHome = dwKeyCode == FWL_VKEY_Home; |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 Repaint(&m_rtClient); | 1131 Repaint(&m_rtClient); |
1140 } | 1132 } |
1141 return true; | 1133 return true; |
1142 } | 1134 } |
1143 | 1135 |
1144 void IFWL_ListBox::DispatchSelChangedEv() { | 1136 void IFWL_ListBox::DispatchSelChangedEv() { |
1145 CFWL_EvtLtbSelChanged ev; | 1137 CFWL_EvtLtbSelChanged ev; |
1146 ev.m_pSrcTarget = this; | 1138 ev.m_pSrcTarget = this; |
1147 DispatchEvent(&ev); | 1139 DispatchEvent(&ev); |
1148 } | 1140 } |
OLD | NEW |