| 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/basewidget/fwl_listboximp.h" | 7 #include "xfa/fwl/basewidget/fwl_listboximp.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/basewidget/fwl_comboboximp.h" | 10 #include "xfa/fwl/basewidget/fwl_comboboximp.h" |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 if (bShowVertScr && bShowHorzScr) { | 872 if (bShowVertScr && bShowHorzScr) { |
| 873 m_rtStatic.Set(m_rtClient.right() - m_fScorllBarWidth, | 873 m_rtStatic.Set(m_rtClient.right() - m_fScorllBarWidth, |
| 874 m_rtClient.bottom() - m_fScorllBarWidth, m_fScorllBarWidth, | 874 m_rtClient.bottom() - m_fScorllBarWidth, m_fScorllBarWidth, |
| 875 m_fScorllBarWidth); | 875 m_fScorllBarWidth); |
| 876 } | 876 } |
| 877 return fs; | 877 return fs; |
| 878 } | 878 } |
| 879 void CFWL_ListBoxImp::GetItemSize(CFX_SizeF& size, | 879 void CFWL_ListBoxImp::GetItemSize(CFX_SizeF& size, |
| 880 IFWL_ListItem* pItem, | 880 IFWL_ListItem* pItem, |
| 881 FX_FLOAT fWidth, | 881 FX_FLOAT fWidth, |
| 882 FX_FLOAT m_fItemHeight, | 882 FX_FLOAT fItemHeight, |
| 883 FX_BOOL bAutoSize) { | 883 FX_BOOL bAutoSize) { |
| 884 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiColumn) { | 884 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiColumn) { |
| 885 } else { | 885 } else { |
| 886 if (!bAutoSize) { | 886 if (!bAutoSize) { |
| 887 CFX_RectF rtItem; | 887 CFX_RectF rtItem; |
| 888 rtItem.Set(0, size.y, fWidth, m_fItemHeight); | 888 rtItem.Set(0, size.y, fWidth, fItemHeight); |
| 889 IFWL_ListBoxDP* pData = | 889 IFWL_ListBoxDP* pData = |
| 890 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); | 890 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); |
| 891 pData->SetItemRect(m_pInterface, pItem, rtItem); | 891 pData->SetItemRect(m_pInterface, pItem, rtItem); |
| 892 } | 892 } |
| 893 size.x = fWidth; | 893 size.x = fWidth; |
| 894 size.y += m_fItemHeight; | 894 size.y += fItemHeight; |
| 895 } | 895 } |
| 896 } | 896 } |
| 897 FX_FLOAT CFWL_ListBoxImp::GetMaxTextWidth() { | 897 FX_FLOAT CFWL_ListBoxImp::GetMaxTextWidth() { |
| 898 FX_FLOAT fRet = 0.0f; | 898 FX_FLOAT fRet = 0.0f; |
| 899 IFWL_ListBoxDP* pData = | 899 IFWL_ListBoxDP* pData = |
| 900 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); | 900 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); |
| 901 int32_t iCount = pData->CountItems(m_pInterface); | 901 int32_t iCount = pData->CountItems(m_pInterface); |
| 902 for (int32_t i = 0; i < iCount; i++) { | 902 for (int32_t i = 0; i < iCount; i++) { |
| 903 IFWL_ListItem* pItem = pData->GetItem(m_pInterface, i); | 903 IFWL_ListItem* pItem = pData->GetItem(m_pInterface, i); |
| 904 if (!pItem) { | 904 if (!pItem) { |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 pScrollBar->SetTrackPos(fPos); | 1226 pScrollBar->SetTrackPos(fPos); |
| 1227 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 1227 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
| 1228 } | 1228 } |
| 1229 return TRUE; | 1229 return TRUE; |
| 1230 } | 1230 } |
| 1231 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { | 1231 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { |
| 1232 CFWL_EvtLtbSelChanged ev; | 1232 CFWL_EvtLtbSelChanged ev; |
| 1233 ev.m_pSrcTarget = m_pOwner->m_pInterface; | 1233 ev.m_pSrcTarget = m_pOwner->m_pInterface; |
| 1234 m_pOwner->DispatchEvent(&ev); | 1234 m_pOwner->DispatchEvent(&ev); |
| 1235 } | 1235 } |
| OLD | NEW |