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/pdfwindow/PWL_Edit.h" | 7 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 return FALSE; | 855 return FALSE; |
856 } | 856 } |
857 | 857 |
858 void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled) { | 858 void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled) { |
859 if (bEnabled) | 859 if (bEnabled) |
860 AddFlag(PES_SPELLCHECK); | 860 AddFlag(PES_SPELLCHECK); |
861 else | 861 else |
862 RemoveFlag(PES_SPELLCHECK); | 862 RemoveFlag(PES_SPELLCHECK); |
863 } | 863 } |
864 | 864 |
865 FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) { | 865 FX_BOOL CPWL_Edit::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) { |
866 if (m_bMouseDown) | 866 if (m_bMouseDown) |
867 return TRUE; | 867 return TRUE; |
868 | 868 |
869 if (nChar == FWL_VKEY_Delete) { | 869 if (nChar == FWL_VKEY_Delete) { |
870 if (m_pFillerNotify) { | 870 if (m_pFillerNotify) { |
871 FX_BOOL bRC = TRUE; | 871 FX_BOOL bRC = TRUE; |
872 FX_BOOL bExit = FALSE; | 872 FX_BOOL bExit = FALSE; |
873 CFX_WideString strChange; | 873 CFX_WideString strChange; |
874 CFX_WideString strChangeEx; | 874 CFX_WideString strChangeEx; |
875 | 875 |
(...skipping 20 matching lines...) Expand all Loading... |
896 return TRUE; | 896 return TRUE; |
897 | 897 |
898 return bRet; | 898 return bRet; |
899 } | 899 } |
900 | 900 |
901 /** | 901 /** |
902 *In case of implementation swallow the OnKeyDown event. | 902 *In case of implementation swallow the OnKeyDown event. |
903 *If the event is swallowed, implementation may do other unexpected things, which | 903 *If the event is swallowed, implementation may do other unexpected things, which |
904 *is not the control means to do. | 904 *is not the control means to do. |
905 */ | 905 */ |
906 FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag) { | 906 FX_BOOL CPWL_Edit::IsProceedtoOnChar(uint16_t nKeyCode, FX_DWORD nFlag) { |
907 FX_BOOL bCtrl = IsCTRLpressed(nFlag); | 907 FX_BOOL bCtrl = IsCTRLpressed(nFlag); |
908 FX_BOOL bAlt = IsALTpressed(nFlag); | 908 FX_BOOL bAlt = IsALTpressed(nFlag); |
909 if (bCtrl && !bAlt) { | 909 if (bCtrl && !bAlt) { |
910 // hot keys for edit control. | 910 // hot keys for edit control. |
911 switch (nKeyCode) { | 911 switch (nKeyCode) { |
912 case 'C': | 912 case 'C': |
913 case 'V': | 913 case 'V': |
914 case 'X': | 914 case 'X': |
915 case 'A': | 915 case 'A': |
916 case 'Z': | 916 case 'Z': |
917 return TRUE; | 917 return TRUE; |
918 default: | 918 default: |
919 break; | 919 break; |
920 } | 920 } |
921 } | 921 } |
922 // control characters. | 922 // control characters. |
923 switch (nKeyCode) { | 923 switch (nKeyCode) { |
924 case FWL_VKEY_Escape: | 924 case FWL_VKEY_Escape: |
925 case FWL_VKEY_Back: | 925 case FWL_VKEY_Back: |
926 case FWL_VKEY_Return: | 926 case FWL_VKEY_Return: |
927 case FWL_VKEY_Space: | 927 case FWL_VKEY_Space: |
928 return TRUE; | 928 return TRUE; |
929 default: | 929 default: |
930 return FALSE; | 930 return FALSE; |
931 } | 931 } |
932 } | 932 } |
933 | 933 |
934 FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag) { | 934 FX_BOOL CPWL_Edit::OnChar(uint16_t nChar, FX_DWORD nFlag) { |
935 if (m_bMouseDown) | 935 if (m_bMouseDown) |
936 return TRUE; | 936 return TRUE; |
937 | 937 |
938 FX_BOOL bRC = TRUE; | 938 FX_BOOL bRC = TRUE; |
939 FX_BOOL bExit = FALSE; | 939 FX_BOOL bExit = FALSE; |
940 | 940 |
941 if (!IsCTRLpressed(nFlag)) { | 941 if (!IsCTRLpressed(nFlag)) { |
942 if (m_pFillerNotify) { | 942 if (m_pFillerNotify) { |
943 CFX_WideString swChange; | 943 CFX_WideString swChange; |
944 | 944 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 } | 1183 } |
1184 | 1184 |
1185 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, | 1185 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, |
1186 const CFX_FloatPoint& ptOffset) { | 1186 const CFX_FloatPoint& ptOffset) { |
1187 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; | 1187 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; |
1188 IFX_Edit::GeneratePageObjects( | 1188 IFX_Edit::GeneratePageObjects( |
1189 pObjectHolder, m_pEdit, ptOffset, NULL, | 1189 pObjectHolder, m_pEdit, ptOffset, NULL, |
1190 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), | 1190 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
1191 ObjArray); | 1191 ObjArray); |
1192 } | 1192 } |
OLD | NEW |