|
@@ -47,6 +47,9 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
//private ContextMenu RightMenu;
|
|
|
#region Properties
|
|
|
|
|
|
+ private double splitWidthScale = 0.5;
|
|
|
+ private double splitHeightScale = 0.5;
|
|
|
+
|
|
|
public bool CustomSignHandle { get; set; }
|
|
|
|
|
|
private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
|
|
@@ -54,8 +57,6 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
public PDFViewControl()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
-
|
|
|
-
|
|
|
viewerTool = new CPDFViewerTool();
|
|
|
toolManager = new CPDFToolManager(viewerTool);
|
|
|
Loaded += PDFViewControl_Loaded;
|
|
@@ -78,7 +79,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
PDFToolManager.MouseLeftButtonUpHandler -= PDFToolManager_MouseLeftButtonUpHandler;
|
|
|
PDFToolManager.MouseMoveHandler -= PDFToolManager_MouseMoveHandler;
|
|
|
PDFToolManager.AnnotDefaultEditedHandler -= PDFToolManager_AnnotDefaultEditedHandler;
|
|
|
- PDFToolManager.MouseRightButtonDownHandler += PDFToolManager_MouseRightButtonDownHandler;
|
|
|
+ PDFToolManager.MouseRightButtonDownHandler -= PDFToolManager_MouseRightButtonDownHandler;
|
|
|
|
|
|
PDFViewTool.SizeChanged += PDFViewTool_SizeChanged;
|
|
|
PDFViewTool.GetCPDFViewer().MouseWheelZoomHandler += PDFViewControl_MouseWheelZoomHandler;
|
|
@@ -96,7 +97,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
splitToolManager.MouseLeftButtonUpHandler -= PDFToolManager_MouseLeftButtonUpHandler;
|
|
|
splitToolManager.MouseMoveHandler -= PDFToolManager_MouseMoveHandler;
|
|
|
splitToolManager.AnnotDefaultEditedHandler -= PDFToolManager_AnnotDefaultEditedHandler;
|
|
|
- splitToolManager.MouseRightButtonDownHandler += PDFToolManager_MouseRightButtonDownHandler;
|
|
|
+ splitToolManager.MouseRightButtonDownHandler -= PDFToolManager_MouseRightButtonDownHandler;
|
|
|
|
|
|
splitViewerTool.SizeChanged += SplitViewerTool_SizeChanged;
|
|
|
splitViewerTool.GetCPDFViewer().MouseWheelZoomHandler += SplitPDFViewControl_MouseWheelZoomHandler;
|
|
@@ -162,6 +163,14 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
private void SplitViewerTool_SizeChanged(object sender, SizeChangedEventArgs e)
|
|
|
{
|
|
|
+ if (VerticalView.Visibility == Visibility.Visible)
|
|
|
+ {
|
|
|
+ splitWidthScale = VerticalView.ActualWidth / ViewToolGrid.ActualWidth;
|
|
|
+ }
|
|
|
+ if (HorizontalView.Visibility == Visibility.Visible)
|
|
|
+ {
|
|
|
+ splitHeightScale = HorizontalView.ActualHeight / ViewToolGrid.ActualHeight;
|
|
|
+ }
|
|
|
splitViewerTool.GetCPDFViewer().UpDateRenderFrame();
|
|
|
}
|
|
|
|
|
@@ -354,6 +363,18 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
HorizontalView.Child = null;
|
|
|
}
|
|
|
|
|
|
+ public void WindowSizeChange()
|
|
|
+ {
|
|
|
+ if(VerticalView.Visibility == Visibility.Visible)
|
|
|
+ {
|
|
|
+ ViewToolGrid.ColumnDefinitions[2].Width = new GridLength(ViewToolGrid.ActualWidth * splitWidthScale);
|
|
|
+ }
|
|
|
+ if(HorizontalView.Visibility == Visibility.Visible)
|
|
|
+ {
|
|
|
+ ViewToolGrid.RowDefinitions[2].Height = new GridLength(ViewToolGrid.ActualHeight * splitHeightScale);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void PDFView_GotFocus(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
switch ((sender as Border).Tag)
|
|
@@ -412,7 +433,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
FocusPDFViewTool = splitViewerTool;
|
|
|
break;
|
|
|
}
|
|
|
- //SelectedPDFViewToolChanged?.Invoke(this, EventArgs.Empty);
|
|
|
+ FocusPDFViewToolChanged?.Invoke(this, EventArgs.Empty);
|
|
|
}
|
|
|
}
|
|
|
}
|