|
@@ -193,6 +193,27 @@ extension KMMainViewController {
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Stamp", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 8)
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Stamp", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 8)
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Signture", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 9)
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Signture", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 9)
|
|
stypItem.submenu = stypeMenu
|
|
stypItem.submenu = stypeMenu
|
|
|
|
+ if self.listView.annotationType == .ink {
|
|
|
|
+ stypeMenu.item(at: 0)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .freeText {
|
|
|
|
+ stypeMenu.item(at: 1)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .anchored {
|
|
|
|
+ stypeMenu.item(at: 2)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .square {
|
|
|
|
+ stypeMenu.item(at: 3)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .circle {
|
|
|
|
+ stypeMenu.item(at: 4)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .arrow {
|
|
|
|
+ stypeMenu.item(at: 5)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .line {
|
|
|
|
+ stypeMenu.item(at: 6)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .link {
|
|
|
|
+ stypeMenu.item(at: 7)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .stamp {
|
|
|
|
+ stypeMenu.item(at: 8)?.state = .on
|
|
|
|
+ } else if self.listView.annotationType == .signSignature {
|
|
|
|
+ stypeMenu.item(at: 9)?.state = .on
|
|
|
|
+ }
|
|
return stypItem
|
|
return stypItem
|
|
}
|
|
}
|
|
|
|
|
|
@@ -205,6 +226,17 @@ extension KMMainViewController {
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Select", comment: ""), action: #selector(menuItemAnnotationClick_toolModel), target: self, tag: 3)
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Select", comment: ""), action: #selector(menuItemAnnotationClick_toolModel), target: self, tag: 3)
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Zoom Select", comment: ""), action: #selector(menuItemAnnotationClick_toolModel), target: self, tag: 4)
|
|
stypeMenu.addItem(withTitle: NSLocalizedString("Zoom Select", comment: ""), action: #selector(menuItemAnnotationClick_toolModel), target: self, tag: 4)
|
|
stypItem.submenu = stypeMenu
|
|
stypItem.submenu = stypeMenu
|
|
|
|
+ if self.toolbarController.toolbarType == .Annatiton {
|
|
|
|
+ stypeMenu.item(at: 0)?.state = .on
|
|
|
|
+ } else if self.toolbarController.toolbarType == .Move {
|
|
|
|
+ stypeMenu.item(at: 1)?.state = .on
|
|
|
|
+ } else if self.toolbarController.toolbarType == .Magnify {
|
|
|
|
+ stypeMenu.item(at: 2)?.state = .on
|
|
|
|
+ } else if self.toolbarController.toolbarType == .Select {
|
|
|
|
+ stypeMenu.item(at: 3)?.state = .on
|
|
|
|
+ } else if self.toolbarController.toolbarType == .SelectZoom {
|
|
|
|
+ stypeMenu.item(at: 4)?.state = .on
|
|
|
|
+ }
|
|
return stypItem
|
|
return stypItem
|
|
}
|
|
}
|
|
|
|
|
|
@@ -351,20 +383,29 @@ extension KMMainViewController {
|
|
|
|
|
|
@objc func menuItemAnnotationClick_toolModel(sender: NSMenuItem) {
|
|
@objc func menuItemAnnotationClick_toolModel(sender: NSMenuItem) {
|
|
self.listView.toolMode = .noteToolMode
|
|
self.listView.toolMode = .noteToolMode
|
|
|
|
+ var identifier = KMDocumentAnnotationToolbarItemIdentifier
|
|
|
|
+ var model : KMToolbarViewType = .None
|
|
switch sender.tag {
|
|
switch sender.tag {
|
|
case 0:
|
|
case 0:
|
|
- self.toolbarController.toolbarType = .Annatiton
|
|
|
|
|
|
+ identifier = KMDocumentAnnotationToolbarItemIdentifier
|
|
|
|
+ model = .Annatiton
|
|
case 1:
|
|
case 1:
|
|
- self.toolbarController.toolbarType = .Move
|
|
|
|
|
|
+ identifier = KMToolbarMoveToolModeItemIdentifier
|
|
|
|
+ model = .Move
|
|
case 2:
|
|
case 2:
|
|
- self.toolbarController.toolbarType = .Magnify
|
|
|
|
|
|
+ identifier = KMToolbarMagnifyToolModeItemIdentifier
|
|
|
|
+ model = .Magnify
|
|
case 3:
|
|
case 3:
|
|
- self.toolbarController.toolbarType = .Select
|
|
|
|
|
|
+ identifier = KMToolbarSelectToolModeItemIdentifier
|
|
|
|
+ model = .Select
|
|
case 4:
|
|
case 4:
|
|
- self.toolbarController.toolbarType = .SelectZoom
|
|
|
|
|
|
+ identifier = KMToolbarZoomToSelectionItemIdentifier
|
|
|
|
+ model = .SelectZoom
|
|
default:
|
|
default:
|
|
break
|
|
break
|
|
}
|
|
}
|
|
|
|
+ let item : KMToolBoxItem = (self.toolbarController.mainToolBarView?.toolbarItemFindItemIdentifiers(value: identifier))!
|
|
|
|
+ self.toolbarController.mainToolBarView?.delegate?.toolbarViewController?(self.toolbarController.mainToolBarView!, clickMode:model, toolbar: item)
|
|
}
|
|
}
|
|
|
|
|
|
@objc func menuItemAnnotationClick_add(sender : NSMenuItem) {
|
|
@objc func menuItemAnnotationClick_add(sender : NSMenuItem) {
|
|
@@ -431,7 +472,7 @@ extension KMMainViewController {
|
|
case 4:
|
|
case 4:
|
|
self.listView.annotationType = CAnnotationType.square
|
|
self.listView.annotationType = CAnnotationType.square
|
|
case 5:
|
|
case 5:
|
|
- self.listView.annotationType = CAnnotationType.line
|
|
|
|
|
|
+ self.listView.annotationType = CAnnotationType.arrow
|
|
case 6:
|
|
case 6:
|
|
self.listView.annotationType = CAnnotationType.line
|
|
self.listView.annotationType = CAnnotationType.line
|
|
case 7:
|
|
case 7:
|
|
@@ -458,14 +499,12 @@ extension KMMainViewController {
|
|
self.listView.document.removeBookmark(forPageIndex: UInt(self.listView.currentPageIndex))
|
|
self.listView.document.removeBookmark(forPageIndex: UInt(self.listView.currentPageIndex))
|
|
self.listView.setNeedsDisplayForVisiblePages()
|
|
self.listView.setNeedsDisplayForVisiblePages()
|
|
}
|
|
}
|
|
- if self.leftSideViewController.type.methodType == .BookMark {
|
|
|
|
- self.leftSideViewController.bookViewController.reloadData()
|
|
|
|
- }
|
|
|
|
|
|
+ self.leftSideViewController.refreshMethodType(methodType: .BookMark)
|
|
|
|
+ self.leftSideViewController.bookViewController.reloadData()
|
|
}
|
|
}
|
|
|
|
|
|
@objc func menuItemAnnotationClick_FindString(sender:NSMenuItem) {
|
|
@objc func menuItemAnnotationClick_FindString(sender:NSMenuItem) {
|
|
- self.leftSideViewController.type.methodType = .Search;
|
|
|
|
- self.leftSideViewController.refreshShowMethod();
|
|
|
|
|
|
+ self.leftSideViewController.refreshMethodType(methodType: .Search)
|
|
}
|
|
}
|
|
|
|
|
|
@objc func menuItemAnnotationClick_Print(sender:NSMenuItem) {
|
|
@objc func menuItemAnnotationClick_Print(sender:NSMenuItem) {
|
|
@@ -1263,11 +1302,17 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
self.listView.scaleFactor = 1.5
|
|
self.listView.scaleFactor = 1.5
|
|
break
|
|
break
|
|
case 9:
|
|
case 9:
|
|
- self.listView.scaleFactor = 4.0
|
|
|
|
|
|
+ self.listView.scaleFactor = 2.0
|
|
break
|
|
break
|
|
case 10:
|
|
case 10:
|
|
|
|
+ self.listView.scaleFactor = 4.0
|
|
|
|
+ break
|
|
|
|
+ case 11:
|
|
self.listView.scaleFactor = 6.0
|
|
self.listView.scaleFactor = 6.0
|
|
break
|
|
break
|
|
|
|
+ case 12:
|
|
|
|
+ self.listView.scaleFactor = 10.0
|
|
|
|
+ break
|
|
default:
|
|
default:
|
|
break
|
|
break
|
|
}
|
|
}
|