Jelajahi Sumber

Merge branch 'develop' of git.kdan.cc:Mac_PDF/PDF_Office into develop

tangchao 1 tahun lalu
induk
melakukan
d238ef5b56

+ 0 - 16
PDF Office/PDF Office.xcodeproj/project.pbxproj

@@ -812,12 +812,6 @@
 		9F72D20B2994BDAF00DCACF1 /* KMNotificationVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F72D2072994BDAF00DCACF1 /* KMNotificationVC.xib */; };
 		9F72D20C2994BDAF00DCACF1 /* KMNotificationVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F72D2072994BDAF00DCACF1 /* KMNotificationVC.xib */; };
 		9F72D20D2994BDAF00DCACF1 /* KMNotificationVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F72D2072994BDAF00DCACF1 /* KMNotificationVC.xib */; };
-		9F7610912988EB4200C344DD /* KMRadioButtonVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F76108F2988EB4200C344DD /* KMRadioButtonVC.swift */; };
-		9F7610922988EB4200C344DD /* KMRadioButtonVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F76108F2988EB4200C344DD /* KMRadioButtonVC.swift */; };
-		9F7610932988EB4200C344DD /* KMRadioButtonVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F76108F2988EB4200C344DD /* KMRadioButtonVC.swift */; };
-		9F7610942988EB4200C344DD /* KMRadioButtonVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F7610902988EB4200C344DD /* KMRadioButtonVC.xib */; };
-		9F7610952988EB4200C344DD /* KMRadioButtonVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F7610902988EB4200C344DD /* KMRadioButtonVC.xib */; };
-		9F7610962988EB4200C344DD /* KMRadioButtonVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9F7610902988EB4200C344DD /* KMRadioButtonVC.xib */; };
 		9F78EFBB28F7C1CC001E66F4 /* KMHomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F78EFB928F7C1CC001E66F4 /* KMHomeViewController.swift */; };
 		9F78EFBC28F7C1CC001E66F4 /* KMHomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F78EFB928F7C1CC001E66F4 /* KMHomeViewController.swift */; };
 		9F78EFBD28F7C1CC001E66F4 /* KMHomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F78EFB928F7C1CC001E66F4 /* KMHomeViewController.swift */; };
@@ -3432,8 +3426,6 @@
 		9F72D2022994A3B800DCACF1 /* KMDesignToken+Notification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KMDesignToken+Notification.swift"; sourceTree = "<group>"; };
 		9F72D2062994BDAF00DCACF1 /* KMNotificationVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNotificationVC.swift; sourceTree = "<group>"; };
 		9F72D2072994BDAF00DCACF1 /* KMNotificationVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMNotificationVC.xib; sourceTree = "<group>"; };
-		9F76108F2988EB4200C344DD /* KMRadioButtonVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRadioButtonVC.swift; sourceTree = "<group>"; };
-		9F7610902988EB4200C344DD /* KMRadioButtonVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMRadioButtonVC.xib; sourceTree = "<group>"; };
 		9F78EFB928F7C1CC001E66F4 /* KMHomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMHomeViewController.swift; sourceTree = "<group>"; };
 		9F78EFBA28F7C1CC001E66F4 /* KMHomeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMHomeViewController.xib; sourceTree = "<group>"; };
 		9F78EFC128F7E395001E66F4 /* KMHomeViewController+Action.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KMHomeViewController+Action.swift"; sourceTree = "<group>"; };
@@ -5210,8 +5202,6 @@
 				9FA693A72987C0590055488A /* KMStepperView.xib */,
 				9F5664852988B16F00020985 /* KMTextfieldVC.swift */,
 				9F5664862988B16F00020985 /* KMTextfieldVC.xib */,
-				9F76108F2988EB4200C344DD /* KMRadioButtonVC.swift */,
-				9F7610902988EB4200C344DD /* KMRadioButtonVC.xib */,
 				9F080B12298CFDB300FC27DA /* KMTextImageButtonVC.swift */,
 				9F080B13298CFDB300FC27DA /* KMTextImageButtonVC.xib */,
 			);
@@ -8425,7 +8415,6 @@
 				F3A9DC81294309D80074E5D2 /* CPDFListEditAnnotationViewController.xib in Resources */,
 				AD0FA50629A8E61B00EDEB50 /* KMLightMemberAlertView.xib in Resources */,
 				89E4E7852967BF5A002DBA6F /* KMCustomizeStampViewController.xib in Resources */,
-				9F7610942988EB4200C344DD /* KMRadioButtonVC.xib in Resources */,
 				F359917B292B7B8A000D25DE /* InitialUserDefaults.plist in Resources */,
 				BB8F455A295AA1270037EA22 /* KMHeaderFooterPropertyInfoController.xib in Resources */,
 				AD8810AC29A8463600178CA1 /* KMAccountInfoWindowController.xib in Resources */,
@@ -8764,7 +8753,6 @@
 				9F0CB48B29683DC400007028 /* KMPropertiesPanelPresetColorSubVC.xib in Resources */,
 				BB147069299E32AB00784A6A /* CDoucumnetAIResource.bundle in Resources */,
 				89D2D2FF294C806000BFF5FE /* KMPDFThumbnailItem.xib in Resources */,
-				9F7610952988EB4200C344DD /* KMRadioButtonVC.xib in Resources */,
 				89E4E70C2963D62B002DBA6F /* KMAnnotationFontWindowController.xib in Resources */,
 				ADC25DFD2923BA710080A3F6 /* KMImageToPDFWindowController.xib in Resources */,
 				8931684D296E436B0073EA59 /* KMSignatureWindowController.xib in Resources */,
