|
@@ -1389,13 +1389,13 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
self.openRightPane()
|
|
|
}
|
|
|
|
|
|
- if let lineAnnotation = fristAnnotation as? CPDFLineAnnotation {
|
|
|
- handleLineAnnotation(lineAnnotation)
|
|
|
- } else if let polylineAnnotation = fristAnnotation as? CPDFPolylineAnnotation {
|
|
|
- handlePolylineAnnotation(polylineAnnotation)
|
|
|
- } else if let polygonAnnotation = fristAnnotation as? CPDFPolygonAnnotation {
|
|
|
- handlePolygonAnnotation(polygonAnnotation)
|
|
|
- }
|
|
|
+// if let lineAnnotation = fristAnnotation as? CPDFLineAnnotation {
|
|
|
+// handleLineAnnotation(lineAnnotation)
|
|
|
+// } else if let polylineAnnotation = fristAnnotation as? CPDFPolylineAnnotation {
|
|
|
+// handlePolylineAnnotation(polylineAnnotation)
|
|
|
+// } else if let polygonAnnotation = fristAnnotation as? CPDFPolygonAnnotation {
|
|
|
+// handlePolygonAnnotation(polygonAnnotation)
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1581,6 +1581,43 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
listView.needsDisplay = true
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ var pagePoint: NSPoint = .zero
|
|
|
+ if let page = self.listView.pageAndPoint(&pagePoint, for: theEvent, nearest: true) {
|
|
|
+ let anno = page.annotation(at: pagePoint)
|
|
|
+
|
|
|
+ let item1 = NSMenuItem(title: NSLocalizedString("Properties", comment: ""), action: #selector(menuItemActionMeasureProperty), target: self)
|
|
|
+ item1.representedObject = anno
|
|
|
+ let item2 = NSMenuItem(title: NSLocalizedString("Settings", comment: ""), action: #selector(menuItemActionMeasureSetting), target: self)
|
|
|
+ item2.representedObject = anno
|
|
|
+ let item3 = NSMenuItem(title: NSLocalizedString("Delete", comment: ""), action: #selector(menuItemActionMeasureDelete), target: self)
|
|
|
+ item3.representedObject = anno
|
|
|
+
|
|
|
+ if let data = anno as? CPDFPolygonAnnotation { // 多变形
|
|
|
+ currentMenu.removeAllItems()
|
|
|
+
|
|
|
+ currentMenu.insertItem(item1, at: 0)
|
|
|
+ currentMenu.insertItem(item2, at: 1)
|
|
|
+ currentMenu.insertItem(item3, at: 2)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if let data = anno as? CPDFPolylineAnnotation {
|
|
|
+ currentMenu.removeAllItems()
|
|
|
+ currentMenu.insertItem(item1, at: 0)
|
|
|
+ currentMenu.insertItem(item2, at: 1)
|
|
|
+ currentMenu.insertItem(item3, at: 2)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if let data = anno as? CPDFLineAnnotation, data.isMeasure {
|
|
|
+ currentMenu.removeAllItems()
|
|
|
+ currentMenu.insertItem(item1, at: 0)
|
|
|
+ currentMenu.insertItem(item2, at: 1)
|
|
|
+ currentMenu.insertItem(item3, at: 2)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if (listView.toolMode == .selectToolMode){
|
|
|
currentMenu.insertItem(NSMenuItem.separator(), at: 3)
|