Browse Source

【2025】【Form】
1、签名注释优化
2、组件库优化

niehaoyu 2 tháng trước cách đây
mục cha
commit
68b7282092

+ 1 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/component_close.imageset/Contents.json

@@ -1,7 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "component_close.pdf",
+      "filename" : "icon_prefix.pdf",
       "idiom" : "universal"
     }
   ],

+ 0 - 83
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/component_close.imageset/component_close.pdf

@@ -1,83 +0,0 @@
-%PDF-1.7
-
-1 0 obj
-  << >>
-endobj
-
-2 0 obj
-  << /Length 3 0 R >>
-stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-1.000000 0.000000 -0.000000 1.000000 7.333344 7.203125 cm
-0.250980 0.274510 0.325490 scn
-0.195262 9.268239 m
-0.455612 9.528588 0.877722 9.528588 1.138071 9.268239 c
-4.666667 5.739643 l
-8.195263 9.268239 l
-8.455612 9.528588 8.877722 9.528588 9.138071 9.268239 c
-9.398421 9.007890 9.398421 8.585779 9.138071 8.325430 c
-5.609476 4.796834 l
-9.138071 1.268238 l
-9.398421 1.007889 9.398421 0.585779 9.138071 0.325430 c
-8.877722 0.065080 8.455612 0.065080 8.195263 0.325430 c
-4.666667 3.854025 l
-1.138071 0.325430 l
-0.877722 0.065080 0.455612 0.065080 0.195262 0.325430 c
--0.065087 0.585779 -0.065087 1.007889 0.195262 1.268238 c
-3.723858 4.796834 l
-0.195262 8.325430 l
--0.065087 8.585779 -0.065087 9.007890 0.195262 9.268239 c
-h
-f*
-n
-Q
-
-endstream
-endobj
-
-3 0 obj
-  760
-endobj
-
-4 0 obj
-  << /Annots []
-     /Type /Page
-     /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ]
-     /Resources 1 0 R
-     /Contents 2 0 R
-     /Parent 5 0 R
-  >>
-endobj
-
-5 0 obj
-  << /Kids [ 4 0 R ]
-     /Count 1
-     /Type /Pages
-  >>
-endobj
-
-6 0 obj
-  << /Pages 5 0 R
-     /Type /Catalog
-  >>
-endobj
-
-xref
-0 7
-0000000000 65535 f
-0000000010 00000 n
-0000000034 00000 n
-0000000850 00000 n
-0000000872 00000 n
-0000001045 00000 n
-0000001119 00000 n
-trailer
-<< /ID [ (some) (id) ]
-   /Root 6 0 R
-   /Size 7
->>
-startxref
-1178
-%%EOF

BIN
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/component_close.imageset/icon_prefix.pdf


+ 14 - 10
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Alert/ComponentAlert.swift