@@ -8947,7 +8935,6 @@
 				89E4E73A2964148E002DBA6F /* KMAnnotationPropertiesViewController.xib in Resources */,
 				BB003033298D315E002DD1A0 /* KMPreferenceMarkupController.xib in Resources */,
 				9F78EFC028F7C1CC001E66F4 /* KMHomeViewController.xib in Resources */,
-				9F7610962988EB4200C344DD /* KMRadioButtonVC.xib in Resources */,
 				9F8539E52947126000DF644E /* KMChromiumToolbar.xib in Resources */,
 				9F0CB4742967E63100007028 /* KMPropertiesPanelNameSubVC.xib in Resources */,
 				89E4E6E82963CD82002DBA6F /* KMGeneralAnnotationViewController.xib in Resources */,
@@ -9696,7 +9683,6 @@
 				AD88109629A78ADC00178CA1 /* KMVerificationCodeView.swift in Sources */,
 				ADCB98F629274B6B00B51A03 /* KMBatchProcessingTableView.swift in Sources */,
 				BBDEFDD729A8AB0700A90A82 /* PDFPage_SKExtensions.m in Sources */,
-				9F7610912988EB4200C344DD /* KMRadioButtonVC.swift in Sources */,
 				ADE3C1F929A5C42300793B13 /* KMLightMemberUserInfo.swift in Sources */,
 				BB88E43B294023CB002B3655 /* KMDocumentModel.swift in Sources */,
 				BBC3482929559B22008D2CD1 /* KMBackgroundListCell.swift in Sources */,
@@ -10415,7 +10401,6 @@
 				AD88109729A78ADC00178CA1 /* KMVerificationCodeView.swift in Sources */,
 				BBC347FE295448DE008D2CD1 /* KMWatermarkTemplateModel.swift in Sources */,
 				BBDEFDD829A8AB0700A90A82 /* PDFPage_SKExtensions.m in Sources */,
-				9F7610922988EB4200C344DD /* KMRadioButtonVC.swift in Sources */,
 				ADE3C1FA29A5C42300793B13 /* KMLightMemberUserInfo.swift in Sources */,
 				BB6DD81D29348F31001F0544 /* KMSecureTextFiled.swift in Sources */,
 				BBC3482A29559B22008D2CD1 /* KMBackgroundListCell.swift in Sources */,
@@ -10786,7 +10771,6 @@
 				AD8810AB29A8463600178CA1 /* KMAccountInfoWindowController.swift in Sources */,
 				BBC3480E29558DC1008D2CD1 /* KMBackgroundController.swift in Sources */,
 				9F0CB4F7298655D500007028 /* KMDesignToken+Fill.swift in Sources */,
-				9F7610932988EB4200C344DD /* KMRadioButtonVC.swift in Sources */,
 				BB49ED1F293F4FB200C82CA2 /* KMConvertPPTsSettingView.swift in Sources */,
 				BB14703D299DC0D200784A6A /* OIDErrorUtilities.m in Sources */,
 				BB7F7BF929AA469F00A3E4E7 /* KMSigntureViewItem.m in Sources */,

+ 0 - 62
PDF Office/PDF Office/Class/Home/View/KMRadioButtonVC.swift

@@ -1,62 +0,0 @@
-//
-//  KMRadioButtonVC.swift
-//  PDF Office
-//
-//  Created by wanjun on 2023/1/31.
-//
-
-import Cocoa
-
-class KMRadioButtonVC: NSViewController {
-    
-    @IBOutlet weak var mainBox: NSBox!
-    @IBOutlet weak var imageView: NSImageView!
-    @IBOutlet weak var label: NSTextField!
-    @IBOutlet weak var button: NSButton!
-    
-    @IBOutlet weak var mainBoxHeight: NSLayoutConstraint!
-    @IBOutlet weak var mainBoxWidth: NSLayoutConstraint!
-    @IBOutlet weak var radio_label_spacing: NSLayoutConstraint!
-    @IBOutlet weak var imageViewWidth: NSLayoutConstraint!
-    @IBOutlet weak var imageViewHeight: NSLayoutConstraint!
-    
-    var text: String = ""   // label 内容
-    var image: NSImage = NSImage(named: "KMRadioButtonUnSelect")! // imageView 图片
-    var textColor: NSColor = .black // label 内容颜色
-    var width = 60.0    // 宽度
-    var height = 22.0   // 高度
-    var imageWidth = 16.0   // 图片宽度
-    var imageHeight = 16.0 // 图片高度
-    var radio_label = 8.0 // imageView、label 水平间距
-    var font: NSFont = NSFont.systemFont(ofSize: 14.0)  // label 字体
-    var action: Selector?   // 点击事件
-    var target: AnyObject? // 对象目标
-    var state: Bool = false
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        // Do view setup here.
-        
-        updateUI()
-    }
-    
-    func updateUI() -> Void {
-        if state {
-            image = NSImage(named: "KMRadioButtonSelect")!
-        } else {
-            image = NSImage(named: "KMRadioButtonUnSelect")!
-        }
-        label.font = font
-        label.stringValue = text
-        label.textColor = textColor
-        imageView.image = image
-        button.action = action
-        button.target = target
-
-        mainBoxHeight.constant = height
-        mainBoxWidth.constant = width
-        radio_label_spacing.constant = radio_label
-        imageViewWidth.constant = imageWidth
-        imageViewHeight.constant = imageHeight
-    }
-}

