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_comboboximp.h" | 7 #include "xfa/fwl/basewidget/fwl_comboboximp.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fee/fde_txtedtengine.h" | 10 #include "xfa/fee/fde_txtedtengine.h" |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 586 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
587 } | 587 } |
588 Layout(); | 588 Layout(); |
589 CFWL_ThemePart part; | 589 CFWL_ThemePart part; |
590 part.m_pWidget = m_pInterface; | 590 part.m_pWidget = m_pInterface; |
591 m_fComboFormHandler = | 591 m_fComboFormHandler = |
592 *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity( | 592 *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity( |
593 &part, CFWL_WidgetCapacity::ComboFormHandler)); | 593 &part, CFWL_WidgetCapacity::ComboFormHandler)); |
594 return FWL_ERR_Succeeded; | 594 return FWL_ERR_Succeeded; |
595 } | 595 } |
596 uint32_t CFWL_ComboBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 596 FWL_WidgetHit CFWL_ComboBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
597 if (m_pWidgetMgr->IsFormDisabled()) { | 597 if (m_pWidgetMgr->IsFormDisabled()) { |
598 return DisForm_HitTest(fx, fy); | 598 return DisForm_HitTest(fx, fy); |
599 } | 599 } |
600 return CFWL_WidgetImp::HitTest(fx, fy); | 600 return CFWL_WidgetImp::HitTest(fx, fy); |
601 } | 601 } |
602 FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics, | 602 FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics, |
603 const CFX_Matrix* pMatrix) { | 603 const CFX_Matrix* pMatrix) { |
604 if (m_pWidgetMgr->IsFormDisabled()) { | 604 if (m_pWidgetMgr->IsFormDisabled()) { |
605 return DisForm_DrawWidget(pGraphics, pMatrix); | 605 return DisForm_DrawWidget(pGraphics, pMatrix); |
606 } | 606 } |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 if (m_iLock) { | 1247 if (m_iLock) { |
1248 return FWL_ERR_Indefinite; | 1248 return FWL_ERR_Indefinite; |
1249 } | 1249 } |
1250 if (m_pEdit) { | 1250 if (m_pEdit) { |
1251 ReSetEditAlignment(); | 1251 ReSetEditAlignment(); |
1252 } | 1252 } |
1253 ReSetTheme(); | 1253 ReSetTheme(); |
1254 Layout(); | 1254 Layout(); |
1255 return FWL_ERR_Succeeded; | 1255 return FWL_ERR_Succeeded; |
1256 } | 1256 } |
1257 uint32_t CFWL_ComboBoxImp::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 1257 FWL_WidgetHit CFWL_ComboBoxImp::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
1258 CFX_RectF rect; | 1258 CFX_RectF rect; |
1259 rect.Set(0, 0, m_pProperties->m_rtWidget.width - m_rtBtn.width, | 1259 rect.Set(0, 0, m_pProperties->m_rtWidget.width - m_rtBtn.width, |
1260 m_pProperties->m_rtWidget.height); | 1260 m_pProperties->m_rtWidget.height); |
1261 if (rect.Contains(fx, fy)) { | 1261 if (rect.Contains(fx, fy)) |
1262 return FWL_WGTHITTEST_Edit; | 1262 return FWL_WidgetHit::Edit; |
1263 } | 1263 if (m_rtBtn.Contains(fx, fy)) |
1264 if (m_rtBtn.Contains(fx, fy)) { | 1264 return FWL_WidgetHit::Client; |
1265 return FWL_WGTHITTEST_Client; | |
1266 } | |
1267 if (DisForm_IsDropListShowed()) { | 1265 if (DisForm_IsDropListShowed()) { |
1268 m_pListBox->GetWidgetRect(rect); | 1266 m_pListBox->GetWidgetRect(rect); |
1269 if (rect.Contains(fx, fy)) { | 1267 if (rect.Contains(fx, fy)) |
1270 return FWL_WGTHITTEST_Client; | 1268 return FWL_WidgetHit::Client; |
1271 } | |
1272 } | 1269 } |
1273 return FWL_WGTHITTEST_Unknown; | 1270 return FWL_WidgetHit::Unknown; |
1274 } | 1271 } |
1275 FWL_ERR CFWL_ComboBoxImp::DisForm_DrawWidget(CFX_Graphics* pGraphics, | 1272 FWL_ERR CFWL_ComboBoxImp::DisForm_DrawWidget(CFX_Graphics* pGraphics, |
1276 const CFX_Matrix* pMatrix) { | 1273 const CFX_Matrix* pMatrix) { |
1277 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; | 1274 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; |
1278 CFX_Matrix mtOrg; | 1275 CFX_Matrix mtOrg; |
1279 mtOrg.Set(1, 0, 0, 1, 0, 0); | 1276 mtOrg.Set(1, 0, 0, 1, 0, 0); |
1280 if (pMatrix) { | 1277 if (pMatrix) { |
1281 mtOrg = *pMatrix; | 1278 mtOrg = *pMatrix; |
1282 } | 1279 } |
1283 FX_BOOL bListShowed = m_pListBox && DisForm_IsDropListShowed(); | 1280 FX_BOOL bListShowed = m_pListBox && DisForm_IsDropListShowed(); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1846 m_pComboBox->ShowDropList(FALSE); | 1843 m_pComboBox->ShowDropList(FALSE); |
1847 } | 1844 } |
1848 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, | 1845 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, |
1849 FX_BOOL bSet) { | 1846 FX_BOOL bSet) { |
1850 if (!bSet) { | 1847 if (!bSet) { |
1851 if (pMsg->m_pSetFocus == NULL) { | 1848 if (pMsg->m_pSetFocus == NULL) { |
1852 m_pComboBox->ShowDropList(FALSE); | 1849 m_pComboBox->ShowDropList(FALSE); |
1853 } | 1850 } |
1854 } | 1851 } |
1855 } | 1852 } |
OLD | NEW |