Browse Source

ComPDFKit.Tool(win)-补充光标移动事件,App获取当前光标对象更新属性面板

liyijie 7 months ago
parent
commit
2492ca54de
1 changed files with 9 additions and 1 deletions
  1. 9 1
      Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.TextEdit.cs

+ 9 - 1
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.TextEdit.cs

@@ -159,6 +159,11 @@ namespace ComPDFKit.Tool
 
         protected Pen editHoverPen = null;
 
+        /// <summary>
+        /// Cursor movement changes event
+        /// </summary>
+        public event EventHandler CaretVisualAreaChanged;
+
         /// <summary>
         /// Edit border point style settings
         /// </summary>
@@ -1079,6 +1084,7 @@ namespace ComPDFKit.Tool
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.GetPrevCharPlace();
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.ClearSelectChars();
                         DrawCaretVisualArea(currentEditAreaObject.cPDFEditArea as CPDFEditTextArea);
+                        CaretVisualAreaChanged.Invoke(null, null);
                         ke.Handled = true;
                     }
                     break;
@@ -1088,6 +1094,7 @@ namespace ComPDFKit.Tool
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.GetNextCharPlace();
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.ClearSelectChars();
                         DrawCaretVisualArea(currentEditAreaObject.cPDFEditArea as CPDFEditTextArea);
+                        CaretVisualAreaChanged.Invoke(null, null);
                         ke.Handled = true;
                     }
                     break;
@@ -1097,6 +1104,7 @@ namespace ComPDFKit.Tool
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.GetUpCharPlace();
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.ClearSelectChars();
                         DrawCaretVisualArea(currentEditAreaObject.cPDFEditArea as CPDFEditTextArea);
+                        CaretVisualAreaChanged.Invoke(null, null);
                         ke.Handled = true;
                     }
                     break;
@@ -1106,6 +1114,7 @@ namespace ComPDFKit.Tool
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.GetDownCharPlace();
                         (currentEditAreaObject.cPDFEditArea as CPDFEditTextArea)?.ClearSelectChars();
                         DrawCaretVisualArea(currentEditAreaObject.cPDFEditArea as CPDFEditTextArea);
+                        CaretVisualAreaChanged.Invoke(null, null);
                         ke.Handled = true;
                     }
                     break;
@@ -2125,7 +2134,6 @@ namespace ComPDFKit.Tool
                     {
                         continue;
                     }
-                    int pageindex = -1;
                     foreach (CPDFEditArea editArea in item.CPDFEditPageObj.GetEditAreaList())
                     {
                         Rect TextBlock = DataConversionForWPF.CRectConversionForRect(editArea.GetFrame());