+ 0 - 89
PDF Office/PDF Office/Class/Home/View/KMRadioButtonVC.xib

@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
-    <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMRadioButtonVC" customModule="PDF_Office" customModuleProvider="target">
-            <connections>
-                <outlet property="button" destination="5Wj-lB-wZR" id="FNq-uH-tSu"/>
-                <outlet property="imageView" destination="EpT-56-NJD" id="4pl-vG-2yk"/>
-                <outlet property="imageViewHeight" destination="9bp-WC-gMT" id="5vW-Bz-VIf"/>
-                <outlet property="imageViewWidth" destination="51D-qC-yFj" id="Nuz-3a-eip"/>
-                <outlet property="label" destination="7OB-oP-mEB" id="dhV-ga-mBX"/>
-                <outlet property="mainBox" destination="IMy-Wr-92N" id="ha5-v6-DQB"/>
-                <outlet property="mainBoxHeight" destination="ciG-X3-Hjz" id="yFF-oe-cpi"/>
-                <outlet property="mainBoxWidth" destination="1iA-O1-7H4" id="9lJ-QB-lgr"/>
-                <outlet property="radio_label_spacing" destination="x6v-xR-xH6" id="aLS-Ql-85e"/>
-                <outlet property="view" destination="23H-kw-UfP" id="p8j-om-sWh"/>
-            </connections>
-        </customObject>
-        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <customView id="23H-kw-UfP">
-            <rect key="frame" x="0.0" y="0.0" width="60" height="22"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <subviews>
-                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="IMy-Wr-92N">
-                    <rect key="frame" x="0.0" y="0.0" width="60" height="22"/>
-                    <view key="contentView" id="FdY-aq-AHq">
-                        <rect key="frame" x="0.0" y="0.0" width="60" height="22"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="EpT-56-NJD">
-                                <rect key="frame" x="0.0" y="3" width="16" height="16"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="16" id="51D-qC-yFj"/>
-                                    <constraint firstAttribute="height" constant="16" id="9bp-WC-gMT"/>
-                                </constraints>
-                                <imageCell key="cell" alignment="left" imageScaling="proportionallyDown" image="KMRadioButtonUnSelect" id="nao-P8-qHL"/>
-                            </imageView>
-                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7OB-oP-mEB">
-                                <rect key="frame" x="22" y="3" width="32" height="16"/>
-                                <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="O0d-CY-IQ5">
-                                    <font key="font" metaFont="system"/>
-                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
-                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                                </textFieldCell>
-                            </textField>
-                        </subviews>
-                        <constraints>
-                            <constraint firstItem="7OB-oP-mEB" firstAttribute="centerY" secondItem="EpT-56-NJD" secondAttribute="centerY" id="0an-Ew-tsl"/>
-                            <constraint firstItem="EpT-56-NJD" firstAttribute="leading" secondItem="FdY-aq-AHq" secondAttribute="leading" id="CX7-Mm-nBd"/>
-                            <constraint firstItem="EpT-56-NJD" firstAttribute="centerY" secondItem="FdY-aq-AHq" secondAttribute="centerY" id="bja-3b-9iz"/>
-                            <constraint firstAttribute="trailing" secondItem="7OB-oP-mEB" secondAttribute="trailing" constant="8" id="rPH-Hh-XGI"/>
-                            <constraint firstItem="7OB-oP-mEB" firstAttribute="leading" secondItem="EpT-56-NJD" secondAttribute="trailing" constant="8" id="x6v-xR-xH6"/>
-                        </constraints>
-                    </view>
-                    <constraints>
-                        <constraint firstAttribute="width" constant="60" id="1iA-O1-7H4"/>
-                        <constraint firstAttribute="height" constant="22" id="ciG-X3-Hjz"/>
-                    </constraints>
-                </box>
-                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5Wj-lB-wZR">
-                    <rect key="frame" x="0.0" y="0.0" width="60" height="22"/>
-                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="Psa-7E-YOO">
-                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                        <font key="font" metaFont="system"/>
-                    </buttonCell>
-                </button>
-            </subviews>
-            <constraints>
-                <constraint firstAttribute="bottom" secondItem="IMy-Wr-92N" secondAttribute="bottom" id="Vzg-YR-44Z"/>
-                <constraint firstAttribute="trailing" secondItem="5Wj-lB-wZR" secondAttribute="trailing" id="Zbf-eU-UcB"/>
-                <constraint firstAttribute="bottom" secondItem="5Wj-lB-wZR" secondAttribute="bottom" id="cUn-1c-QEt"/>
-                <constraint firstItem="5Wj-lB-wZR" firstAttribute="top" secondItem="23H-kw-UfP" secondAttribute="top" id="iMH-20-mJa"/>
-                <constraint firstItem="IMy-Wr-92N" firstAttribute="leading" secondItem="23H-kw-UfP" secondAttribute="leading" id="lDb-F9-OGO"/>
-                <constraint firstItem="5Wj-lB-wZR" firstAttribute="leading" secondItem="23H-kw-UfP" secondAttribute="leading" id="lzy-Hv-ZvC"/>
-                <constraint firstItem="IMy-Wr-92N" firstAttribute="top" secondItem="23H-kw-UfP" secondAttribute="top" id="sYf-o8-eKp"/>
-                <constraint firstAttribute="trailing" secondItem="IMy-Wr-92N" secondAttribute="trailing" id="zYz-Zy-D9w"/>
-            </constraints>
-            <point key="canvasLocation" x="34" y="139"/>
-        </customView>
-    </objects>
-    <resources>
-        <image name="KMRadioButtonUnSelect" width="16" height="16"/>
-    </resources>
-</document>

