|
@@ -17,6 +17,7 @@ using Compdfkit_Tools.Helper;
|
|
using ComPDFKit.DigitalSign;
|
|
using ComPDFKit.DigitalSign;
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
using ComPDFKit.PDFAnnotation;
|
|
using ComPDFKit.PDFAnnotation;
|
|
|
|
+using ComPDFKit.Tool;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFControl
|
|
namespace Compdfkit_Tools.PDFControl
|
|
{
|
|
{
|
|
@@ -70,7 +71,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
if (PDFViewControl.PDFViewTool.GetCPDFViewer().UndoManager.CanRedo ||
|
|
if (PDFViewControl.PDFViewTool.GetCPDFViewer().UndoManager.CanRedo ||
|
|
PDFViewControl.PDFViewTool.GetCPDFViewer().UndoManager.CanUndo)
|
|
PDFViewControl.PDFViewTool.GetCPDFViewer().UndoManager.CanUndo)
|
|
{
|
|
{
|
|
- return true;
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -123,7 +124,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
displaySettingsControl = null;
|
|
displaySettingsControl = null;
|
|
PDFViewControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_NONE);
|
|
PDFViewControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_NONE);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void SetBOTAContainer(CPDFBOTABarControl botaControl)
|
|
public void SetBOTAContainer(CPDFBOTABarControl botaControl)
|
|
{
|
|
{
|
|
this.BotaContainer.Child = botaControl;
|
|
this.BotaContainer.Child = botaControl;
|
|
@@ -194,13 +195,48 @@ namespace Compdfkit_Tools.PDFControl
|
|
//PDFViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
//PDFViewControl.PDFView.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
//PDFViewControl.PDFView.AnnotActiveHandler -= PDFView_AnnotActiveHandler;
|
|
//PDFViewControl.PDFView.AnnotActiveHandler -= PDFView_AnnotActiveHandler;
|
|
//PDFViewControl.PDFView.AnnotActiveHandler += PDFView_AnnotActiveHandler;
|
|
//PDFViewControl.PDFView.AnnotActiveHandler += PDFView_AnnotActiveHandler;
|
|
-
|
|
|
|
- //PDFViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
|
|
|
|
- //PDFViewControl.PDFView.WidgetClickHandler -= PDFView_WidgetClickHandler;
|
|
|
|
|
|
+
|
|
|
|
+ PDFViewControl.MouseRightButtonDownHandler -= PDFViewControl_MouseRightButtonDownHandler;
|
|
|
|
+ PDFViewControl.MouseRightButtonDownHandler += PDFViewControl_MouseRightButtonDownHandler;
|
|
//PDFViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
|
|
//PDFViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
|
|
//PDFViewControl.PDFView.WidgetClickHandler += PDFView_WidgetClickHandler;
|
|
//PDFViewControl.PDFView.WidgetClickHandler += PDFView_WidgetClickHandler;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void PDFViewControl_MouseRightButtonDownHandler(object sender, ComPDFKit.Tool.MouseEventObject e)
|
|
|
|
+ {
|
|
|
|
+ ContextMenu ContextMenu = PDFViewControl.GetRightMenu();
|
|
|
|
+ if (ContextMenu == null)
|
|
|
|
+ {
|
|
|
|
+ ContextMenu = new ContextMenu();
|
|
|
|
+ }
|
|
|
|
+ switch (e.hitTestType)
|
|
|
|
+ {
|
|
|
|
+ case MouseHitTestType.kAnnot:
|
|
|
|
+ case MouseHitTestType.kSelectRect:
|
|
|
|
+ CreateAnnotContextMenu(sender, ref ContextMenu, e.annotType);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ ContextMenu=null;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ PDFViewControl.SetRightMenu(ContextMenu);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void CreateAnnotContextMenu(object sender, ref ContextMenu menu, C_ANNOTATION_TYPE annotType)
|
|
|
|
+ {
|
|
|
|
+ switch (annotType)
|
|
|
|
+ {
|
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET:
|
|
|
|
+ break;
|
|
|
|
+ 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 });
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public void UnloadEvent()
|
|
public void UnloadEvent()
|
|
{
|
|
{
|
|
//PDFViewControl.PDFView.AnnotEditHandler -= PDFView_AnnotEditHandler;
|
|
//PDFViewControl.PDFView.AnnotEditHandler -= PDFView_AnnotEditHandler;
|
|
@@ -365,7 +401,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
// {
|
|
// {
|
|
// e.Handle = true;
|
|
// e.Handle = true;
|
|
// e.PopupMenu = new ContextMenu();
|
|
// e.PopupMenu = new ContextMenu();
|
|
-
|
|
|
|
|
|
+
|
|
// e.PopupMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
|
|
// e.PopupMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
|
|
// e.PopupMenu.Items.Add(new Separator());
|
|
// e.PopupMenu.Items.Add(new Separator());
|
|
|
|
|
|
@@ -666,7 +702,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
OnCanSaveChanged?.Invoke(this, CanSave);
|
|
OnCanSaveChanged?.Invoke(this, CanSave);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private void PanelState_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
private void PanelState_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
{
|
|
{
|
|
if (e.PropertyName == nameof(PanelState.IsLeftPanelExpand))
|
|
if (e.PropertyName == nameof(PanelState.IsLeftPanelExpand))
|
|
@@ -715,7 +751,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
// PropertyContainer.Child = PDFAnnotationControl;
|
|
// PropertyContainer.Child = PDFAnnotationControl;
|
|
// PDFAnnotationControl.SetAnnotEventData(e);
|
|
// PDFAnnotationControl.SetAnnotEventData(e);
|
|
//}
|
|
//}
|
|
-
|
|
|
|
|
|
+
|
|
//private void PDFView_WidgetClickHandler(object sender, WidgetArgs e)
|
|
//private void PDFView_WidgetClickHandler(object sender, WidgetArgs e)
|
|
//{
|
|
//{
|
|
// if ((e is WidgetSignArgs args))
|
|
// if ((e is WidgetSignArgs args))
|
|
@@ -729,7 +765,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
-
|
|
|
|
|
|
+
|
|
// if (args.WidgetType == C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS)
|
|
// if (args.WidgetType == C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS)
|
|
// {
|
|
// {
|
|
// panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
|
|
// panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
|
|
@@ -781,6 +817,6 @@ namespace Compdfkit_Tools.PDFControl
|
|
AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Squiggly);
|
|
AnnotationBarControl.SetAnnotationType(CPDFAnnotationType.Squiggly);
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|