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