@@ -27,6 +27,9 @@ public class ComponentAlert: ComponentBaseXibView {
     @IBOutlet var cancelButton: ComponentButton!
     @IBOutlet var closeButton: ComponentButton!
     
+    @IBOutlet var closeTopConst: NSLayoutConstraint!
+    @IBOutlet var closeRightConst: NSLayoutConstraint!
+    
     weak open var delegate: ComponentAlertDelegate?
     
     // MARK: Private Property
@@ -139,8 +142,8 @@ public class ComponentAlert: ComponentBaseXibView {
         let detailButtonString = properties.detailButtonString ?? ""
         let cancelButtonString = properties.cancelButtonString ?? ""
         
-        let closeProperty = ComponentButtonProperty(type: .text_gray, size: .xxs, state: .normal, onlyIcon: true, showLeftIcon: false, showRightIcon: false)
-        closeProperty.propertyInfo.leftIcon_nor = ComponentLibrary.shared.image(forResource: "inputField_Clear")
+        let closeProperty = ComponentButtonProperty(type: .text_gray_low, size: .xxs, state: .normal, onlyIcon: true, showLeftIcon: false, showRightIcon: false)
+        closeProperty.propertyInfo.leftIcon_nor = ComponentLibrary.shared.image(forResource: "component_close")
         closeButton.properties = closeProperty
         
         var viewHeightValue: CGFloat = 0
@@ -156,9 +159,8 @@ public class ComponentAlert: ComponentBaseXibView {
             
             viewHeightValue = max(viewHeightValue, detailBtnHeight + 8)
             
-            self.closeButton.frame = CGRectMake(CGRectGetWidth(self.frame) - 24 - 12, CGRectGetMaxY(self.detailButton.frame) - 24 - 4, 24, 24)
-            self.closeButton.autoresizingMask = [.minXMargin, .maxYMargin]
-            
+            closeTopConst.constant = CGRectGetHeight(self.frame)/2.0 - 12
+            closeRightConst.constant = 12
         } else {
             let detailProperty = ComponentButtonProperty(type: .primary, size: .xxs, state: .normal, onlyIcon: false, showLeftIcon: false, showRightIcon: false, buttonText: detailButtonString)
             detailButton.properties = detailProperty
@@ -181,11 +183,11 @@ public class ComponentAlert: ComponentBaseXibView {
                                                  (CGRectGetHeight(self.frame) - subViewHeight)/2.0,
                                                  maxButtonWidth, cancelBtnHeight)
             self.cancelButton.autoresizingMask = [.minXMargin, .maxYMargin]
-            
-            self.closeButton.frame = CGRectMake(CGRectGetWidth(self.frame) - 24 - 12, CGRectGetMaxY(self.detailButton.frame) - 24, 24, 24)
-            self.closeButton.autoresizingMask = [.minXMargin, .maxYMargin]
-            
+             
             viewHeightValue = max(viewHeightValue, subViewHeight + 32)
+            
+            closeTopConst.constant = 16
+            closeRightConst.constant = 16
         }
         
         
@@ -196,7 +198,7 @@ public class ComponentAlert: ComponentBaseXibView {
             self.subTitleLabel.frame = CGRectMake(36, CGRectGetHeight(self.frame)/2.0 - subLabelSize.height/2.0, subLabelSize.width, subLabelSize.height)
             self.subTitleLabel.autoresizingMask = [.maxXMargin, .maxYMargin]
             
-            self.iconImage.frame = CGRectMake(12, CGRectGetMaxY(self.subTitleLabel.frame) - 16 - 2, 16, 16)
+            self.iconImage.frame = CGRectMake(12, CGRectGetMaxY(self.subTitleLabel.frame) - 16, 16, 16)
             self.iconImage.autoresizingMask = [.maxXMargin, .maxYMargin]
             
             viewHeightValue = max(viewHeightValue, subLabelSize.height + 24)
@@ -222,6 +224,8 @@ public class ComponentAlert: ComponentBaseXibView {
         cancelButton.setTarget(self, action: #selector(buttonClicked(_:)))
         detailButton.setTarget(self, action: #selector(buttonClicked(_:)))
         
+        closeButton.reloadData()
+         
     }
     
     @objc func buttonClicked(_ sender: ComponentButton) {

+ 10 - 3
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Alert/ComponentAlert.xib

@@ -10,6 +10,8 @@
             <connections>
                 <outlet property="cancelButton" destination="gg5-82-rZD" id="7Hv-de-jRg"/>
                 <outlet property="closeButton" destination="1jB-vz-Zcs" id="B0K-aO-iqY"/>
+                <outlet property="closeRightConst" destination="eDK-jX-d2f" id="S9f-dg-vgm"/>
+                <outlet property="closeTopConst" destination="1h3-ye-y3a" id="gvG-BA-OcK"/>
                 <outlet property="contendBox" destination="Cq9-CG-7Rl" id="gwm-7C-9tP"/>
                 <outlet property="detailButton" destination="ime-qA-VA8" id="QGY-em-hf1"/>
                 <outlet property="iconImage" destination="i0F-Xd-suT" id="n8i-vv-hag"/>
@@ -67,13 +69,18 @@
                                 <rect key="frame" x="273" y="32" width="156" height="32"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                             </customView>
-                            <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1jB-vz-Zcs" customClass="ComponentButton" customModule="KMComponentLibrary" customModuleProvider="target">
-                                <rect key="frame" x="437" y="100" width="20" height="20"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="1jB-vz-Zcs" customClass="ComponentButton" customModule="KMComponentLibrary" customModuleProvider="target">
+                                <rect key="frame" x="458" y="112" width="24" height="24"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="24" id="CJP-1H-Dc5"/>
+                                    <constraint firstAttribute="width" constant="24" id="aLc-TS-qnc"/>
+                                </constraints>
                             </customView>
                         </subviews>
                         <constraints>
+                            <constraint firstItem="1jB-vz-Zcs" firstAttribute="top" secondItem="UJp-87-kcI" secondAttribute="top" constant="16" id="1h3-ye-y3a"/>
                             <constraint firstItem="jxN-fu-rnv" firstAttribute="top" secondItem="UJp-87-kcI" secondAttribute="top" id="Ha8-0Y-vaV"/>
+                            <constraint firstAttribute="trailing" secondItem="1jB-vz-Zcs" secondAttribute="trailing" constant="16" id="eDK-jX-d2f"/>
                             <constraint firstAttribute="bottom" secondItem="jxN-fu-rnv" secondAttribute="bottom" id="p5q-bF-Y1v"/>
                             <constraint firstItem="jxN-fu-rnv" firstAttribute="leading" secondItem="UJp-87-kcI" secondAttribute="leading" id="ymH-6g-xVD"/>
                         </constraints>

+ 4 - 0
PDF Office/KMComponentLibrary/KMComponentLibrary/View/SideBar/SideBarItem/PageTurner/ComponentSidebarPageTurner.swift

@@ -278,6 +278,10 @@ public class ComponentSidebarPageTurner: ComponentBaseXibView {
         
     }
     
+    public func beginEditing() {
+        self.window?.makeFirstResponder(inputView.inputField)
+    }
+    
 }
 
 extension ComponentSidebarPageTurner: ComponentInputDelegate {

+ 4 - 111
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/Form/CPDFSignatureWidgetAnnotation+PDFListView.swift

@@ -11,11 +11,11 @@ import Foundation
     convenience init(PDFListViewNoteWith document: CPDFDocument) {
         self.init(document: document)
      
-        self.backgroundColor = CPDFSignatureWidgetAnnotation.defaultFillColor()
+        self.backgroundColor = NSColor.blue
         self.backgroundOpacity = 1
         self.border = CPDFBorder(style: .solid, lineWidth: 1, dashPattern: [5])
         self.setFieldName(self.getValidName(inPage: self.page))
-        
+         
     }
     
     override func isMovable() -> Bool {
@@ -44,40 +44,10 @@ import Foundation
     }
 }
 
-//MARK: - Update Default默认值
-extension CPDFSignatureWidgetAnnotation {
-    
-    class func defaultTextColor() -> NSColor {
-        return CPDFAnnotationConfig.getDefaultColor(forKey: CAnnotationTextWidgetFontColorKey) ?? NSColor(red: 0, green: 0, blue: 0, alpha: 1)
-    }
-    
-    class func defaultBorderColor() -> NSColor {
-        return CPDFAnnotationConfig.getDefaultColor(forKey: CAnnotationTextWidgetBorderColorKey) ?? NSColor.clear
-    }
-    
-    class func defaultFillColor() -> NSColor {
-        return CPDFAnnotationConfig.getDefaultColor(forKey: CAnnotationTextWidgetBackgroundColorKey) ?? NSColor.clear
-    }
-    
-    class func defaultFont() -> CPDFFont {
-        return CPDFFont(familyName: CPDFTextWidgetAnnotation.defaultFontName(), fontStyle: CPDFTextWidgetAnnotation.defaultFontStyle())
-    }
-    
-    class func defaultFontName() -> String {
-        return CPDFAnnotationConfig.getDefaultStringValue(forKey: SKAnnotationTextWidgetFontNameKey) ?? "Helvetica"
-    }
-    
-    class func defaultFontStyle() -> String {
-        return CPDFAnnotationConfig.getDefaultStringValue(forKey: SKAnnotationTextWidgetFontStyleKey) ?? "Regular"
-    }
-    
-    
-}
-
 //MARK: - Update
 extension CPDFSignatureWidgetAnnotation {
     
-    class func update(_ annotations: [CPDFTextWidgetAnnotation], state typeIndex: CPDFWidgetShowState, PDFView pdfView: CPDFListView?) {
+    class func update(_ annotations: [CPDFSignatureWidgetAnnotation], state typeIndex: CPDFWidgetShowState, PDFView pdfView: CPDFListView?) {
         guard let pdfView = pdfView else {
             return
         }
@@ -101,7 +71,7 @@ extension CPDFSignatureWidgetAnnotation {
         
     }
     
-    class func update(_ annotations: [CPDFTextWidgetAnnotation], fieldName name: String?, PDFView pdfView: CPDFListView?) {
+    class func update(_ annotations: [CPDFSignatureWidgetAnnotation], fieldName name: String?, PDFView pdfView: CPDFListView?) {
         guard let resultValue = name else {
             return
         }
@@ -114,81 +84,4 @@ extension CPDFSignatureWidgetAnnotation {
         pdfView.setNeedsDisplayMultiAnnotations(annotations)
     }
     
-    class func update(_ annotations: [CPDFTextWidgetAnnotation], stringValue name: String?, PDFView pdfView: CPDFListView?) {
-        guard let resultValue = name else {
-            return
-        }
-        guard let pdfView = pdfView else {
-            return
-        }
-        for annotation in annotations {
-            annotation.stringValue = resultValue
-        }
-        pdfView.setNeedsDisplayMultiAnnotations(annotations)
-    }
-    
-    class func update(_ annotations: [CPDFTextWidgetAnnotation], textColor color: NSColor?, PDFView pdfView: CPDFListView?) {
-        guard let resultColor = color else {
-            return
-        }
-        guard let pdfView = pdfView else {
-            return
-        }
-        
-        for annotation in annotations {
-            annotation.fontColor = resultColor
-        }
-        pdfView.setNeedsDisplayMultiAnnotations(annotations)
-        
-        CPDFAnnotationConfig.setDefaultColor(resultColor, toKey: CAnnotationTextWidgetFontColorKey)
-        
-    }
-    
-    class func update(_ annotations: [CPDFTextWidgetAnnotation], borderColor color: NSColor?, PDFView pdfView: CPDFListView?) {
-        guard let resultColor = color else {
-            return
-        }
-        guard let pdfView = pdfView else {
-            return
-        }
-        
-        for annotation in annotations {
-            annotation.borderColor = resultColor
-        }
-        pdfView.setNeedsDisplayMultiAnnotations(annotations)
-        
-        CPDFAnnotationConfig.setDefaultColor(resultColor, toKey: CAnnotationTextWidgetBorderColorKey)
-    }
-    
-    class func update(_ annotations: [CPDFTextWidgetAnnotation], fillColor color: NSColor?, PDFView pdfView: CPDFListView?) {
-        guard let resultColor = color else {
-            return
-        }
-        guard let pdfView = pdfView else {
-            return
-        }
-        for annotation in annotations {
-            annotation.backgroundColor = resultColor
-        }
-        pdfView.setNeedsDisplayMultiAnnotations(annotations)
-        
-        CPDFAnnotationConfig.setDefaultColor(resultColor, toKey: CAnnotationTextWidgetBackgroundColorKey)
-    }
-    
-    class func updateFont(_ annotations: [CPDFTextWidgetAnnotation], _ cfont: CPDFFont, withPDFView pdfView: CPDFListView?) {
-        guard let pdfView = pdfView else {
-            return
-        }
-        for annotation in annotations {
-            annotation.cFont = cfont
-        }
-        pdfView.setNeedsDisplayMultiAnnotations(annotations)
-        
-        CPDFAnnotationConfig.setDefaultStringValue(cfont.familyName, toKey: SKAnnotationTextWidgetFontNameKey)
-        
-        if let styleName = cfont.styleName {
-            CPDFAnnotationConfig.setDefaultStringValue(styleName, toKey: SKAnnotationTextWidgetFontStyleKey)
-        }
-    }
-    
 }

+ 15 - 8
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/KMRightSideController.swift

@@ -211,6 +211,8 @@ class KMRightSideController: NSViewController {
             titleLabel.stringValue = KMLocalizedString("Fill")
         } else if (contentViewController is KMOCRController) {
             titleLabel.stringValue = KMLocalizedString("OCR")
+        } else if (contentViewController is FormsDigitalSignController) {
+            titleLabel.stringValue = KMLocalizedString("Signature")
         }
         else {
         
@@ -292,13 +294,11 @@ class KMRightSideController: NSViewController {
             
             var controlType: CPDFWidgetControlType = .unknownControl
             var isListChoice: Int = -1
-            if let annotation = firstAnnotation, annotation is CPDFButtonWidgetAnnotation {
-                let widgetAnnot = annotation as! CPDFButtonWidgetAnnotation
-                controlType = widgetAnnot.controlType()
-            } else if let annotation = firstAnnotation, annotation is CPDFChoiceWidgetAnnotation {
-                let widgetAnnot = annotation as! CPDFChoiceWidgetAnnotation
+            if let annotation = firstAnnotation as? CPDFButtonWidgetAnnotation {
+                controlType = annotation.controlType()
+            } else if let annotation = firstAnnotation as? CPDFChoiceWidgetAnnotation {
                 isListChoice = 0
-                if widgetAnnot.isListChoice {
+                if annotation.isListChoice {
                     isListChoice = 1
                 }
             }
@@ -344,8 +344,15 @@ class KMRightSideController: NSViewController {
                 }
                 form_digitalSignController?.pdfView = self.pdfView
                 
+                contentViewController = form_digitalSignController
+            } else if subToolMode == .Form_digitalSign || firstAnnotation is CPDFSignatureWidgetAnnotation {
+                if form_digitalSignController == nil {
+                    form_digitalSignController = FormsDigitalSignController.init()
+                }
+                form_digitalSignController?.pdfView = self.pdfView
                 contentViewController = form_digitalSignController
             }
+            
         } else {
             let exitMulitAnnotation = pdfView?.isMultiAnnotation(annotations)
             if exitMulitAnnotation == true {
@@ -419,9 +426,9 @@ class KMRightSideController: NSViewController {
                 var isMeasure = false
                 if let annotation = firstAnnotation as? CPDFLineAnnotation, let _ = annotation.measureInfo {
                     isMeasure = true
-                } else if let annotation = firstAnnotation as? CPDFPolylineAnnotation {
+                } else if let _ = firstAnnotation as? CPDFPolylineAnnotation {
                     isMeasure = true
-                } else if let annotation = firstAnnotation as? CPDFPolygonAnnotation {
+                } else if let _ = firstAnnotation as? CPDFPolygonAnnotation {
                     isMeasure = true
                 } else if subToolMode == .Measure {
                     isMeasure = true

+ 168 - 4
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/Forms/Forms_DigitalSign/FormsDigitalSignController.swift

@@ -6,27 +6,191 @@
 //
 
 import Cocoa
+import KMComponentLibrary
 
 class FormsDigitalSignController: NSViewController {
     
-       var pdfView: CPDFListView?
-       
+    //General
+    @IBOutlet var generalBox: NSBox!
+    
+    @IBOutlet var nameBGView: NSView!
+    @IBOutlet var nameLabel: NSTextField!
+    @IBOutlet var nameInput: ComponentInput!
+    
+    @IBOutlet var formFieldBGView: NSView!
+    @IBOutlet var formFieldLabel: NSTextField!
+    @IBOutlet var formFieldSelect: ComponentSelect!
+    
+    private var annotations: [CPDFSignatureWidgetAnnotation] = []
+    
+    var pdfView: CPDFListView?
+    
+    //MARK: - func
     override func viewDidLoad() {
         super.viewDidLoad()
         // Do view setup here.
+        
+        setupProperty()
+        
+        reloadUI()
     }
     
     func setupProperty() {
         
+        //MARK: -General
+        nameInput.properties = ComponentInputProperty(size: .s, text: "")
+        nameInput.delegate = self
         
+        var fieldItems: [ComponentMenuitemProperty] = []
+        for string in ["Visible", "Hidden", "Visible but doesn’t print", "Hidden but printable"] {
+            let item = ComponentMenuitemProperty(type: .normal, text: string)
+            fieldItems.append(item)
+        }
+        formFieldSelect.properties = ComponentSelectProperties(size: .s,
+                                                               state: .normal,
+                                                               creatable: false,
+                                                               text: "Visible")
+        formFieldSelect.updateMenuItemsArr(fieldItems)
+        formFieldSelect.delegate = self
+         
     }
     
     func reloadUI() {
- 
+        self.view.wantsLayer = true
+        self.view.layer?.backgroundColor = ComponentLibrary.shared.getComponentColorFromKey("colorBg/layout-middle").cgColor
+        
+        generalBox.fillColor = NSColor.clear
+         
+        //MARK: -General
+        nameLabel.stringValue = KMLocalizedString("Name")
+        nameLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        nameLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
+        
+        formFieldLabel.stringValue = KMLocalizedString("Form Field")
+        formFieldLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
+        formFieldLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
+         
     }
     
     //MARK: - reloadData
     func reloadData() {
- 
+        guard let pdfView = self.pdfView else {
+            return
+        }
+        
+        self.annotations.removeAll()
+        let allAnnotations: [CPDFAnnotation] = pdfView.activeAnnotations as? [CPDFAnnotation] ?? []
+        for annotation in allAnnotations {
+            if annotation is CPDFSignatureWidgetAnnotation {
+                annotations.append((annotation as! CPDFSignatureWidgetAnnotation))
+            }
+        }
+        
+        var firstAnnotation: CPDFSignatureWidgetAnnotation? = nil
+        if annotations.count > 0 {
+            firstAnnotation = annotations.first
+        }
+        
+        var name: String?
+        var formFieldIndex: Int = -1
+        
+        //General
+        if let annotation = firstAnnotation {
+            name = annotation.fieldName()
+            if annotation.shouldDisplay() {
+                if annotation.shouldPrint() {
+                    formFieldIndex = 0
+                } else {
+                    formFieldIndex = 2
+                }
+            } else {
+                if annotation.shouldPrint() {
+                    formFieldIndex = 3
+                } else {
+                    formFieldIndex = 1
+                }
+            }
+        }
+        
+        if annotations.count > 1 {
+            if CPDFWidgetAnnotation.isAnnotationsMultiName(annotations) == true {
+                name = nil
+            }
+            if CPDFWidgetAnnotation.isAnnotationsMultiFormFieldType(annotations) == true {
+                formFieldIndex = -1
+            }
+        }
+        
+        if let value = name {
+            nameInput.properties.text = value
+            nameInput.properties.isDisabled = false
+        } else {
+            nameInput.properties.text = "-"
+            nameInput.properties.isDisabled = true
+        }
+        nameInput.reloadData()
+        
+        if formFieldIndex >= 0 {
+            formFieldSelect.selectItemAtIndex(formFieldIndex)
+        } else {
+            formFieldSelect.properties.text = "-"
+        }
+        formFieldSelect.reloadData()
+         
+    }
+    
+    //MARK: - Mouse
+    override func mouseDown(with event: NSEvent) {
+        super.mouseDown(with: event)
+        
+        view.window?.makeFirstResponder(nil)
+    }
+     
+}
+
+
+//MARK: - ComponentInputDelegate
+extension FormsDigitalSignController: ComponentInputDelegate {
+    func componentInputDidChanged(inputView: ComponentInput) {
+        if inputView == nameInput {
+            CPDFSignatureWidgetAnnotation.update(annotations, fieldName: inputView.properties.text, PDFView: pdfView)
+        }
+    }
+    
+    func componentInputDidEndEditing(inputView: ComponentInput) {
+        if inputView == nameInput {
+            CPDFSignatureWidgetAnnotation.update(annotations, fieldName: inputView.properties.text, PDFView: pdfView)
+        }
+        reloadData()
+    }
+}
+
+
+//MARK: - ComponentSelectDelegate
+extension FormsDigitalSignController: ComponentSelectDelegate {
+    func componentSelectTextDidEndEditing(_ view: ComponentSelect, removeUnit text: String?) {
+        if let result = text {
+            
+        }
+    }
+    
+    func componentSelectDidSelect(view: ComponentSelect?, menuItemProperty: ComponentMenuitemProperty?) {
+        if var result = menuItemProperty?.text {
+            if let textUnit = view?.properties.textUnit {
+                result = result.stringByDeleteCharString(textUnit)
+            }
+            if view == formFieldSelect {
+                if view?.indexOfSelect() == 0 {
+                    CPDFSignatureWidgetAnnotation.update(annotations, state: .Visiable, PDFView: pdfView)
+                } else if view?.indexOfSelect() == 1 {
+                    CPDFSignatureWidgetAnnotation.update(annotations, state: .Hidden, PDFView: pdfView)
+                } else if view?.indexOfSelect() == 2 {
+                    CPDFSignatureWidgetAnnotation.update(annotations, state: .ShowNoPrint, PDFView: pdfView)
+                } else if view?.indexOfSelect() == 3 {
+                    CPDFSignatureWidgetAnnotation.update(annotations, state: .HideAndPrint, PDFView: pdfView)
+                }
+            }
+            reloadData()
+        }
     }
 }

+ 13 - 184
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/Forms/Forms_DigitalSign/FormsDigitalSignController.xib

@@ -9,6 +9,13 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="FormsDigitalSignController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
+                <outlet property="formFieldBGView" destination="Iwd-9l-q8m" id="w7L-fJ-NzV"/>
+                <outlet property="formFieldLabel" destination="Rcf-2t-pDz" id="AlA-QY-QAw"/>
+                <outlet property="formFieldSelect" destination="urk-dF-Iga" id="Wm4-f9-fbX"/>
+                <outlet property="generalBox" destination="ENr-ra-5Yf" id="qPd-R9-DnW"/>
+                <outlet property="nameBGView" destination="0ln-f7-yDc" id="E2v-Mp-K70"/>
+                <outlet property="nameInput" destination="GDp-A2-5Eg" id="hGz-at-Dr8"/>
+                <outlet property="nameLabel" destination="yzz-AB-iCA" id="OPg-ky-xYt"/>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
             </connections>
         </customObject>
@@ -21,185 +28,17 @@
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="QF2-R8-FkN">
                     <rect key="frame" x="0.0" y="0.0" width="455" height="641"/>
                     <subviews>
-                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="ouE-xB-2tM">
-                            <rect key="frame" x="0.0" y="585" width="455" height="56"/>
-                            <subviews>
-                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="7Vd-7X-Jyu" customClass="ComponentTabs" customModule="KMComponentLibrary">
-                                    <rect key="frame" x="112" y="16" width="232" height="32"/>
-                                    <constraints>
-                                        <constraint firstAttribute="width" constant="232" id="dnQ-ml-Y9f"/>
-                                        <constraint firstAttribute="height" constant="32" id="xrF-L1-9UZ"/>
-                                    </constraints>
-                                </customView>
-                            </subviews>
-                            <constraints>
-                                <constraint firstItem="7Vd-7X-Jyu" firstAttribute="centerX" secondItem="ouE-xB-2tM" secondAttribute="centerX" id="BxU-vU-6Nx"/>
-                                <constraint firstAttribute="height" constant="56" id="Hzt-Cl-ZL0"/>
-                                <constraint firstItem="7Vd-7X-Jyu" firstAttribute="top" secondItem="ouE-xB-2tM" secondAttribute="top" constant="8" id="TNQ-pu-XAD"/>
-                            </constraints>
-                        </customView>
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="M4M-dG-Pye">
-                            <rect key="frame" x="0.0" y="0.0" width="455" height="585"/>
+                            <rect key="frame" x="0.0" y="0.0" width="455" height="641"/>
                             <subviews>
-                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="aFh-c7-2au">
-                                    <rect key="frame" x="0.0" y="0.0" width="455" height="585"/>
-                                    <view key="contentView" id="VRY-mS-J4b">
-                                        <rect key="frame" x="0.0" y="0.0" width="455" height="585"/>
-                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                        <subviews>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="zHq-1d-pIT">
-                                                <rect key="frame" x="112" y="433" width="232" height="152"/>
-                                                <subviews>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="ZFj-qK-UMZ">
-                                                        <rect key="frame" x="0.0" y="112" width="232" height="40"/>
-                                                        <subviews>
-                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tdU-9Q-Pjz">
-                                                                <rect key="frame" x="-2" y="12" width="37" height="16"/>
-                                                                <textFieldCell key="cell" lineBreakMode="clipping" title="Color" id="e6p-Ct-r6n">
-                                                                    <font key="font" usesAppearanceFont="YES"/>
-                                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                                </textFieldCell>
-                                                            </textField>
-                                                        </subviews>
-                                                        <constraints>
-                                                            <constraint firstItem="tdU-9Q-Pjz" firstAttribute="leading" secondItem="ZFj-qK-UMZ" secondAttribute="leading" id="AcF-an-GXc"/>
-                                                            <constraint firstAttribute="height" constant="40" id="QyD-lK-sPJ"/>
-                                                            <constraint firstItem="tdU-9Q-Pjz" firstAttribute="centerY" secondItem="ZFj-qK-UMZ" secondAttribute="centerY" id="jlt-cJ-maA"/>
-                                                        </constraints>
-                                                    </customView>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="8pV-T1-beK" customClass="ComponentCColorGroup" customModule="KMComponentLibrary">
-                                                        <rect key="frame" x="24" y="80" width="208" height="32"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="32" id="qaB-V1-qId"/>
-                                                        </constraints>
-                                                    </customView>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="MXj-Hx-E0d" customClass="ComponentCColorGroup" customModule="KMComponentLibrary">
-                                                        <rect key="frame" x="24" y="40" width="208" height="32"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="32" id="OG0-qU-Tax"/>
-                                                        </constraints>
-                                                    </customView>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="qWZ-2g-igZ" customClass="ComponentCColorGroup" customModule="KMComponentLibrary">
-                                                        <rect key="frame" x="24" y="0.0" width="208" height="32"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="32" id="EBO-X1-8T2"/>
-                                                        </constraints>
-                                                    </customView>
-                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gVZ-kb-HsJ">
-                                                        <rect key="frame" x="0.0" y="86" width="20" height="20"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="20" id="A3g-IH-8cn"/>
-                                                            <constraint firstAttribute="width" constant="20" id="JVE-Tw-ucW"/>
-                                                        </constraints>
-                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="textbox_text" id="6dp-YM-kol"/>
-                                                    </imageView>
-                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="P4X-vz-6gO">
-                                                        <rect key="frame" x="0.0" y="46" width="20" height="20"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="width" constant="20" id="L2m-MW-eh2"/>
-                                                            <constraint firstAttribute="height" constant="20" id="fMi-5R-MrQ"/>
-                                                        </constraints>
-                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="color_border" id="IoL-yN-lnj"/>
-                                                    </imageView>
-                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zTM-YT-Krx">
-                                                        <rect key="frame" x="0.0" y="6" width="20" height="20"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="20" id="crt-RJ-ePZ"/>
-                                                            <constraint firstAttribute="width" constant="20" id="dEF-GU-sHj"/>
-                                                        </constraints>
-                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="color_fill" id="UAl-00-gc1"/>
-                                                    </imageView>
-                                                </subviews>
-                                                <constraints>
-                                                    <constraint firstItem="zTM-YT-Krx" firstAttribute="centerY" secondItem="qWZ-2g-igZ" secondAttribute="centerY" id="54U-Qx-me5"/>
-                                                    <constraint firstAttribute="trailing" secondItem="MXj-Hx-E0d" secondAttribute="trailing" id="70z-kP-yfS"/>
-                                                    <constraint firstItem="qWZ-2g-igZ" firstAttribute="top" secondItem="MXj-Hx-E0d" secondAttribute="bottom" constant="8" id="Gvy-8C-I5N"/>
-                                                    <constraint firstItem="P4X-vz-6gO" firstAttribute="leading" secondItem="zHq-1d-pIT" secondAttribute="leading" id="HYR-7s-Odu"/>
-                                                    <constraint firstItem="gVZ-kb-HsJ" firstAttribute="leading" secondItem="zHq-1d-pIT" secondAttribute="leading" id="LxP-1o-a7L"/>
-                                                    <constraint firstAttribute="trailing" secondItem="ZFj-qK-UMZ" secondAttribute="trailing" id="RFN-iW-y6d"/>
-                                                    <constraint firstItem="ZFj-qK-UMZ" firstAttribute="leading" secondItem="zHq-1d-pIT" secondAttribute="leading" id="TPK-2V-GUQ"/>
-                                                    <constraint firstItem="MXj-Hx-E0d" firstAttribute="top" secondItem="8pV-T1-beK" secondAttribute="bottom" constant="8" id="YSL-6M-Fot"/>
-                                                    <constraint firstItem="ZFj-qK-UMZ" firstAttribute="top" secondItem="zHq-1d-pIT" secondAttribute="top" id="ZQP-qN-thM"/>
-                                                    <constraint firstItem="MXj-Hx-E0d" firstAttribute="leading" secondItem="zHq-1d-pIT" secondAttribute="leading" constant="24" id="e7v-Mc-svX"/>
-                                                    <constraint firstItem="MXj-Hx-E0d" firstAttribute="centerY" secondItem="P4X-vz-6gO" secondAttribute="centerY" id="f6J-bl-W7g"/>
-                                                    <constraint firstAttribute="trailing" secondItem="qWZ-2g-igZ" secondAttribute="trailing" id="idg-DM-BvX"/>
-                                                    <constraint firstItem="qWZ-2g-igZ" firstAttribute="leading" secondItem="zHq-1d-pIT" secondAttribute="leading" constant="24" id="j0X-N1-JNQ"/>
-                                                    <constraint firstAttribute="trailing" secondItem="8pV-T1-beK" secondAttribute="trailing" id="k0W-cu-kVY"/>
-                                                    <constraint firstAttribute="height" constant="152" id="kGK-Wb-ZLd"/>
-                                                    <constraint firstItem="zTM-YT-Krx" firstAttribute="leading" secondItem="zHq-1d-pIT" secondAttribute="leading" id="mME-Jl-E1P"/>
-                                                    <constraint firstAttribute="width" constant="232" id="oQ2-fa-nZB"/>
-                                                    <constraint firstItem="8pV-T1-beK" firstAttribute="leading" secondItem="zHq-1d-pIT" secondAttribute="leading" constant="24" id="tZ0-xS-ZBn"/>
-                                                    <constraint firstItem="8pV-T1-beK" firstAttribute="top" secondItem="ZFj-qK-UMZ" secondAttribute="bottom" id="vP6-ml-DOf"/>
-                                                    <constraint firstItem="gVZ-kb-HsJ" firstAttribute="centerY" secondItem="8pV-T1-beK" secondAttribute="centerY" id="zAO-fQ-LqA"/>
-                                                </constraints>
-                                            </customView>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="7Du-Gx-cUV">
-                                                <rect key="frame" x="112" y="305" width="232" height="112"/>
-                                                <subviews>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="8a9-fi-yVS">
-                                                        <rect key="frame" x="0.0" y="72" width="232" height="40"/>
-                                                        <subviews>
-                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Opx-Dk-V7C">
-                                                                <rect key="frame" x="-2" y="12" width="32" height="16"/>
-                                                                <textFieldCell key="cell" lineBreakMode="clipping" title="Font" id="c6n-e7-5Pq">
-                                                                    <font key="font" usesAppearanceFont="YES"/>
-                                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                                                </textFieldCell>
-                                                            </textField>
-                                                        </subviews>
-                                                        <constraints>
-                                                            <constraint firstItem="Opx-Dk-V7C" firstAttribute="centerY" secondItem="8a9-fi-yVS" secondAttribute="centerY" id="fPC-yQ-kzj"/>
-                                                            <constraint firstItem="Opx-Dk-V7C" firstAttribute="leading" secondItem="8a9-fi-yVS" secondAttribute="leading" id="trm-Va-MvZ"/>
-                                                            <constraint firstAttribute="height" constant="40" id="vK5-8Q-yAg"/>
-                                                        </constraints>
-                                                    </customView>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="GC0-0w-bZt" customClass="ComponentSelect" customModule="KMComponentLibrary">
-                                                        <rect key="frame" x="0.0" y="40" width="232" height="32"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="32" id="Vxv-sd-DI7"/>
-                                                        </constraints>
-                                                    </customView>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="E0y-hm-8yw" customClass="ComponentSelect" customModule="KMComponentLibrary">
-                                                        <rect key="frame" x="0.0" y="0.0" width="232" height="32"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="32" id="KtO-3W-eL3"/>
-                                                        </constraints>
-                                                    </customView>
-                                                </subviews>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" constant="232" id="7Yu-0L-y6W"/>
-                                                    <constraint firstAttribute="height" constant="112" id="CZg-0a-N0l"/>
-                                                    <constraint firstItem="GC0-0w-bZt" firstAttribute="leading" secondItem="7Du-Gx-cUV" secondAttribute="leading" id="GbE-6Z-SAy"/>
-                                                    <constraint firstAttribute="trailing" secondItem="8a9-fi-yVS" secondAttribute="trailing" id="Jd6-az-Nog"/>
-                                                    <constraint firstItem="GC0-0w-bZt" firstAttribute="top" secondItem="8a9-fi-yVS" secondAttribute="bottom" id="Lk8-wp-BjL"/>
-                                                    <constraint firstItem="8a9-fi-yVS" firstAttribute="top" secondItem="7Du-Gx-cUV" secondAttribute="top" id="e7M-rx-SoN"/>
-                                                    <constraint firstItem="E0y-hm-8yw" firstAttribute="top" secondItem="GC0-0w-bZt" secondAttribute="bottom" constant="8" id="lHC-hO-UxD"/>
-                                                    <constraint firstAttribute="trailing" secondItem="GC0-0w-bZt" secondAttribute="trailing" id="lvE-Jn-rwl"/>
-                                                    <constraint firstItem="8a9-fi-yVS" firstAttribute="leading" secondItem="7Du-Gx-cUV" secondAttribute="leading" id="thM-pQ-s5G"/>
-                                                    <constraint firstItem="E0y-hm-8yw" firstAttribute="leading" secondItem="7Du-Gx-cUV" secondAttribute="leading" id="tsk-Vi-FaY"/>
-                                                    <constraint firstAttribute="trailing" secondItem="E0y-hm-8yw" secondAttribute="trailing" id="vRj-TN-YGE"/>
-                                                </constraints>
-                                            </customView>
-                                        </subviews>
-                                        <constraints>
-                                            <constraint firstItem="zHq-1d-pIT" firstAttribute="centerX" secondItem="VRY-mS-J4b" secondAttribute="centerX" id="1vO-8P-bxX"/>
-                                            <constraint firstItem="7Du-Gx-cUV" firstAttribute="top" secondItem="zHq-1d-pIT" secondAttribute="bottom" constant="16" id="Es0-hK-NiR"/>
-                                            <constraint firstItem="zHq-1d-pIT" firstAttribute="top" secondItem="VRY-mS-J4b" secondAttribute="top" id="nMF-2h-Bfd"/>
-                                            <constraint firstItem="7Du-Gx-cUV" firstAttribute="centerX" secondItem="VRY-mS-J4b" secondAttribute="centerX" id="tlx-ML-sKr"/>
-                                        </constraints>
-                                    </view>
-                                    <color key="fillColor" name="Color"/>
-                                </box>
                                 <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ENr-ra-5Yf">
-                                    <rect key="frame" x="0.0" y="0.0" width="455" height="585"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="455" height="641"/>
                                     <view key="contentView" id="oYj-fd-oRi">
-                                        <rect key="frame" x="0.0" y="0.0" width="455" height="585"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="455" height="641"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="0ln-f7-yDc">
-                                                <rect key="frame" x="112" y="513" width="232" height="72"/>
+                                                <rect key="frame" x="112" y="569" width="232" height="72"/>
                                                 <subviews>
                                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="6Ae-VL-Sm6">
                                                         <rect key="frame" x="0.0" y="32" width="232" height="40"/>
@@ -236,7 +75,7 @@
                                                 </constraints>
                                             </customView>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="Iwd-9l-q8m">
-                                                <rect key="frame" x="112" y="425" width="232" height="72"/>
+                                                <rect key="frame" x="112" y="481" width="232" height="72"/>
                                                 <subviews>
                                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="FCE-uL-5l7">
                                                         <rect key="frame" x="0.0" y="32" width="232" height="40"/>
@@ -286,22 +125,15 @@
                             <constraints>
                                 <constraint firstItem="ENr-ra-5Yf" firstAttribute="leading" secondItem="M4M-dG-Pye" secondAttribute="leading" id="4Vd-CE-Bhb"/>
                                 <constraint firstAttribute="bottom" secondItem="ENr-ra-5Yf" secondAttribute="bottom" id="DL6-GH-Jh5"/>
-                                <constraint firstAttribute="trailing" secondItem="aFh-c7-2au" secondAttribute="trailing" id="M8U-PL-vGq"/>
-                                <constraint firstItem="aFh-c7-2au" firstAttribute="top" secondItem="M4M-dG-Pye" secondAttribute="top" id="VQU-ca-AkR"/>
                                 <constraint firstAttribute="trailing" secondItem="ENr-ra-5Yf" secondAttribute="trailing" id="XnK-mX-7Ap"/>
-                                <constraint firstItem="aFh-c7-2au" firstAttribute="leading" secondItem="M4M-dG-Pye" secondAttribute="leading" id="cZx-vC-RMI"/>
-                                <constraint firstAttribute="bottom" secondItem="aFh-c7-2au" secondAttribute="bottom" id="yvm-hI-J9h"/>
                                 <constraint firstItem="ENr-ra-5Yf" firstAttribute="top" secondItem="M4M-dG-Pye" secondAttribute="top" id="zGd-4A-OAX"/>
                             </constraints>
                         </customView>
                     </subviews>
                     <constraints>
                         <constraint firstItem="M4M-dG-Pye" firstAttribute="leading" secondItem="QF2-R8-FkN" secondAttribute="leading" id="74H-6D-AwR"/>
-                        <constraint firstItem="M4M-dG-Pye" firstAttribute="top" secondItem="ouE-xB-2tM" secondAttribute="bottom" id="VMS-2V-NfS"/>
                         <constraint firstAttribute="trailing" secondItem="M4M-dG-Pye" secondAttribute="trailing" id="cnZ-3g-UgW"/>
-                        <constraint firstItem="ouE-xB-2tM" firstAttribute="leading" secondItem="QF2-R8-FkN" secondAttribute="leading" id="dX5-Cz-3yf"/>
-                        <constraint firstItem="ouE-xB-2tM" firstAttribute="top" secondItem="QF2-R8-FkN" secondAttribute="top" id="o6T-f9-dsB"/>
-                        <constraint firstAttribute="trailing" secondItem="ouE-xB-2tM" secondAttribute="trailing" id="pMc-lS-Vhb"/>
+                        <constraint firstItem="M4M-dG-Pye" firstAttribute="top" secondItem="QF2-R8-FkN" secondAttribute="top" id="jib-xI-kRU"/>
                         <constraint firstAttribute="bottom" secondItem="M4M-dG-Pye" secondAttribute="bottom" id="plk-g6-AQf"/>
                     </constraints>
                 </customView>
@@ -316,9 +148,6 @@
         </customView>
     </objects>
     <resources>
-        <image name="color_border" width="16" height="16"/>
-        <image name="color_fill" width="16" height="16"/>
-        <image name="textbox_text" width="16" height="16"/>
         <namedColor name="Color">
             <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
         </namedColor>

+ 4 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/SideBar/KMPDFSideBarController.swift

@@ -182,6 +182,10 @@ class KMPDFSideBarController: NSViewController {
         pageTurnerView.reloadData()
     }
     
+    public func beginEditing() {
+        pageTurnerView.beginEditing()
+    }
+    
     //MARK: - PageTurner Menu
     func showPageTurnMenuWithPoint(_ point: CGPoint) {
         if (groupView?.superview) != nil {