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_combobox.h" | 7 #include "xfa/fwl/core/ifwl_combobox.h" |
8 | 8 |
9 #include "third_party/base/ptr_util.h" | 9 #include "third_party/base/ptr_util.h" |
10 #include "xfa/fde/cfde_txtedtengine.h" | 10 #include "xfa/fde/cfde_txtedtengine.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 break; | 840 break; |
841 default: | 841 default: |
842 break; | 842 break; |
843 } | 843 } |
844 | 844 |
845 IFWL_Widget::OnProcessMessage(pMessage); | 845 IFWL_Widget::OnProcessMessage(pMessage); |
846 } | 846 } |
847 | 847 |
848 void IFWL_ComboBox::OnProcessEvent(CFWL_Event* pEvent) { | 848 void IFWL_ComboBox::OnProcessEvent(CFWL_Event* pEvent) { |
849 CFWL_EventType dwFlag = pEvent->GetClassID(); | 849 CFWL_EventType dwFlag = pEvent->GetClassID(); |
850 if (dwFlag == CFWL_EventType::DrawItem) { | 850 if (dwFlag == CFWL_EventType::Scroll) { |
851 CFWL_EvtLtbDrawItem* pDrawItemEvent = | |
852 static_cast<CFWL_EvtLtbDrawItem*>(pEvent); | |
853 CFWL_EvtCmbDrawItem pTemp; | |
854 pTemp.m_pSrcTarget = this; | |
855 pTemp.m_pGraphics = pDrawItemEvent->m_pGraphics; | |
856 pTemp.m_index = pDrawItemEvent->m_index; | |
857 pTemp.m_rtItem = pDrawItemEvent->m_rect; | |
858 DispatchEvent(&pTemp); | |
859 } else if (dwFlag == CFWL_EventType::Scroll) { | |
860 CFWL_EvtScroll* pScrollEvent = static_cast<CFWL_EvtScroll*>(pEvent); | 851 CFWL_EvtScroll* pScrollEvent = static_cast<CFWL_EvtScroll*>(pEvent); |
861 CFWL_EvtScroll pScrollEv; | 852 CFWL_EvtScroll pScrollEv; |
862 pScrollEv.m_pSrcTarget = this; | 853 pScrollEv.m_pSrcTarget = this; |
863 pScrollEv.m_iScrollCode = pScrollEvent->m_iScrollCode; | 854 pScrollEv.m_iScrollCode = pScrollEvent->m_iScrollCode; |
864 pScrollEv.m_fPos = pScrollEvent->m_fPos; | 855 pScrollEv.m_fPos = pScrollEvent->m_fPos; |
865 DispatchEvent(&pScrollEv); | 856 DispatchEvent(&pScrollEv); |
866 } else if (dwFlag == CFWL_EventType::TextChanged) { | 857 } else if (dwFlag == CFWL_EventType::TextChanged) { |
867 CFWL_EvtTextChanged* pTextChangedEvent = | 858 CFWL_EvtTextChanged* pTextChangedEvent = |
868 static_cast<CFWL_EvtTextChanged*>(pEvent); | 859 static_cast<CFWL_EvtTextChanged*>(pEvent); |
869 CFWL_EvtCmbEditChanged pTemp; | 860 CFWL_EvtCmbEditChanged pTemp; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 else | 1132 else |
1142 iCurSel++; | 1133 iCurSel++; |
1143 } | 1134 } |
1144 m_iCurSel = iCurSel; | 1135 m_iCurSel = iCurSel; |
1145 SyncEditText(m_iCurSel); | 1136 SyncEditText(m_iCurSel); |
1146 return; | 1137 return; |
1147 } | 1138 } |
1148 if (m_pEdit) | 1139 if (m_pEdit) |
1149 m_pEdit->GetDelegate()->OnProcessMessage(pMsg); | 1140 m_pEdit->GetDelegate()->OnProcessMessage(pMsg); |
1150 } | 1141 } |
OLD | NEW |