|
@@ -10,6 +10,8 @@ using Compdfkit_Tools.PDFControl;
|
|
using ComPDFKit.DigitalSign;
|
|
using ComPDFKit.DigitalSign;
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
using ComPDFKitViewer;
|
|
using ComPDFKitViewer;
|
|
|
|
+using ComPDFKit.Tool;
|
|
|
|
+using ComPDFKit.PDFAnnotation;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFView
|
|
namespace Compdfkit_Tools.PDFView
|
|
{
|
|
{
|
|
@@ -40,14 +42,14 @@ namespace Compdfkit_Tools.PDFView
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public RegularViewerControl()
|
|
public RegularViewerControl()
|
|
{
|
|
{
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
panelState.PropertyChanged -= PanelState_PropertyChanged;
|
|
panelState.PropertyChanged -= PanelState_PropertyChanged;
|
|
panelState.PropertyChanged += PanelState_PropertyChanged;
|
|
panelState.PropertyChanged += PanelState_PropertyChanged;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
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))
|
|
@@ -71,7 +73,7 @@ namespace Compdfkit_Tools.PDFView
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void ExpandLeftPanel(bool isExpand)
|
|
public void ExpandLeftPanel(bool isExpand)
|
|
{
|
|
{
|
|
BotaContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
|
|
BotaContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
|
|
@@ -87,26 +89,55 @@ namespace Compdfkit_Tools.PDFView
|
|
BodyGrid.ColumnDefinitions[1].Width = new GridLength(0);
|
|
BodyGrid.ColumnDefinitions[1].Width = new GridLength(0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void ExpandRightPropertyPanel(UIElement propertytPanel, Visibility visible)
|
|
public void ExpandRightPropertyPanel(UIElement propertytPanel, Visibility visible)
|
|
{
|
|
{
|
|
PropertyContainer.Width = 260;
|
|
PropertyContainer.Width = 260;
|
|
PropertyContainer.Child = propertytPanel;
|
|
PropertyContainer.Child = propertytPanel;
|
|
PropertyContainer.Visibility = visible;
|
|
PropertyContainer.Visibility = visible;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
#region Init PDFViewer
|
|
#region Init PDFViewer
|
|
|
|
|
|
private void InitialControl()
|
|
private void InitialControl()
|
|
{
|
|
{
|
|
PdfViewControl.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.Pan);
|
|
PdfViewControl.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.Pan);
|
|
//PdfViewControl.PDFView?.SetShowLink(true);
|
|
//PdfViewControl.PDFView?.SetShowLink(true);
|
|
- PDFGrid.Child = PdfViewControl;
|
|
|
|
|
|
+ PDFGrid.Child = PdfViewControl;
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged -= UndoManager_PropertyChanged;
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.PropertyChanged += UndoManager_PropertyChanged;
|
|
|
|
+ PdfViewControl.MouseRightButtonDownHandler -= PdfViewControl_MouseRightButtonDownHandler;
|
|
|
|
+ PdfViewControl.MouseRightButtonDownHandler += PdfViewControl_MouseRightButtonDownHandler;
|
|
//PdfViewControl.PDFView.SetFormFieldHighlight(true);
|
|
//PdfViewControl.PDFView.SetFormFieldHighlight(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ 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:
|
|
|
|
+ break;
|
|
|
|
+ case MouseHitTestType.kText:
|
|
|
|
+ CreateSelectTextContextMenu(sender, ref ContextMenu);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ ContextMenu = null;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ PdfViewControl.SetRightMenu(ContextMenu);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void CreateSelectTextContextMenu(object sender, ref ContextMenu menu)
|
|
|
|
+ {
|
|
|
|
+ menu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
|
|
|
|
+ }
|
|
|
|
+
|
|
public void InitWithPDFViewer(PDFViewControl pdfViewer)
|
|
public void InitWithPDFViewer(PDFViewControl pdfViewer)
|
|
{
|
|
{
|
|
PdfViewControl = pdfViewer;
|
|
PdfViewControl = pdfViewer;
|
|
@@ -114,7 +145,7 @@ namespace Compdfkit_Tools.PDFView
|
|
FloatPageTool.InitWithPDFViewer(pdfViewer);
|
|
FloatPageTool.InitWithPDFViewer(pdfViewer);
|
|
InitialControl();
|
|
InitialControl();
|
|
DataContext = this;
|
|
DataContext = this;
|
|
- if(PdfViewControl!=null && PdfViewControl.PDFViewTool.GetCPDFViewer()!=null)
|
|
|
|
|
|
+ if (PdfViewControl != null && PdfViewControl.PDFViewTool.GetCPDFViewer() != null)
|
|
{
|
|
{
|
|
//PdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
|
|
//PdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
|
|
//PdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
|
|
//PdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
|
|
@@ -136,7 +167,7 @@ namespace Compdfkit_Tools.PDFView
|
|
// 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;
|
|
@@ -146,7 +177,7 @@ namespace Compdfkit_Tools.PDFView
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
//}
|
|
//}
|
|
-
|
|
|
|
|
|
+
|
|
public void CancelWidgetClickHandler()
|
|
public void CancelWidgetClickHandler()
|
|
{
|
|
{
|
|
//if (PdfViewControl != null && PdfViewControl.PDFView != null)
|
|
//if (PdfViewControl != null && PdfViewControl.PDFView != null)
|
|
@@ -159,12 +190,12 @@ namespace Compdfkit_Tools.PDFView
|
|
{
|
|
{
|
|
this.BotaContainer.Child = botaControl;
|
|
this.BotaContainer.Child = botaControl;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void SetDisplaySettingsControl(CPDFDisplaySettingsControl displaySettingsControl)
|
|
public void SetDisplaySettingsControl(CPDFDisplaySettingsControl displaySettingsControl)
|
|
{
|
|
{
|
|
this.displaySettingsControl = displaySettingsControl;
|
|
this.displaySettingsControl = displaySettingsControl;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void SetSignatureStatusBarControl(SignatureStatusBarControl signatureStatusBarControl)
|
|
public void SetSignatureStatusBarControl(SignatureStatusBarControl signatureStatusBarControl)
|
|
{
|
|
{
|
|
this.signatureStatusBarControl = signatureStatusBarControl;
|
|
this.signatureStatusBarControl = signatureStatusBarControl;
|
|
@@ -210,7 +241,7 @@ namespace Compdfkit_Tools.PDFView
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
-
|
|
|
|
|
|
+
|
|
#region Context Menu
|
|
#region Context Menu
|
|
|
|
|
|
private void ExtraImage_Click(object sender, RoutedEventArgs e)
|
|
private void ExtraImage_Click(object sender, RoutedEventArgs e)
|