|
@@ -57,7 +57,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
private double splitWidthScale = 0.5;
|
|
private double splitWidthScale = 0.5;
|
|
private double splitHeightScale = 0.5;
|
|
private double splitHeightScale = 0.5;
|
|
|
|
|
|
- public bool CustomSignHandle { get; set; }
|
|
|
|
|
|
+ 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 };
|
|
private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
|
|
#endregion
|
|
#endregion
|
|
@@ -117,9 +117,17 @@ namespace ComPDFKit.Controls.PDFControl
|
|
splitToolManager.MouseMoveHandler += PDFToolManager_MouseMoveHandler;
|
|
splitToolManager.MouseMoveHandler += PDFToolManager_MouseMoveHandler;
|
|
splitToolManager.MouseRightButtonDownHandler += PDFToolManager_MouseRightButtonDownHandler;
|
|
splitToolManager.MouseRightButtonDownHandler += PDFToolManager_MouseRightButtonDownHandler;
|
|
|
|
|
|
|
|
+ GetCPDFViewer().OnRenderFinish -= PDFViewControl_OnRenderFinish;
|
|
|
|
+ GetCPDFViewer().OnRenderFinish += PDFViewControl_OnRenderFinish;
|
|
|
|
+
|
|
SetCursor();
|
|
SetCursor();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void PDFViewControl_OnRenderFinish(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ SetCursorStatus();
|
|
|
|
+ }
|
|
|
|
+
|
|
private void PDFViewTool_DrawChanged(object sender, EventArgs e)
|
|
private void PDFViewTool_DrawChanged(object sender, EventArgs e)
|
|
{
|
|
{
|
|
FocusPDFViewToolChanged?.Invoke(this, EventArgs.Empty);
|
|
FocusPDFViewToolChanged?.Invoke(this, EventArgs.Empty);
|
|
@@ -345,7 +353,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
toolManager?.SetCreateWidgetType(type);
|
|
toolManager?.SetCreateWidgetType(type);
|
|
splitToolManager?.SetCreateWidgetType(type);
|
|
splitToolManager?.SetCreateWidgetType(type);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void SetAnnotParam(AnnotParam param)
|
|
public void SetAnnotParam(AnnotParam param)
|
|
{
|
|
{
|
|
DefaultSettingParam defaultSettingParam = viewerTool.GetDefaultSettingParam();
|
|
DefaultSettingParam defaultSettingParam = viewerTool.GetDefaultSettingParam();
|
|
@@ -437,7 +445,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
FocusPDFViewTool?.GetCPDFViewer()?.SetZoom(CheckZoomLevel(zoom, true));
|
|
FocusPDFViewTool?.GetCPDFViewer()?.SetZoom(CheckZoomLevel(zoom, true));
|
|
FocusPDFViewTool?.GetCPDFViewer()?.UpdateRenderFrame();
|
|
FocusPDFViewTool?.GetCPDFViewer()?.UpdateRenderFrame();
|
|
};
|
|
};
|
|
- contextMenu.Items.Add(zoomInMenu);
|
|
|
|
|
|
+ contextMenu.Items.Add(zoomInMenu);
|
|
|
|
|
|
MenuItem zoomOutMenu = new MenuItem();
|
|
MenuItem zoomOutMenu = new MenuItem();
|
|
zoomOutMenu.Header = LanguageHelper.CommonManager.GetString("Menu_ZoomOut");
|
|
zoomOutMenu.Header = LanguageHelper.CommonManager.GetString("Menu_ZoomOut");
|
|
@@ -643,8 +651,79 @@ namespace ComPDFKit.Controls.PDFControl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void SetCursorStatus()
|
|
|
|
+ {
|
|
|
|
+ List<ToolType> toolTypes = new List<ToolType>
|
|
|
|
+ {
|
|
|
|
+ ToolType.Viewer,
|
|
|
|
+ ToolType.Pan
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ ToolType currentMode = PDFViewTool.GetToolType();
|
|
|
|
+ Cursor newCursor = Cursors.Arrow;
|
|
|
|
+
|
|
|
|
+ if (toolTypes.Contains(currentMode))
|
|
|
|
+ {
|
|
|
|
+ BaseAnnot hitAnnot = GetCPDFViewer().AnnotHitTest();
|
|
|
|
+ if (hitAnnot != null)
|
|
|
|
+ {
|
|
|
|
+ if (hitAnnot is LinkAnnot || hitAnnot is BaseWidget)
|
|
|
|
+ {
|
|
|
|
+ newCursor = Cursors.Hand;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ newCursor = annotEditCursor;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (!PDFViewTool.IsSelectRectMousePoint())
|
|
|
|
+ {
|
|
|
|
+ newCursor = (PDFToolManager.GetToolType() == ToolType.Pan) ? panToolCursor : Cursors.Arrow;
|
|
|
|
+
|
|
|
|
+ if (PDFViewTool.IsText())
|
|
|
|
+ {
|
|
|
|
+ newCursor = Cursors.IBeam;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (currentMode == ToolType.CreateAnnot)
|
|
|
|
+ {
|
|
|
|
+ List<C_ANNOTATION_TYPE> annotTypes = new List<C_ANNOTATION_TYPE>
|
|
|
|
+ {
|
|
|
|
+ C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT,
|
|
|
|
+ C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE,
|
|
|
|
+ C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY,
|
|
|
|
+ C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ if (GetCPDFViewer().AnnotHitTest() == null && PDFViewTool.IsText() && annotTypes.Contains(toolManager.GetAnnotType()))
|
|
|
|
+ {
|
|
|
|
+ newCursor = Cursors.IBeam;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (newCursor == Cursors.IBeam || newCursor == panToolCursor || newCursor == Cursors.Arrow)
|
|
|
|
+ {
|
|
|
|
+ newCursor = annotEditCursor;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ GetCPDFViewer().Cursor = newCursor;
|
|
|
|
+ }
|
|
|
|
+
|
|
private void PDFViewControl_MouseMove(object sender, MouseEventArgs e)
|
|
private void PDFViewControl_MouseMove(object sender, MouseEventArgs e)
|
|
{
|
|
{
|
|
|
|
+ if (GetCPDFViewer().IsRendering)
|
|
|
|
+ {
|
|
|
|
+ GetCPDFViewer().Cursor = Cursors.Wait;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (isAutomaticScroll)
|
|
if (isAutomaticScroll)
|
|
{
|
|
{
|
|
middleMovePoint = e.GetPosition(this);
|
|
middleMovePoint = e.GetPosition(this);
|
|
@@ -711,7 +790,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
{
|
|
{
|
|
newCursor = Cursors.IBeam;
|
|
newCursor = Cursors.IBeam;
|
|
}
|
|
}
|
|
- cursorSet = true;
|
|
|
|
|
|
+ cursorSet = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -730,6 +809,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY,
|
|
C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY,
|
|
C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT
|
|
C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT
|
|
};
|
|
};
|
|
|
|
+
|
|
if (GetCPDFViewer().AnnotHitTest() == null && PDFViewTool.IsText() && annotTypes.Contains(toolManager.GetAnnotType()))
|
|
if (GetCPDFViewer().AnnotHitTest() == null && PDFViewTool.IsText() && annotTypes.Contains(toolManager.GetAnnotType()))
|
|
{
|
|
{
|
|
newCursor = Cursors.IBeam;
|
|
newCursor = Cursors.IBeam;
|