ソースを参照

综合-右键菜单和undo redo涉及到UI的改动

zhuyi 11 ヶ月 前
コミット
2637112e7e

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Annotation/AnnotationControl/AnnotationControl.xaml.cs

@@ -239,7 +239,7 @@ namespace Compdfkit_Tools.PDFControl
                 default:
                     menu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
                     menu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
-                    //menu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
+                    menu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
                     menu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
                     break;
             }

+ 0 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml.cs

@@ -104,7 +104,6 @@ namespace Compdfkit_Tools.PDFControl
                     pdfViewerControl.SetIsVisibleCustomMouse(false);
                     pdfViewerControl.SetIsShowStampMouse(false);
                 }
-
             }
         }
 

+ 7 - 2
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFLinkUI.xaml.cs

@@ -12,6 +12,7 @@ using System.Runtime.InteropServices;
 using ComPDFKit.PDFDocument;
 using ComPDFKitViewer;
 using Compdfkit_Tools.PDFControl;
+using ComPDFKit.Tool.Help;
 
 namespace Compdfkit_Tools.Annotation.PDFAnnotationUI
 {
@@ -176,8 +177,10 @@ namespace Compdfkit_Tools.Annotation.PDFAnnotationUI
                     default:
                         break;
                 }
-
-               // linkParam.InvokeLinkSaveCalled(null, null);
+                if (ParamConverter.SetParamForPDFAnnot(viewControl.GetCPDFViewer().GetDocument(), linkAnnot, linkParam))
+                {
+                    viewControl.UpdateAnnotFrame();
+                };
             }
             else
             {
@@ -366,6 +369,7 @@ namespace Compdfkit_Tools.Annotation.PDFAnnotationUI
 
         private void CheckingItem(int ItemIndex)
         {
+            DrawLink =true;
             bool BtnIsEnabled = false;
 
             if (linkParam != null)
@@ -403,6 +407,7 @@ namespace Compdfkit_Tools.Annotation.PDFAnnotationUI
                 }
             }
             SaveBtn.IsEnabled = BtnIsEnabled;
+            SaveBtn.IsEnabled = true;
         }
         #endregion
         private void UserControl_Loaded(object sender, RoutedEventArgs e)

+ 5 - 4
Demo/Examples/Compdfkit_Tools/Edit/ContentEditCOntrol/ContentEditControl.xaml.cs

@@ -302,6 +302,7 @@ namespace Compdfkit_Tools.PDFControl
             if (PdfViewControl != null && PdfViewControl.PDFViewTool != null)
             {
                 PdfViewControl.PDFViewTool.GetCPDFViewer()?.UndoManager?.Undo();
+                //PdfViewControl.PDFToolManager.ClearSelect();
                 PdfViewControl.PDFViewTool.GetCPDFViewer().UpDateRenderFrame();
             }
         }
@@ -311,6 +312,7 @@ namespace Compdfkit_Tools.PDFControl
             if (PdfViewControl != null && PdfViewControl.PDFViewTool != null)
             {
                 PdfViewControl.PDFViewTool.GetCPDFViewer()?.UndoManager?.Redo();
+                //PdfViewControl.PDFToolManager.ClearSelect();
                 PdfViewControl.PDFViewTool.GetCPDFViewer().UpDateRenderFrame();
             }
         }
@@ -375,17 +377,16 @@ namespace Compdfkit_Tools.PDFControl
             switch (e.hitTestType)
             {
                 case MouseHitTestType.kTextEdit:
-                    CreateEditTextMenu(sender, ref ContextMenu);
-                    break;
                 case MouseHitTestType.kImageEdit:
+                    CreateEditMenu(sender, ref ContextMenu);
                     break;
                 default:
-                    ContextMenu = null;
+                    ContextMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
                     break;
             }
             PdfViewControl.SetRightMenu(ContextMenu);
         }
-        private void CreateEditTextMenu(object sender, ref ContextMenu menu)
+        private void CreateEditMenu(object sender, ref ContextMenu menu)
         {
             menu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
             menu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });

+ 2 - 3
Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml.cs

@@ -15,7 +15,6 @@ using System.IO;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
-using System.Windows.Media;
 using System.Windows.Media.Imaging;
 
 namespace Compdfkit_Tools.Edit
@@ -42,7 +41,7 @@ namespace Compdfkit_Tools.Edit
         {
             ToolView = newPDFView;
             RotateUI.RotationChanged -= RotateUI_RotationChanged;
-            FlipUI.FlipChanged -= FlipUI_FlipChanged; 
+            FlipUI.FlipChanged -= FlipUI_FlipChanged;
             RotateUI.RotationChanged += RotateUI_RotationChanged;
             FlipUI.FlipChanged += FlipUI_FlipChanged;
         }
@@ -67,7 +66,7 @@ namespace Compdfkit_Tools.Edit
 
         private void PDFImageEditControl_Loaded(object sender, RoutedEventArgs e)
         {
-      
+
         }
 
         private void FlipUI_FlipChanged(object sender, bool e)

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/FormControl/FormControl.xaml.cs

@@ -362,7 +362,7 @@ namespace Compdfkit_Tools.PDFControl
                 case C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET:
                     menu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
                     menu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
-                    //menu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
+                    menu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
                     menu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
                     break;
                 default: