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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 void IFWL_ComboEdit::SetSelected() { | 25 void IFWL_ComboEdit::SetSelected() { |
26 FlagFocus(true); | 26 FlagFocus(true); |
27 GetTxtEdtEngine()->MoveCaretPos(MC_End); | 27 GetTxtEdtEngine()->MoveCaretPos(MC_End); |
28 AddSelRange(0); | 28 AddSelRange(0); |
29 } | 29 } |
30 | 30 |
31 void IFWL_ComboEdit::FlagFocus(bool bSet) { | 31 void IFWL_ComboEdit::FlagFocus(bool bSet) { |
32 if (bSet) { | 32 if (bSet) { |
33 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 33 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
34 } else { | 34 return; |
35 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | |
36 ShowCaret(false); | |
37 } | 35 } |
| 36 |
| 37 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
| 38 ShowCaret(false); |
38 } | 39 } |
39 | 40 |
40 void IFWL_ComboEdit::OnProcessMessage(CFWL_Message* pMessage) { | 41 void IFWL_ComboEdit::OnProcessMessage(CFWL_Message* pMessage) { |
41 if (!pMessage) | 42 if (!pMessage) |
42 return; | 43 return; |
43 | 44 |
44 bool backDefault = true; | 45 bool backDefault = true; |
45 switch (pMessage->GetClassID()) { | 46 switch (pMessage->GetClassID()) { |
46 case CFWL_MessageType::SetFocus: { | 47 case CFWL_MessageType::SetFocus: { |
47 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 48 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
(...skipping 13 matching lines...) Expand all Loading... |
61 m_pOuter->SetFocus(true); | 62 m_pOuter->SetFocus(true); |
62 } | 63 } |
63 break; | 64 break; |
64 } | 65 } |
65 default: | 66 default: |
66 break; | 67 break; |
67 } | 68 } |
68 if (backDefault) | 69 if (backDefault) |
69 IFWL_Edit::OnProcessMessage(pMessage); | 70 IFWL_Edit::OnProcessMessage(pMessage); |
70 } | 71 } |
OLD | NEW |