|
@@ -57,7 +57,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
private double splitWidthScale = 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 };
|
|
|
#endregion
|
|
@@ -117,9 +117,17 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
splitToolManager.MouseMoveHandler += PDFToolManager_MouseMoveHandler;
|
|
|
splitToolManager.MouseRightButtonDownHandler += PDFToolManager_MouseRightButtonDownHandler;
|
|
|
|
|
|
+ GetCPDFViewer().OnRenderFinish -= PDFViewControl_OnRenderFinish;
|
|
|
+ GetCPDFViewer().OnRenderFinish += PDFViewControl_OnRenderFinish;
|
|
|
+
|
|
|
SetCursor();
|
|
|
}
|
|
|
|
|
|
+ private void PDFViewControl_OnRenderFinish(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ SetCursorStatus();
|
|
|
+ }
|
|
|
+
|
|
|
private void PDFViewTool_DrawChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
FocusPDFViewToolChanged?.Invoke(this, EventArgs.Empty);
|
|
@@ -345,7 +353,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
toolManager?.SetCreateWidgetType(type);
|
|
|
splitToolManager?.SetCreateWidgetType(type);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void SetAnnotParam(AnnotParam param)
|
|
|
{
|
|
|
DefaultSettingParam defaultSettingParam = viewerTool.GetDefaultSettingParam();
|
|
@@ -437,7 +445,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
FocusPDFViewTool?.GetCPDFViewer()?.SetZoom(CheckZoomLevel(zoom, true));
|
|
|
FocusPDFViewTool?.GetCPDFViewer()?.UpdateRenderFrame();
|
|
|
};
|
|
|
- contextMenu.Items.Add(zoomInMenu);
|
|
|
+ contextMenu.Items.Add(zoomInMenu);
|
|
|
|
|
|
MenuItem zoomOutMenu = new MenuItem();
|
|
|
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)
|
|
|
{
|
|
|
+ if (GetCPDFViewer().IsRendering)
|
|
|
+ {
|
|
|
+ GetCPDFViewer().Cursor = Cursors.Wait;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (isAutomaticScroll)
|
|
|
{
|
|
|
middleMovePoint = e.GetPosition(this);
|
|
@@ -711,7 +790,7 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
{
|
|
|
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_STRIKEOUT
|
|
|
};
|
|
|
+
|
|
|
if (GetCPDFViewer().AnnotHitTest() == null && PDFViewTool.IsText() && annotTypes.Contains(toolManager.GetAnnotType()))
|
|
|
{
|
|
|
newCursor = Cursors.IBeam;
|