Browse Source

ComPDFKit.Tool(Win)-补充滚动工具模式,表单多选接口补充

liyijie 3 weeks ago
parent
commit
eb1be03f93

+ 4 - 0
Demo/Examples/ComPDFKit.Tool/CPDFToolManager.cs

@@ -341,6 +341,10 @@ namespace ComPDFKit.Tool
                     viewerTool.SetToolType(ToolType.Customize);
                     viewerTool.RemoveSelectTextData();
                     break;
+                case ToolType.ViewerScroller:
+                    viewerTool.SetToolType(ToolType.ViewerScroller);
+                    viewerTool.RemoveSelectTextData();
+                    break;
 
                 default:
                     break;

+ 6 - 0
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.AnnotSelector.cs

@@ -77,6 +77,12 @@ namespace ComPDFKit.Tool
             }
         }
 
+        public void SetAnnotAllowMultiSelect(bool isAllow) 
+        {
+            AllowMultiSelect = isAllow;
+            AllowAreaSelect = isAllow;
+        }
+
         private void AnnotSelectDraw()
         {
             if (!AllowMultiSelect)

+ 17 - 2
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.xaml.cs

@@ -65,6 +65,10 @@ namespace ComPDFKit.Tool
         ContentEdit,
         Customize,
         SelectedPage,
+        /// <summary>
+        /// Scroller Tool
+        /// </summary>
+        ViewerScroller
     }
 
     public partial class CPDFViewerTool : UserControl
@@ -348,7 +352,7 @@ namespace ComPDFKit.Tool
             {
                 return;
             }
-
+            
             if (!HitTestBorder())
             {
                 RemovePopTextUI();
@@ -368,6 +372,12 @@ namespace ComPDFKit.Tool
                 annotType = C_ANNOTATION_TYPE.C_ANNOTATION_NONE,
                 IsCreate = false
             };
+            if (currentModel == ToolType.ViewerScroller)
+            {
+                // Scroller Tool Only  Scrolle
+                MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
+                return;
+            }
             if (isDrawSelectRect)
             {
                 if (e.ClickCount == 2)
@@ -712,7 +722,12 @@ namespace ComPDFKit.Tool
                 annotType = C_ANNOTATION_TYPE.C_ANNOTATION_NONE,
                 IsCreate = false
             };
-
+            if (currentModel == ToolType.ViewerScroller)
+            {
+                // Scroller Tool Only  Scrolle
+                MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
+                return;
+            }
             if (Mouse.LeftButton != MouseButtonState.Pressed)
             {
                 List<ToolType> allowModeList = new List<ToolType>()