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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 switch (word) { | 277 switch (word) { |
278 case FWL_VKEY_Back: | 278 case FWL_VKEY_Back: |
279 Backspace(); | 279 Backspace(); |
280 break; | 280 break; |
281 case FWL_VKEY_Return: | 281 case FWL_VKEY_Return: |
282 InsertReturn(); | 282 InsertReturn(); |
283 break; | 283 break; |
284 case FWL_VKEY_Unknown: | 284 case FWL_VKEY_Unknown: |
285 break; | 285 break; |
286 default: | 286 default: |
287 if (IsINSERTpressed(nFlag)) | |
288 Delete(); | |
289 InsertWord(word, GetCharSet()); | 287 InsertWord(word, GetCharSet()); |
290 break; | 288 break; |
291 } | 289 } |
292 | 290 |
293 return TRUE; | 291 return TRUE; |
294 } | 292 } |
295 | 293 |
296 FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point, | 294 FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point, |
297 uint32_t nFlag) { | 295 uint32_t nFlag) { |
298 CPWL_Wnd::OnLButtonDown(point, nFlag); | 296 CPWL_Wnd::OnLButtonDown(point, nFlag); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar); | 620 CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar); |
623 return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd)); | 621 return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd)); |
624 } | 622 } |
625 | 623 |
626 void CPWL_EditCtrl::SetReadyToInput() { | 624 void CPWL_EditCtrl::SetReadyToInput() { |
627 if (m_bMouseDown) { | 625 if (m_bMouseDown) { |
628 ReleaseCapture(); | 626 ReleaseCapture(); |
629 m_bMouseDown = FALSE; | 627 m_bMouseDown = FALSE; |
630 } | 628 } |
631 } | 629 } |
OLD | NEW |