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 "fpdfsdk/include/fxedit/fxet_edit.h" | 7 #include "fpdfsdk/include/fxedit/fxet_edit.h" |
8 #include "fpdfsdk/include/fxedit/fxet_list.h" | 8 #include "fpdfsdk/include/fxedit/fxet_list.h" |
9 #include "fpdfsdk/include/fxedit/fxet_stub.h" | 9 #include "fpdfsdk/include/fxedit/fxet_stub.h" |
10 | 10 |
11 /* ------------------------------- CFX_ListItem | 11 /* ------------------------------- CFX_ListItem |
12 * ---------------------------------- */ | 12 * ---------------------------------- */ |
13 | 13 |
14 CFX_ListItem::CFX_ListItem() | 14 CFX_ListItem::CFX_ListItem() |
15 : m_pEdit(NULL), | 15 : m_pEdit(NULL), |
16 m_bSelected(FALSE), | 16 m_bSelected(FALSE), |
17 m_bCaret(FALSE), | 17 m_bCaret(FALSE), |
18 m_rcListItem(0.0f, 0.0f, 0.0f, 0.0f) { | 18 m_rcListItem(0.0f, 0.0f, 0.0f, 0.0f) { |
19 m_pEdit = IFX_Edit::NewEdit(); | 19 m_pEdit = IFX_Edit::NewEdit(); |
20 ASSERT(m_pEdit != NULL); | |
21 | |
22 m_pEdit->SetAlignmentV(1); | 20 m_pEdit->SetAlignmentV(1); |
23 m_pEdit->Initialize(); | 21 m_pEdit->Initialize(); |
24 } | 22 } |
25 | 23 |
26 CFX_ListItem::~CFX_ListItem() { | 24 CFX_ListItem::~CFX_ListItem() { |
27 IFX_Edit::DelEdit(m_pEdit); | 25 IFX_Edit::DelEdit(m_pEdit); |
28 } | 26 } |
29 | 27 |
30 void CFX_ListItem::SetFontMap(IFX_Edit_FontMap* pFontMap) { | 28 void CFX_ListItem::SetFontMap(IFX_Edit_FontMap* pFontMap) { |
31 if (m_pEdit) | 29 if (m_pEdit) |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 824 |
827 int32_t CFX_ListCtrl::GetItemIndex(const CPDF_Point& point) const { | 825 int32_t CFX_ListCtrl::GetItemIndex(const CPDF_Point& point) const { |
828 return CFX_List::GetItemIndex(OutToIn(point)); | 826 return CFX_List::GetItemIndex(OutToIn(point)); |
829 } | 827 } |
830 | 828 |
831 CFX_WideString CFX_ListCtrl::GetText() const { | 829 CFX_WideString CFX_ListCtrl::GetText() const { |
832 if (IsMultipleSel()) | 830 if (IsMultipleSel()) |
833 return GetItemText(m_nCaretIndex); | 831 return GetItemText(m_nCaretIndex); |
834 return GetItemText(m_nSelItem); | 832 return GetItemText(m_nSelItem); |
835 } | 833 } |
OLD | NEW |