+ 6 - 0
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignBase.swift

@@ -78,6 +78,12 @@ class KMDesignBase: NSViewController {
     var _isHidden: Bool = false // 是否隐藏
     var editable: Bool = false //是否允许编辑
 
+    var _image: NSImage = NSImage(named: "KMFileIcon")!
+    var _image_hov: NSImage?
+    var _image_act: NSImage?
+    var _image_disabled: NSImage?
+    var _image_sel: NSImage?
+
     var buttonType: DesignButtonType = .Text
 
     override func viewDidLoad() {

+ 114 - 28
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignButton.swift

@@ -12,6 +12,7 @@ import Cocoa
     case Image
     case TextImage
     case PopUpButton
+    case RadioButton
 }
 
 class KMDesignButton: KMDesignBase {
@@ -58,19 +59,28 @@ class KMDesignButton: KMDesignBase {
     @IBOutlet weak var textImage_rightImageWidth: NSLayoutConstraint!
     @IBOutlet weak var textImage_rightItem_spacing: NSLayoutConstraint!
     
+    @IBOutlet weak var radioButton_mainBox: NSBox!
+    @IBOutlet weak var radioButton_imageView: NSImageView!
+    @IBOutlet weak var radioButton_label: NSTextField!
+    
+    @IBOutlet weak var radio_label_spacing: NSLayoutConstraint!
+    @IBOutlet weak var radio_imageViewWidth: NSLayoutConstraint!
+    @IBOutlet weak var radio_imageViewHeight: NSLayoutConstraint!
+    
     @IBOutlet weak var mainBoxHeight : NSLayoutConstraint! // mainBox 高度约束
     @IBOutlet weak var mainBoxWidth : NSLayoutConstraint! // mainBox 宽度约束
     var height: Float = 32.0    // 高度
     var width: Float = 80.0    // 宽度
     
-    var _image: NSImage = NSImage(named: "KMFileIcon")!
-    var image_hov: NSImage = NSImage(named: "KMFileIcon")!
-    var image_act: NSImage = NSImage(named: "KMFileIcon")!
-    var image_disabled: NSImage = NSImage(named: "KMFileIcon")!
     var textImage_imageWidth: Float = 20.0// 图片宽度
     var textImage_imageHeight: Float = 20.0// 图片高度
     var textImage_paddingSpacing: Float = 16.0
     var textImage_itemSpacing: Float = 8.0
+    
+//    var image: NSImage = NSImage(named: "KMRadioButtonUnSelect")! // imageView 图片
+    var radio_imageWidth = 16.0   // 图片宽度
+    var radio_imageHeight = 16.0 // 图片高度
+    var radio_label = 8.0 // imageView、label 水平间距
 
     // button 通用属性
     var textImage_type: KMTextImageButtonType = .Left
@@ -97,6 +107,8 @@ class KMDesignButton: KMDesignBase {
             mainBox.contentView = textImageButtonBox
         } else if (buttonType == .PopUpButton) {
             mainBox.contentView = textImageButtonBox
+        } else if (buttonType == .RadioButton) {
+            mainBox.contentView = radioButton_mainBox
         }
         
         textButtonBox.move =  { [self](mouseEntered: Bool) -> Void in
@@ -204,19 +216,59 @@ class KMDesignButton: KMDesignBase {
         set {
             _image = newValue
             
-            if (buttonType == .Image) {
-                imageView1.image = _image
-            } else if (buttonType == .TextImage) {
-                if textImage_type == .Up {
-                    textImage_upImageView.image = image
-                } else if textImage_type == .Left {
-                    textImage_leftImageView.image = image
-                } else if textImage_type == .Down {
-                    textImage_downImageView.image = image
-                } else if textImage_type == .Right {
-                    textImage_rightImageView.image = image
-                }
+
+        }
+    }
+    
+    var image_hov: NSImage {
+        get {
+            if _image_hov == nil {
+                return _image
+            }
+            return _image_hov!
+        }
+        set {
+            _image_hov = newValue
+            updateUI()
+        }
+    }
+    
+    var image_act: NSImage {
+        get {
+            if _image_act == nil {
+                return _image
+            }
+            return _image_act!
+        }
+        set {
+            _image_act = newValue
+            updateUI()
+        }
+    }
+    
+    var image_disabled: NSImage {
+        get {
+            if _image_disabled == nil {
+                return _image
             }
+            return _image_disabled!
+        }
+        set {
+            _image_disabled = newValue
+            updateUI()
+        }
+    }
+    
+    var image_sel: NSImage {
+        get {
+            if (_image_sel == nil) {
+                _image_sel = image
+            }
+            return _image_sel!
+        }
+        set {
+            _image_sel = newValue
+            updateUI()
         }
     }
     
@@ -277,21 +329,25 @@ class KMDesignButton: KMDesignBase {
                 imageButtonBox.borderWidth = CGFloat(borderWidth)
                 imageButtonBox.borderColor = borderColor
                 imageButtonBox.cornerRadius = CGFloat(cornerRadius)
+                imageView1.image = image
             } else if (state == .Hov) {
                 imageButtonBox.fillColor = background_hov
                 imageButtonBox.borderWidth = CGFloat(borderWidth_hov)
                 imageButtonBox.borderColor = borderColor_hov
                 imageButtonBox.cornerRadius = CGFloat(cornerRadius_hov)
+                imageView1.image = image_hov
             } else if (state == .Act) {
                 imageButtonBox.fillColor = background_act
                 imageButtonBox.borderWidth = CGFloat(borderWidth_act)
                 imageButtonBox.borderColor = borderColor_act
                 imageButtonBox.cornerRadius = CGFloat(cornerRadius_act)
+                imageView1.image = image_act
             } else if (state == .Disabled) {
                 imageButtonBox.fillColor = background_disabled
                 imageButtonBox.borderWidth = CGFloat(borderWidth_disabled)
                 imageButtonBox.borderColor = borderColor_disabled
                 imageButtonBox.cornerRadius = CGFloat(cornerRadius_disabled)
+                imageView1.image = image_disabled
             }
         }  else if (buttonType == .TextImage) {
             let paragraphStyle = NSMutableParagraphStyle()
@@ -329,6 +385,7 @@ class KMDesignButton: KMDesignBase {
                     textImage_rightImageView.image = image
                     textImage_rightTextfield.textColor = textColor
                 }
+                
                 textImageButtonBox.borderWidth = CGFloat(borderWidth)
                 textImageButtonBox.cornerRadius = CGFloat(cornerRadius)
                 paragraphStyle.lineSpacing = lineHeight
@@ -336,16 +393,16 @@ class KMDesignButton: KMDesignBase {
                 textImageButtonBox.fillColor = background_hov
                 textImageButtonBox.borderColor = borderColor_hov
                 if textImage_type == .Up {
-                    textImage_upImageView.image = image
+                    textImage_upImageView.image = image_hov
                     textImage_upTextfield.textColor = textColor_hov
                 } else if textImage_type == .Left {
-                    textImage_leftImageView.image = image
+                    textImage_leftImageView.image = image_hov
                     textImage_leftTextfield.textColor = textColor_hov
                 } else if textImage_type == .Down {
-                    textImage_downImageView.image = image
+                    textImage_downImageView.image = image_hov
                     textImage_downTextfield.textColor = textColor_hov
                 } else if textImage_type == .Right {
-                    textImage_rightImageView.image = image
+                    textImage_rightImageView.image = image_hov
                     textImage_rightTextfield.textColor = textColor_hov
                 }
                 textImageButtonBox.borderWidth = CGFloat(borderWidth_hov)
@@ -355,16 +412,16 @@ class KMDesignButton: KMDesignBase {
                 textImageButtonBox.fillColor = background_act
                 textImageButtonBox.borderColor = borderColor_act
                 if textImage_type == .Up {
-                    textImage_upImageView.image = image
+                    textImage_upImageView.image = image_act
                     textImage_upTextfield.textColor = textColor_act
                 } else if textImage_type == .Left {
-                    textImage_leftImageView.image = image
+                    textImage_leftImageView.image = image_act
                     textImage_leftTextfield.textColor = textColor_act
                 } else if textImage_type == .Down {
-                    textImage_downImageView.image = image
+                    textImage_downImageView.image = image_act
                     textImage_downTextfield.textColor = textColor_act
                 } else if textImage_type == .Right {
-                    textImage_rightImageView.image = image
+                    textImage_rightImageView.image = image_act
                     textImage_rightTextfield.textColor = textColor_act
                 }
                 textImageButtonBox.borderWidth = CGFloat(borderWidth_act)
@@ -374,16 +431,16 @@ class KMDesignButton: KMDesignBase {
                 textImageButtonBox.fillColor = background_disabled
                 textImageButtonBox.borderColor = borderColor_disabled
                 if textImage_type == .Up {
-                    textImage_upImageView.image = image
+                    textImage_upImageView.image = image_disabled
                     textImage_upTextfield.textColor = textColor_disabled
                 } else if textImage_type == .Left {
-                    textImage_leftImageView.image = image
+                    textImage_leftImageView.image = image_disabled
                     textImage_leftTextfield.textColor = textColor_disabled
                 } else if textImage_type == .Down {
-                    textImage_downImageView.image = image
+                    textImage_downImageView.image = image_disabled
                     textImage_downTextfield.textColor = textColor_disabled
                 } else if textImage_type == .Right {
-                    textImage_rightImageView.image = image
+                    textImage_rightImageView.image = image_disabled
                     textImage_rightTextfield.textColor = textColor_disabled
                 }
                 textImageButtonBox.borderWidth = CGFloat(borderWidth_disabled)
@@ -417,6 +474,35 @@ class KMDesignButton: KMDesignBase {
                 textImage_rightPadding_spacing.constant = CGFloat(textImage_paddingSpacing)
                 textImage_rightItem_spacing.constant = CGFloat(textImage_itemSpacing)
             }
+        } else if (buttonType == .RadioButton) {
+            let paragraphStyle = NSMutableParagraphStyle()
+            if (state == .Norm) {
+                radioButton_imageView.image = image
+                radioButton_label.font = font
+                radioButton_label.textColor = textColor
+                paragraphStyle.lineSpacing = lineHeight
+            } else if (state == .Hov) {
+                radioButton_imageView.image = image_hov
+                radioButton_label.font = font_hov
+                radioButton_label.textColor = textColor_hov
+                paragraphStyle.lineSpacing = lineHeight_hov
+            } else if (state == .Sel) {
+                radioButton_imageView.image = image_sel
+                radioButton_label.font = font_sel
+                radioButton_label.textColor = textColor_sel
+                paragraphStyle.lineSpacing = lineHeight_sel
+            } else if (state == .Disabled) {
+                radioButton_imageView.image = image_disabled
+                radioButton_label.font = font_disabled
+                radioButton_label.textColor = textColor_disabled
+                paragraphStyle.lineSpacing = lineHeight_disabled
+            }
+            radioButton_label.attributedStringValue = NSAttributedString(string: stringValue, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
+
+
+            radio_label_spacing.constant = radio_label
+            radio_imageViewWidth.constant = radio_imageWidth
+            radio_imageViewHeight.constant = radio_imageHeight
         }
     }
 }

+ 40 - 0
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignButton.xib

@@ -12,6 +12,12 @@
                 <outlet property="imageButtonBox" destination="cvM-Bd-5JV" id="jfg-8m-FSC"/>
                 <outlet property="imageView1" destination="PyX-eX-4qD" id="aq1-iY-X15"/>
                 <outlet property="mainBox" destination="ReP-nu-f1v" id="eSy-sx-51e"/>
+                <outlet property="radioButton_imageView" destination="Xvr-XE-bKd" id="f5Y-gh-OII"/>
+                <outlet property="radioButton_label" destination="Rcq-Ab-TwC" id="Gvy-2D-nT7"/>
+                <outlet property="radioButton_mainBox" destination="Dan-L1-vKC" id="lGB-mX-MUM"/>
+                <outlet property="radio_imageViewHeight" destination="GDa-Vi-IxC" id="e1A-0R-CQM"/>
+                <outlet property="radio_imageViewWidth" destination="p0A-EI-qqN" id="CqK-ze-H9U"/>
+                <outlet property="radio_label_spacing" destination="qCg-a4-2cP" id="3mS-4b-won"/>
                 <outlet property="textButtonBox" destination="Y8j-9c-Qz0" id="4Aw-MR-dup"/>
                 <outlet property="textButtonlabel" destination="6nN-bR-GkZ" id="hOh-sx-qqn"/>
                 <outlet property="textImageButtonBox" destination="Xrh-vh-9yg" id="tRq-Yz-Tq0"/>
@@ -249,8 +255,42 @@
             </constraints>
             <point key="canvasLocation" x="554" y="439"/>
         </customView>
+        <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Dan-L1-vKC">
+            <rect key="frame" x="0.0" y="0.0" width="65" height="22"/>
+            <view key="contentView" id="tPq-1S-9CW">
+                <rect key="frame" x="0.0" y="0.0" width="65" height="22"/>
+                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                <subviews>
+                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Xvr-XE-bKd">
+                        <rect key="frame" x="0.0" y="3" width="16" height="16"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="16" id="GDa-Vi-IxC"/>
+                            <constraint firstAttribute="width" constant="16" id="p0A-EI-qqN"/>
+                        </constraints>
+                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMRadioButtonUnSelect" id="b2G-WY-aoL"/>
+                    </imageView>
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Rcq-Ab-TwC">
+                        <rect key="frame" x="22" y="3" width="37" height="16"/>
+                        <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="laz-qX-1sa">
+                            <font key="font" metaFont="system"/>
+                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="Xvr-XE-bKd" firstAttribute="centerY" secondItem="tPq-1S-9CW" secondAttribute="centerY" id="Uln-xI-ZfP"/>
+                    <constraint firstItem="Xvr-XE-bKd" firstAttribute="leading" secondItem="tPq-1S-9CW" secondAttribute="leading" id="W3n-GX-cgd"/>
+                    <constraint firstItem="Rcq-Ab-TwC" firstAttribute="centerY" secondItem="Xvr-XE-bKd" secondAttribute="centerY" id="Wao-LY-AqA"/>
+                    <constraint firstAttribute="trailing" secondItem="Rcq-Ab-TwC" secondAttribute="trailing" constant="8" id="kBf-TQ-ULf"/>
+                    <constraint firstItem="Rcq-Ab-TwC" firstAttribute="leading" secondItem="Xvr-XE-bKd" secondAttribute="trailing" constant="8" id="qCg-a4-2cP"/>
+                </constraints>
+            </view>
+            <point key="canvasLocation" x="-117" y="696"/>
+        </box>
     </objects>
     <resources>
+        <image name="KMRadioButtonUnSelect" width="16" height="16"/>
         <image name="btn_radio_sel_on" width="16" height="16"/>
         <image name="imageCell:0uc-b0-z8j:image" width="16" height="16">
             <mutableData key="keyedArchiveRepresentation">

+ 1 - 4
PDF Office/PDF Office/Class/Home/ViewController/customViewController/KMDesignPropertySelector.swift

@@ -30,9 +30,6 @@ class KMDesignPropertySelector: KMDesignBase {
     var propertySelectorType: PropertySelectorType = .Icon_Btn
     
     var _fillColor: NSColor = .clear
-    var _image: NSImage?
-    var _image_hov: NSImage?
-    var _image_sel: NSImage?
     
     init(withType type: PropertySelectorType) {
         super.init(nibName: "KMDesignPropertySelector", bundle: nil)
@@ -104,7 +101,7 @@ class KMDesignPropertySelector: KMDesignBase {
             if (_image == nil) {
                 _image = NSImage(named: "KMFileIcon")!
             }
-            return _image!
+            return _image
         }
         set {
             _image = newValue

+ 18 - 18
PDF Office/PDF Office/Class/Home/WindowController/KMURLToPDFWindowController.swift

@@ -25,9 +25,9 @@ class KMURLToPDFWindowController: NSWindowController {
     @IBOutlet weak var cancelView: NSView!
     @IBOutlet weak var openView: NSView!
     
-    var urlButtonVC: KMRadioButtonVC!
+    var urlButtonVC: KMDesignButton!
     var urlTextfieldVC: KMTextfieldVC!
-    var fileButtonVC: KMRadioButtonVC!
+    var fileButtonVC: KMDesignButton!
     var fileTextfieldVC: KMTextfieldVC!
     var openFileVC: KMDesignButton!
     var stepperVC: KMStepperView!
@@ -42,9 +42,9 @@ class KMURLToPDFWindowController: NSWindowController {
         super.windowDidLoad()
 
         // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
-        urlButtonVC     = KMRadioButtonVC.init(nibName: "KMRadioButtonVC", bundle: nil)
+        urlButtonVC     = KMDesignButton.init(withType: .RadioButton)
         urlTextfieldVC  = KMTextfieldVC.init(nibName: "KMTextfieldVC", bundle: nil)
-        fileButtonVC    = KMRadioButtonVC.init(nibName: "KMRadioButtonVC", bundle: nil)
+        fileButtonVC    = KMDesignButton.init(withType: .RadioButton)
         fileTextfieldVC = KMTextfieldVC.init(nibName: "KMTextfieldVC", bundle: nil)
         openFileVC      = KMDesignButton.init(withType: .Image)
         stepperVC       = KMStepperView.init(nibName: "KMStepperView", bundle: nil)
@@ -70,7 +70,7 @@ class KMURLToPDFWindowController: NSWindowController {
         urlButtonVC.image = NSImage(named: "KMRadioButtonUnSelect")!
         urlButtonVC.target = self
         urlButtonVC.action = #selector(buttonChangeType)
-        urlButtonVC.state = true
+        urlButtonVC.state = .Sel
 //        let itemSpacing = KMDesignToken.shared.itemSpacing(withToken: "checkbox-radio.bg.def")
 //        urlButtonVC.radio_label = itemSpacing.stringToCGFloat()
 //        let typography = KMDesignToken.shared.typography(withToken: "checkbox-radio.mac-text.def")
@@ -143,9 +143,9 @@ class KMURLToPDFWindowController: NSWindowController {
     
     func initLocalization() {
         title.stringValue = NSLocalizedString("New From Web Page", comment: "")
-        urlButtonVC.text = NSLocalizedString("URL", comment: "")
+        urlButtonVC.stringValue = NSLocalizedString("URL", comment: "")
         urlTextfieldVC.placeholderString = NSLocalizedString("https://pdfreaderpro.com", comment: "")
-        fileButtonVC.text = NSLocalizedString("File", comment: "")
+        fileButtonVC.stringValue = NSLocalizedString("File", comment: "")
         fileTextfieldVC.placeholderString = NSLocalizedString("Select Files(.html,.webarchive)", comment: "")
         pageConfigurationLabel.stringValue = NSLocalizedString("Page Configuration", comment: "")
         pageSizeLabel.stringValue = NSLocalizedString("Page Size:", comment: "")
@@ -211,11 +211,11 @@ class KMURLToPDFWindowController: NSWindowController {
     
     @objc func buttonChangeType(_ sender: NSButton) -> Void {
         if (sender == urlButtonVC.button) {
-            if urlButtonVC.state == false {
+            if urlButtonVC.state == .Norm {
                 urlButtonVC.image = NSImage(named: "KMRadioButtonSelect")!
-                urlButtonVC.state = true
+                urlButtonVC.state = .Sel
                 fileButtonVC.image = NSImage(named: "KMRadioButtonUnSelect")!
-                fileButtonVC.state = false
+                fileButtonVC.state = .Norm
                 urlTextfieldVC.editable = true
                 urlTextfieldVC.becomeFirstResponder = true
                 fileTextfieldVC.stringValue = ""
@@ -227,11 +227,11 @@ class KMURLToPDFWindowController: NSWindowController {
                 }
             }
         } else if (sender == fileButtonVC.button) {
-            if fileButtonVC.state == false {
+            if fileButtonVC.state == .Norm {
                 urlButtonVC.image = NSImage(named: "KMRadioButtonUnSelect")!
-                urlButtonVC.state = false
+                urlButtonVC.state = .Norm
                 fileButtonVC.image = NSImage(named: "KMRadioButtonSelect")!
-                fileButtonVC.state = true
+                fileButtonVC.state = .Sel
                 urlTextfieldVC.editable = false
                 urlTextfieldVC.stringValue = ""
                 openFileVC.enabled = true
@@ -247,8 +247,8 @@ class KMURLToPDFWindowController: NSWindowController {
     }
     
     @objc func selectFileAction(_ sender: NSButton) -> Void {
-        urlButtonVC.state = false
-        fileButtonVC.state = true
+        urlButtonVC.state = .Norm
+        fileButtonVC.state = .Sel
         urlTextfieldVC.editable = false
         urlTextfieldVC.stringValue = ""
 //        openVC.enabled = false
@@ -282,7 +282,7 @@ class KMURLToPDFWindowController: NSWindowController {
 
             var url: URL
             var fileName: String = ""
-            if urlButtonVC.state {
+            if urlButtonVC.state == .Sel {
                 let urlstring = urlTextfieldVC.stringValue
                 var tUrl = URL(string: urlstring)
                 if tUrl?.scheme == nil {
@@ -398,7 +398,7 @@ extension KMURLToPDFWindowController: KMStepperViewDelegate {
     
     func km_controlTextDidChange(_ obj: KMStepperView) {
         if obj == stepperVC {
-            if (urlButtonVC.state == true) {
+            if (urlButtonVC.state == .Sel) {
                 if (urlTextfieldVC.stringValue.count > 0) {
 //                    openVC.enabled = true
                 } else {
@@ -433,7 +433,7 @@ extension KMURLToPDFWindowController: KMTextfieldVCDelegate {
     }
     
     func km_controlTextDidChange(_ obj: KMTextfieldVC) {
-        if urlButtonVC.state {
+        if urlButtonVC.state == .Sel {
             if urlTextfieldVC.stringValue.count > 0 {
                 openVC.enabled = true
                 refreshUI()

+ 12 - 2
PDF Office/PDF Office/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMFillSignShapePanel.swift

@@ -244,7 +244,12 @@ import Cocoa
     @IBAction func lineWidthSliderAction(_ sender: NSSlider) {
         let lineWidth = sender.floatValue
         
-        annotationModel.setLineWidth(CGFloat(lineWidth))
+        if annotationModel.annotationType == .signDot {
+            annotationModel.setNoteWidth(CGFloat(lineWidth))
+            annotationModel.setNoteHeight(CGFloat(lineWidth))
+        } else {
+            annotationModel.setLineWidth(CGFloat(lineWidth))
+        }
         
         refreshUI()
         updateAnnotation()
@@ -345,7 +350,12 @@ extension KMFillSignShapePanel: KMSelectPopButtonDelegate {
             }
             
             let width = self.lineWidthVC.stringValue.replacingOccurrences(of: " pt", with: "")
-            annotationModel.setLineWidth(width.stringToCGFloat())
+            if annotationModel.annotationType == .signDot {
+                annotationModel.setNoteWidth(width.stringToCGFloat())
+                annotationModel.setNoteHeight(width.stringToCGFloat())
+            } else {
+                annotationModel.setLineWidth(width.stringToCGFloat())
+            }
         } else if (self.opacityVC == obj) {
             let index = self.opacityVC.indexOfSelectedItem
             if index < 0 {

+ 15 - 8
PDF Office/PDF Office/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMFillSignTextPanel.swift

@@ -67,7 +67,7 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
     var fillCustomVC: KMDesignButton!
     var fillOpacity: KMDesignButton!
     var dateTypeVC: KMDesignSelect!
-    var showTimeVC: KMRadioButtonVC!
+    var showTimeVC: KMDesignButton!
     var opacityVC: KMDesignSelect!
 
     var fonts: [String:[String]] = [:]
@@ -100,7 +100,7 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
         fillCustomVC = KMDesignButton.init(withType: .Image)
         fillOpacity = KMDesignButton.init(withType: .Image)
         dateTypeVC = KMDesignSelect.init(withType: .PopButton)
-        showTimeVC = KMRadioButtonVC.init(nibName: "KMRadioButtonVC", bundle: nil)
+        showTimeVC = KMDesignButton.init(withType: .RadioButton)
         opacityVC = KMDesignSelect.init(withType: .PopButton)
 
         fontBox.fillColor = .clear
@@ -263,17 +263,17 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
         showTimeBox.fillColor = .clear
         showTimeBox.contentView = showTimeVC.view
         let includeTime = self.annotationModel.includeTime()
-        showTimeVC.state = includeTime ? true : false
+        showTimeVC.state = includeTime ? KMDesignTokenState.Sel : KMDesignTokenState.Norm
         showTimeVC.target = self
         showTimeVC.action = #selector(showTimeAction(_:))
-        showTimeVC.state = false
+        showTimeVC.state = .Norm
     }
     
     func initLocalization() {
         fontLabel.stringValue = NSLocalizedString("Font", comment: "")
         fillLabel.stringValue = NSLocalizedString("Fill Color", comment: "")
         dateTypeLabel.stringValue = NSLocalizedString("Date Type", comment: "")
-        showTimeVC.text = NSLocalizedString("Fill Color", comment: "")
+        showTimeVC.stringValue = NSLocalizedString("Fill Color", comment: "")
         showTimeVC.updateUI()
     }
     
@@ -298,7 +298,7 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
             } else {
                 dateTypeVC.selectItem(at: 0)
             }
-            showTimeVC.state = includeTime ? true : false
+            showTimeVC.state = includeTime ? KMDesignTokenState.Sel : KMDesignTokenState.Norm
         }
     }
     
@@ -411,8 +411,15 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
     }
     
     @IBAction func showTimeAction(_ sender: NSButton) {
-        showTimeVC.state = !showTimeVC.state
-        self.annotationModel.setIncludeTime(showTimeVC.state)
+        var state: Bool = false
+        if showTimeVC.state == .Sel {
+            showTimeVC.state = .Norm
+            state = false
+        } else {
+            showTimeVC.state = .Sel
+            state = true
+        }
+        self.annotationModel.setIncludeTime(state)
         
         refreshUI()
         updateAnnotation()