| 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/fwl/basewidget/fwl_editimp.h" | 10 #include "xfa/fwl/basewidget/fwl_editimp.h" |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, iSel); | 714 FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, iSel); |
| 715 static_cast<CFWL_ComboListImp*>(m_pListBox->GetImpl()) | 715 static_cast<CFWL_ComboListImp*>(m_pListBox->GetImpl()) |
| 716 ->GetItemText(hItem, wsText); | 716 ->GetItemText(hItem, wsText); |
| 717 m_pEdit->SetText(wsText); | 717 m_pEdit->SetText(wsText); |
| 718 } | 718 } |
| 719 m_pEdit->Update(); | 719 m_pEdit->Update(); |
| 720 } | 720 } |
| 721 m_iCurSel = bClearSel ? -1 : iSel; | 721 m_iCurSel = bClearSel ? -1 : iSel; |
| 722 return FWL_ERR_Succeeded; | 722 return FWL_ERR_Succeeded; |
| 723 } | 723 } |
| 724 FWL_ERR CFWL_ComboBoxImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { | 724 |
| 725 void CFWL_ComboBoxImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
| 725 FX_BOOL bIsDropDown = IsDropDownStyle(); | 726 FX_BOOL bIsDropDown = IsDropDownStyle(); |
| 726 if (bIsDropDown && m_pEdit) { | 727 if (bIsDropDown && m_pEdit) |
| 727 m_pEdit->SetStates(dwStates, bSet); | 728 m_pEdit->SetStates(dwStates, bSet); |
| 728 } | 729 if (m_pListBox) |
| 729 if (m_pListBox) { | |
| 730 m_pListBox->SetStates(dwStates, bSet); | 730 m_pListBox->SetStates(dwStates, bSet); |
| 731 } | 731 CFWL_WidgetImp::SetStates(dwStates, bSet); |
| 732 return CFWL_WidgetImp::SetStates(dwStates, bSet); | |
| 733 } | 732 } |
| 733 |
| 734 FWL_ERR CFWL_ComboBoxImp::SetEditText(const CFX_WideString& wsText) { | 734 FWL_ERR CFWL_ComboBoxImp::SetEditText(const CFX_WideString& wsText) { |
| 735 if (!m_pEdit) | 735 if (!m_pEdit) |
| 736 return FWL_ERR_Indefinite; | 736 return FWL_ERR_Indefinite; |
| 737 m_pEdit->SetText(wsText); | 737 m_pEdit->SetText(wsText); |
| 738 return m_pEdit->Update(); | 738 return m_pEdit->Update(); |
| 739 } | 739 } |
| 740 int32_t CFWL_ComboBoxImp::GetEditTextLength() const { | 740 int32_t CFWL_ComboBoxImp::GetEditTextLength() const { |
| 741 if (!m_pEdit) | 741 if (!m_pEdit) |
| 742 return -1; | 742 return -1; |
| 743 return m_pEdit->GetTextLength(); | 743 return m_pEdit->GetTextLength(); |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1845 m_pComboBox->ShowDropList(FALSE); | 1845 m_pComboBox->ShowDropList(FALSE); |
| 1846 } | 1846 } |
| 1847 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, | 1847 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, |
| 1848 FX_BOOL bSet) { | 1848 FX_BOOL bSet) { |
| 1849 if (!bSet) { | 1849 if (!bSet) { |
| 1850 if (pMsg->m_pSetFocus == NULL) { | 1850 if (pMsg->m_pSetFocus == NULL) { |
| 1851 m_pComboBox->ShowDropList(FALSE); | 1851 m_pComboBox->ShowDropList(FALSE); |
| 1852 } | 1852 } |
| 1853 } | 1853 } |
| 1854 } | 1854 } |
| OLD | NEW |