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/pdfwindow/PWL_EditCtrl.h" | 7 #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" |
8 | 8 |
9 #include "core/fpdfdoc/include/cpvt_section.h" | 9 #include "core/fpdfdoc/include/cpvt_section.h" |
10 #include "core/fpdfdoc/include/cpvt_word.h" | 10 #include "core/fpdfdoc/include/cpvt_word.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (m_pEditCaret) | 121 if (m_pEditCaret) |
122 return; | 122 return; |
123 | 123 |
124 m_pEditCaret = new CPWL_Caret; | 124 m_pEditCaret = new CPWL_Caret; |
125 m_pEditCaret->SetInvalidRect(GetClientRect()); | 125 m_pEditCaret->SetInvalidRect(GetClientRect()); |
126 | 126 |
127 PWL_CREATEPARAM ecp = cp; | 127 PWL_CREATEPARAM ecp = cp; |
128 ecp.pParentWnd = this; | 128 ecp.pParentWnd = this; |
129 ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP; | 129 ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP; |
130 ecp.dwBorderWidth = 0; | 130 ecp.dwBorderWidth = 0; |
131 ecp.nBorderStyle = PBS_SOLID; | 131 ecp.nBorderStyle = BorderStyle::SOLID; |
132 ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); | 132 ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); |
133 | 133 |
134 m_pEditCaret->Create(ecp); | 134 m_pEditCaret->Create(ecp); |
135 } | 135 } |
136 | 136 |
137 void CPWL_EditCtrl::SetFontSize(FX_FLOAT fFontSize) { | 137 void CPWL_EditCtrl::SetFontSize(FX_FLOAT fFontSize) { |
138 m_pEdit->SetFontSize(fFontSize); | 138 m_pEdit->SetFontSize(fFontSize); |
139 } | 139 } |
140 | 140 |
141 FX_FLOAT CPWL_EditCtrl::GetFontSize() const { | 141 FX_FLOAT CPWL_EditCtrl::GetFontSize() const { |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar); | 600 CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar); |
601 return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd)); | 601 return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd)); |
602 } | 602 } |
603 | 603 |
604 void CPWL_EditCtrl::SetReadyToInput() { | 604 void CPWL_EditCtrl::SetReadyToInput() { |
605 if (m_bMouseDown) { | 605 if (m_bMouseDown) { |
606 ReleaseCapture(); | 606 ReleaseCapture(); |
607 m_bMouseDown = FALSE; | 607 m_bMouseDown = FALSE; |
608 } | 608 } |
609 } | 609 } |
OLD | NEW |