Przeglądaj źródła

【综合】菜单栏补充

tangchao 1 rok temu
rodzic
commit
4e1c95ecba

+ 45 - 18
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -622,24 +622,6 @@ extension KMBrowserWindowController {
         }
     }
     
-    @IBAction func notesLink(_ sender: Any?) {
-        KMPrint("notesLink")
-    }
-    
-    @IBAction func notesStamp(_ sender: Any?) {
-        KMPrint("notesStamp")
-    }
-    
-    @IBAction func table(_ sender: Any?) {
-        KMPrint("table ...")
-    }
-    @IBAction func image(_ sender: Any?) {
-        KMPrint("image ...")
-    }
-    @IBAction func addForm(_ sender: Any?) {
-        KMPrint("addForm ...")
-    }
-    
     @IBAction func editNote(_ sender: Any?) {
         KMPrint("editNote ...")
     }
@@ -1956,6 +1938,24 @@ extension KMBrowserWindowController {
         }
     }
     
+    @IBAction func notesLink(_ sender: Any?) {
+        if (self.canResponseDocumentAction() == false) {
+            return
+        }
+        if let document = self.browser.activeTabContents() as? KMMainDocument, document.isHome == false {
+            document.mainViewController?.notesLink(sender)
+        }
+    }
+    
+    @IBAction func notesStamp(_ sender: Any?) {
+        if (self.canResponseDocumentAction() == false) {
+            return
+        }
+        if let document = self.browser.activeTabContents() as? KMMainDocument, document.isHome == false {
+            document.mainViewController?.notesStamp(sender)
+        }
+    }
+    
     @IBAction func menuItemAction_signure(_ sender: Any) {
         if (self.canResponseDocumentAction() == false) {
             return
@@ -1965,6 +1965,33 @@ extension KMBrowserWindowController {
         }
     }
     
+    @IBAction func image(_ sender: Any?) {
+        if (self.canResponseDocumentAction() == false) {
+            return
+        }
+        if let document = self.browser.activeTabContents() as? KMMainDocument, document.isHome == false {
+            document.mainViewController?.image(sender)
+        }
+    }
+    
+    @IBAction func table(_ sender: Any?) {
+        if (self.canResponseDocumentAction() == false) {
+            return
+        }
+        if let document = self.browser.activeTabContents() as? KMMainDocument, document.isHome == false {
+            document.mainViewController?.table(sender)
+        }
+    }
+    
+    @IBAction func addForm(_ sender: Any?) {
+        if (self.canResponseDocumentAction() == false) {
+            return
+        }
+        if let document = self.browser.activeTabContents() as? KMMainDocument, document.isHome == false {
+            document.mainViewController?.table(addForm)
+        }
+    }
+    
     @IBAction func menuItemAction_hiddenAllAnnotation(_ sender: Any) {
         if (self.canResponseDocumentAction() == false) {
             return

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMFillSignShapePanel.swift

@@ -247,7 +247,7 @@ typealias AnnotationSelfSignViewControllerCallBack = (_ newType: CAnnotationType
         colorVC2.fillColor = self.colors[1]
         colorVC3.fillColor = self.colors[2]
         colorVC4.fillColor = self.colors[3]
-        colorVC5.fillColor = annotationModel.color()
+        colorVC5.fillColor = annotationModel.color() ?? .black
 
         if annotationModel.annotations != nil {
             if annotationModel.annotations.count > 1 {

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -309,7 +309,9 @@ class KMToolbarController: NSViewController {
                     identifier == KMToolbarSelectToolModeItemIdentifier ||
                     identifier == KMToolbarZoomToSelectionItemIdentifier) {
                     self.childToolBarView?.leftControllButtonAction(item: item!.clickButton)
-                } else if identifier == KMToolbarViewSettingIdentifier {
+                } else if identifier == KMToolbarViewSettingIdentifier ||
+                            identifier == KMAnnotationImageToolbarItemIdentifier ||
+                            identifier == KMAnnotationTableToolbarItemIdentifier {
                     self.childToolBarView?.itemAction(item!)
                 } else {
                     self.childToolBarView?.changeAnnotationMode(item: item!.clickButton)

+ 44 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -610,6 +610,10 @@ extension KMMainViewController {
 
     }
     
+    @IBAction func notesLink(_ sender: Any?) {
+        self.mainMenuUpdateAnnotationStyle(identifier: KMToolbarLinkAnnotationItemIdentifier)
+    }
+    
     // stamp
     
     @IBAction func menuItemAction_stamp(_ sender: Any) {
@@ -628,10 +632,50 @@ extension KMMainViewController {
 
     }
     
+    @IBAction func notesStamp(_ sender: Any?) {
+        self.mainMenuUpdateAnnotationStyle(identifier: KMAnnotationStampToolbarItemIdentifier)
+    }
+    
     @IBAction func menuItemAction_signure(_ sender: Any) {
         self.mainMenuUpdateAnnotationStyle(identifier: KMToolbarSignSignatureAnnotationItemIdentifier)
     }
     
+    @IBAction func image(_ sender: Any?) {
+        self.toolbarController.clickItem(KMAnnotationImageToolbarItemIdentifier)
+    }
+    
+    @IBAction func table(_ sender: Any?) {
+        self.toolbarController.clickItem(KMAnnotationTableToolbarItemIdentifier)
+    }
+    
+    @IBAction func addForm(_ sender: Any?) {
+        guard let item = sender as? NSMenuItem else {
+            NSSound.beep()
+            return
+        }
+
+        var identifiers: String?
+        let idx = item.tag
+        if idx == 0 { // raido
+            identifiers = KMToolbarToolRadioButtonItemIdentifier
+        } else if idx == 1 { // checkbox
+            identifiers = KMToolbarToolCheckBoxItemIdentifier
+        } else if idx == 2 { // textfiled
+            identifiers = KMToolbarToolTextFieldItemIdentifier
+        } else if idx == 3 { // combobox
+            identifiers = KMToolbarToolPullDownmenuItemIdentifier
+        } else if idx == 4 { // listbox
+            identifiers = KMToolbarToolListBoxItemIdentifier
+        } else if idx == 5 { // button
+            identifiers = KMToolbarToolButtonIdentifier
+        } else if idx == 6 { // sign
+            identifiers = KMToolbarToolSignBoxIdentifier
+        }
+        if let itemID = identifiers {
+            self.toolbarController.clickItem(itemID)
+        }
+    }
+    
     @IBAction func menuItemAction_hiddenAllAnnotation(_ sender: Any) {
         self.showOrHideNotes()
     }

+ 23 - 3
PDF Office/PDF Master/Class/SystemMenu/KMSystemAnnotationMenu.swift

@@ -24,14 +24,19 @@ protocol KMSystemAnnotationMenuProtocol: NSObjectProtocol {
     func menuItemAction_linkPage(_ sender: Any)
     func menuItemAction_linkHttps(_ sender: Any)
     func menuItemAction_linkEmail(_ sender: Any)
+    func notesLink(_ sender: Any)
     
     // stamp
     func menuItemAction_stamp(_ sender: Any)
     func menuItemAction_stampStandard(_ sender: Any)
     func menuItemAction_stampDynamic(_ sender: Any)
     func menuItemAction_stampCustom(_ sender: Any)
+    func notesStamp(_ sender: Any)
     
     func menuItemAction_signure(_ sender: Any)
+    func image(_ sender: Any)
+    func table(_ sender: Any)
+    func addForm(_ sender: Any)
     
     func menuItemAction_hiddenAllAnnotation(_ sender: Any)
     func menuItemAction_clearAllAnnotation(_ sender: Any)
@@ -41,9 +46,17 @@ extension KMSystemAnnotationMenuProtocol {
     func menuItemAction_linkHttps(_ sender: Any) {}
     func menuItemAction_linkEmail(_ sender: Any) {}
     
+    func notesLink(_ sender: Any) {}
+    
     func menuItemAction_stampStandard(_ sender: Any) {}
     func menuItemAction_stampDynamic(_ sender: Any) {}
     func menuItemAction_stampCustom(_ sender: Any) {}
+    
+    func notesStamp(_ sender: Any) {}
+    
+    func image(_ sender: Any) {}
+    func table(_ sender: Any) {}
+    func addForm(_ sender: Any) {}
 }
 
 extension KMSystemMenu.Annotation {
@@ -62,13 +75,19 @@ extension KMSystemMenu.Annotation {
     public static let linkPageSelector      = NSSelectorFromString("menuItemAction_linkPage:")
     public static let linkHttpsSelector     = NSSelectorFromString("menuItemAction_linkHttps:")
     public static let linkEmailSelector     = NSSelectorFromString("menuItemAction_linkEmail:")
+    public static let notesLinkSelector     = NSSelectorFromString("notesLink:")
     
     public static let stampSelector         = NSSelectorFromString("menuItemAction_stamp:")
     public static let stampStandardSelector = NSSelectorFromString("menuItemAction_stampStandard:")
     public static let stampDynamicSelector  = NSSelectorFromString("menuItemAction_stampDynamic:")
     public static let stampCustomSelector   = NSSelectorFromString("menuItemAction_stampCustom:")
+    public static let notesStampSelector   = NSSelectorFromString("notesStamp:")
     
     public static let signureSelector       = NSSelectorFromString("menuItemAction_signure:")
+    public static let imageSelector       = NSSelectorFromString("image:")
+    public static let tableSelector       = NSSelectorFromString("table:")
+    public static let addFormSelector       = NSSelectorFromString("addForm:")
+    
     public static let hiddenAllSelector     = NSSelectorFromString("menuItemAction_hiddenAllAnnotation:")
     public static let clearAllSelector      = NSSelectorFromString("menuItemAction_clearAllAnnotation:")
     
@@ -77,10 +96,11 @@ extension KMSystemMenu.Annotation {
                 self.textSelector, self.noteSelector, self.squreSelector, self.circleSelector,
                 self.arrowSelector, self.lineSelector,
                 // link
-                self.linkSelector, self.linkPageSelector, self.linkHttpsSelector, self.linkEmailSelector,
+                self.linkSelector, self.linkPageSelector, self.linkHttpsSelector, self.linkEmailSelector, self.notesLinkSelector, 
                 // stamp
-                self.stampSelector, self.stampStandardSelector, self.stampDynamicSelector, self.stampCustomSelector,
+                self.stampSelector, self.stampStandardSelector, self.stampDynamicSelector, self.stampCustomSelector, self.notesStampSelector, 
                 // other
-                self.signureSelector, self.hiddenAllSelector, self.clearAllSelector]
+                self.signureSelector, self.imageSelector, self.tableSelector, self.addFormSelector,
+                self.hiddenAllSelector, self.clearAllSelector]
     }
 }

+ 50 - 18
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -68,22 +68,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "8235F04B-6228-4B00-BE09-47CA8DA1C8AF"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "3157"
-            endingLineNumber = "3157"
-            landmarkName = "-doDragMultipleAnnotationWithEvent:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -126,8 +110,8 @@
             filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2119"
-            endingLineNumber = "2119"
+            startingLineNumber = "2146"
+            endingLineNumber = "2146"
             landmarkName = "savePDFSettingToDefaults(_:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -356,5 +340,53 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "A20B3568-4CD6-49FA-966A-0964A1226408"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "348"
+            endingLineNumber = "348"
+            landmarkName = "noteFilterAction(_:)"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "A20B3568-4CD6-49FA-966A-0964A1226408 - d7da3d21f2c61f59"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reaer_Pro.KMLeftSideViewController.noteFilterAction(Swift.Optional&lt;Swift.AnyObject&gt;) -&gt; ()"
+                  moduleName = "PDF Reaer Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "348"
+                  endingLineNumber = "348"
+                  offsetFromSymbolStart = "145">
+               </Location>
+               <Location
+                  uuid = "A20B3568-4CD6-49FA-966A-0964A1226408 - d7da3d21f2c61f59"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Reaer_Pro.KMLeftSideViewController.noteFilterAction(Swift.Optional&lt;Swift.AnyObject&gt;) -&gt; ()"
+                  moduleName = "PDF Reaer Pro"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "348"
+                  endingLineNumber = "348"
+                  offsetFromSymbolStart = "184">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>