OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_comboedit.h" | 7 #include "xfa/fwl/core/ifwl_comboedit.h" |
8 | 8 |
9 #include "xfa/fde/cfde_txtedtengine.h" | 9 #include "xfa/fde/cfde_txtedtengine.h" |
10 #include "xfa/fwl/core/ifwl_combobox.h" | 10 #include "xfa/fwl/core/ifwl_combobox.h" |
11 | 11 |
12 IFWL_ComboEdit::IFWL_ComboEdit( | 12 IFWL_ComboEdit::IFWL_ComboEdit( |
13 const IFWL_App* app, | 13 const IFWL_App* app, |
14 std::unique_ptr<CFWL_WidgetProperties> properties, | 14 std::unique_ptr<CFWL_WidgetProperties> properties, |
15 IFWL_Widget* pOuter) | 15 IFWL_Widget* pOuter) |
16 : IFWL_Edit(app, std::move(properties), pOuter) { | 16 : IFWL_Edit(app, std::move(properties), pOuter) { |
17 m_pOuter = static_cast<IFWL_ComboBox*>(pOuter); | 17 m_pOuter = static_cast<IFWL_ComboBox*>(pOuter); |
18 } | 18 } |
19 | 19 |
20 void IFWL_ComboEdit::ClearSelected() { | 20 void IFWL_ComboEdit::ClearSelected() { |
21 ClearSelections(); | 21 ClearSelections(); |
22 Repaint(&m_rtClient); | 22 Repaint(&GetRTClient()); |
23 } | 23 } |
24 | 24 |
25 void IFWL_ComboEdit::SetSelected() { | 25 void IFWL_ComboEdit::SetSelected() { |
26 FlagFocus(true); | 26 FlagFocus(true); |
27 EndCaret(); | 27 EndCaret(); |
28 AddSelRange(0); | 28 AddSelRange(0); |
29 } | 29 } |
30 | 30 |
31 void IFWL_ComboEdit::EndCaret() { | 31 void IFWL_ComboEdit::EndCaret() { |
32 m_pEdtEngine->MoveCaretPos(MC_End); | 32 GetTxtEdtEngine()->MoveCaretPos(MC_End); |
33 } | 33 } |
34 | 34 |
35 void IFWL_ComboEdit::FlagFocus(bool bSet) { | 35 void IFWL_ComboEdit::FlagFocus(bool bSet) { |
36 if (bSet) { | 36 if (bSet) { |
37 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 37 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
38 } else { | 38 } else { |
39 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 39 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
40 ShowCaret(false); | 40 ShowCaret(false); |
41 } | 41 } |
42 } | 42 } |
(...skipping 26 matching lines...) Expand all Loading... |
69 SetComboBoxFocus(true); | 69 SetComboBoxFocus(true); |
70 } | 70 } |
71 break; | 71 break; |
72 } | 72 } |
73 default: | 73 default: |
74 break; | 74 break; |
75 } | 75 } |
76 if (backDefault) | 76 if (backDefault) |
77 IFWL_Edit::OnProcessMessage(pMessage); | 77 IFWL_Edit::OnProcessMessage(pMessage); |
78 } | 78 } |
OLD | NEW |