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_list.h" | 7 #include "fpdfsdk/include/fxedit/fxet_list.h" |
8 | 8 |
9 #include "fpdfsdk/include/fxedit/fxet_edit.h" | 9 #include "fpdfsdk/include/fxedit/fxet_edit.h" |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 m_pEdit->SetFontSize(fFontSize); | 72 m_pEdit->SetFontSize(fFontSize); |
73 } | 73 } |
74 | 74 |
75 FX_FLOAT CFX_ListItem::GetItemHeight() const { | 75 FX_FLOAT CFX_ListItem::GetItemHeight() const { |
76 if (m_pEdit) | 76 if (m_pEdit) |
77 return m_pEdit->GetContentRect().Height(); | 77 return m_pEdit->GetContentRect().Height(); |
78 | 78 |
79 return 0.0f; | 79 return 0.0f; |
80 } | 80 } |
81 | 81 |
82 FX_WORD CFX_ListItem::GetFirstChar() const { | 82 uint16_t CFX_ListItem::GetFirstChar() const { |
83 CPVT_Word word; | 83 CPVT_Word word; |
84 | 84 |
85 if (IFX_Edit_Iterator* pIterator = GetIterator()) { | 85 if (IFX_Edit_Iterator* pIterator = GetIterator()) { |
86 pIterator->SetAt(1); | 86 pIterator->SetAt(1); |
87 pIterator->GetWord(word); | 87 pIterator->GetWord(word); |
88 } | 88 } |
89 | 89 |
90 return word.Word; | 90 return word.Word; |
91 } | 91 } |
92 | 92 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 } | 563 } |
564 | 564 |
565 void CFX_ListCtrl::OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) { | 565 void CFX_ListCtrl::OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) { |
566 OnVK(0, bShift, bCtrl); | 566 OnVK(0, bShift, bCtrl); |
567 } | 567 } |
568 | 568 |
569 void CFX_ListCtrl::OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) { | 569 void CFX_ListCtrl::OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) { |
570 OnVK(GetCount() - 1, bShift, bCtrl); | 570 OnVK(GetCount() - 1, bShift, bCtrl); |
571 } | 571 } |
572 | 572 |
573 FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) { | 573 FX_BOOL CFX_ListCtrl::OnChar(uint16_t nChar, FX_BOOL bShift, FX_BOOL bCtrl) { |
574 int32_t nIndex = GetLastSelected(); | 574 int32_t nIndex = GetLastSelected(); |
575 int32_t nFindIndex = FindNext(nIndex, nChar); | 575 int32_t nFindIndex = FindNext(nIndex, nChar); |
576 | 576 |
577 if (nFindIndex != nIndex) { | 577 if (nFindIndex != nIndex) { |
578 OnVK(nFindIndex, bShift, bCtrl); | 578 OnVK(nFindIndex, bShift, bCtrl); |
579 return TRUE; | 579 return TRUE; |
580 } | 580 } |
581 return FALSE; | 581 return FALSE; |
582 } | 582 } |
583 | 583 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 | 813 |
814 int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { | 814 int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { |
815 return CFX_List::GetItemIndex(OutToIn(point)); | 815 return CFX_List::GetItemIndex(OutToIn(point)); |
816 } | 816 } |
817 | 817 |
818 CFX_WideString CFX_ListCtrl::GetText() const { | 818 CFX_WideString CFX_ListCtrl::GetText() const { |
819 if (IsMultipleSel()) | 819 if (IsMultipleSel()) |
820 return GetItemText(m_nCaretIndex); | 820 return GetItemText(m_nCaretIndex); |
821 return GetItemText(m_nSelItem); | 821 return GetItemText(m_nSelItem); |
822 } | 822 } |
OLD | NEW |