| 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/cfwl_comboedit.h" | 7 #include "xfa/fwl/cfwl_comboedit.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "xfa/fde/cfde_txtedtengine.h" | 12 #include "xfa/fde/cfde_txtedtengine.h" |
| 13 #include "xfa/fwl/cfwl_combobox.h" | 13 #include "xfa/fwl/cfwl_combobox.h" |
| 14 #include "xfa/fwl/cfwl_messagemouse.h" | 14 #include "xfa/fwl/cfwl_messagemouse.h" |
| 15 | 15 |
| 16 CFWL_ComboEdit::CFWL_ComboEdit( | 16 CFWL_ComboEdit::CFWL_ComboEdit( |
| 17 const CFWL_App* app, | 17 const CFWL_App* app, |
| 18 std::unique_ptr<CFWL_WidgetProperties> properties, | 18 std::unique_ptr<CFWL_WidgetProperties> properties, |
| 19 CFWL_Widget* pOuter) | 19 CFWL_Widget* pOuter) |
| 20 : CFWL_Edit(app, std::move(properties), pOuter) { | 20 : CFWL_Edit(app, std::move(properties), pOuter) { |
| 21 m_pOuter = static_cast<CFWL_ComboBox*>(pOuter); | 21 m_pOuter = static_cast<CFWL_ComboBox*>(pOuter); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void CFWL_ComboEdit::ClearSelected() { | 24 void CFWL_ComboEdit::ClearSelected() { |
| 25 ClearSelections(); | 25 ClearSelections(); |
| 26 Repaint(&GetRTClient()); | 26 RepaintRect(GetRTClient()); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void CFWL_ComboEdit::SetSelected() { | 29 void CFWL_ComboEdit::SetSelected() { |
| 30 FlagFocus(true); | 30 FlagFocus(true); |
| 31 GetTxtEdtEngine()->MoveCaretPos(MC_End); | 31 GetTxtEdtEngine()->MoveCaretPos(MC_End); |
| 32 AddSelRange(0); | 32 AddSelRange(0); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void CFWL_ComboEdit::FlagFocus(bool bSet) { | 35 void CFWL_ComboEdit::FlagFocus(bool bSet) { |
| 36 if (bSet) { | 36 if (bSet) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 66 m_pOuter->SetFocus(true); | 66 m_pOuter->SetFocus(true); |
| 67 } | 67 } |
| 68 break; | 68 break; |
| 69 } | 69 } |
| 70 default: | 70 default: |
| 71 break; | 71 break; |
| 72 } | 72 } |
| 73 if (backDefault) | 73 if (backDefault) |
| 74 CFWL_Edit::OnProcessMessage(pMessage); | 74 CFWL_Edit::OnProcessMessage(pMessage); |
| 75 } | 75 } |
| OLD | NEW |