Преглед на файлове

【UI替换】编辑工具 - 添加背景 按钮事件实现

lizhe преди 1 година
родител
ревизия
d6743e933f

+ 6 - 0
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/New/View/KMHeaderFooterView.xib

@@ -660,6 +660,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="296" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -688,6 +689,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="172" height="38"/>
                                         <size key="maxSize" width="295" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -713,6 +715,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="311" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -813,6 +816,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="311" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -838,6 +842,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="172" height="38"/>
                                         <size key="maxSize" width="310" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -863,6 +868,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="311" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>

+ 7 - 0
PDF Office/PDF Master/Class/PDFTools/Background/New/View/KMAddBackgroundView.swift

@@ -224,6 +224,9 @@ class KMAddBackgroundView: KMBaseXibView, NSComboBoxDelegate {
     override func updateLanguage() {
         typeBox.title = NSLocalizedString("Source", comment: "")
 
+        batchButton.title = NSLocalizedString("Batch", comment: "");
+        cancelButton.title = NSLocalizedString("Cancel", comment: "");
+        
         colorButton.title = NSLocalizedString("Color", comment: "")
         fileButton.title = NSLocalizedString("File", comment: "")
         browseButton.title = NSLocalizedString("Choose...", comment: "")
@@ -546,11 +549,15 @@ class KMAddBackgroundView: KMBaseXibView, NSComboBoxDelegate {
 
 extension KMAddBackgroundView {
     @IBAction func batchButtonAction(_ sender: Any) {
+        guard let callBack = batchAction else { return }
         
+        callBack(self)
     }
     
     @IBAction func doneButtonAction(_ sender: Any) {
+        guard let callBack = operateCallBack else { return }
         
+        callBack(background, currentType)
     }
     
     @IBAction func cancelButtonAction(_ sender: Any) {

+ 38 - 2
PDF Office/PDF Master/Class/PDFTools/Background/New/View/KMAddBackgroundView.xib

@@ -79,6 +79,9 @@
                                             <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <connections>
+                                            <action selector="buttonClicked_SwitchBackgroundType:" target="-2" id="WOA-80-WJ2"/>
+                                        </connections>
                                     </button>
                                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="e5H-Ra-5M6">
                                         <rect key="frame" x="14" y="33" width="61" height="18"/>
@@ -86,6 +89,9 @@
                                             <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <connections>
+                                            <action selector="buttonClicked_SwitchBackgroundType:" target="-2" id="78S-Oy-5lU"/>
+                                        </connections>
                                     </button>
                                     <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FdJ-Mo-ixe">
                                         <rect key="frame" x="388" y="13" width="37" height="16"/>
@@ -98,6 +104,9 @@
                                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Lzl-LX-D6c">
                                         <rect key="frame" x="491" y="7" width="19" height="28"/>
                                         <stepperCell key="cell" continuous="YES" alignment="left" increment="0.01" maxValue="1" id="Vll-Ns-SVh"/>
+                                        <connections>
+                                            <action selector="radioStepperAction:" target="-2" id="9Nc-Ps-Bjy"/>
+                                        </connections>
                                     </stepper>
                                     <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IHa-Le-PQB">
                                         <rect key="frame" x="425" y="10" width="64" height="21"/>
@@ -121,6 +130,9 @@
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <connections>
+                                            <action selector="buttonClicked_BrowserFile:" target="-2" id="xSh-6w-L4I"/>
+                                        </connections>
                                     </button>
                                     <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Jnj-NY-AI4">
                                         <rect key="frame" x="36" y="10" width="262" height="21"/>
@@ -148,6 +160,9 @@
                                             <constraint firstAttribute="height" constant="28" id="Z6D-3W-CMF"/>
                                         </constraints>
                                         <color key="color" red="0.05813049898" green="0.055541899059999997" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                        <connections>
+                                            <action selector="colorWellChanged:" target="-2" id="JGb-Zs-nRh"/>
+                                        </connections>
                                     </colorWell>
                                 </subviews>
                                 <constraints>
@@ -224,10 +239,16 @@
                                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZfX-mo-ogH">
                                         <rect key="frame" x="194" y="77" width="19" height="28"/>
                                         <stepperCell key="cell" continuous="YES" alignment="left" minValue="-360" maxValue="360" id="biN-b0-SBQ"/>
+                                        <connections>
+                                            <action selector="angleStepperAction:" target="-2" id="sBY-Ol-iXL"/>
+                                        </connections>
                                     </stepper>
                                     <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qgx-tW-Cch">
                                         <rect key="frame" x="90" y="41" width="122" height="28"/>
                                         <sliderCell key="cell" state="on" alignment="left" maxValue="1" doubleValue="1" tickMarkPosition="above" sliderType="linear" id="8VV-02-LhX"/>
+                                        <connections>
+                                            <action selector="alphaSliderAction:" target="-2" id="Cbq-0j-rSD"/>
+                                        </connections>
                                     </slider>
                                     <button hidden="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7M2-46-8tV">
                                         <rect key="frame" x="175" y="19" width="61" height="18"/>
@@ -262,6 +283,9 @@
                                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sVe-7U-Sr3">
                                         <rect key="frame" x="298" y="43" width="19" height="28"/>
                                         <stepperCell key="cell" continuous="YES" alignment="left" increment="0.01" maxValue="1" id="Oaa-8F-8y4"/>
+                                        <connections>
+                                            <action selector="alphaSteperAction:" target="-2" id="NLP-JP-TIW"/>
+                                        </connections>
                                     </stepper>
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="plG-s5-sBd" customClass="KMPostionIndicateView" customModule="PDF_Master" customModuleProvider="target">
                                         <rect key="frame" x="366" y="20" width="80" height="80"/>
@@ -273,6 +297,9 @@
                                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RYW-E6-8Ph">
                                         <rect key="frame" x="540" y="27" width="19" height="28"/>
                                         <stepperCell key="cell" continuous="YES" alignment="left" minValue="-1000" maxValue="1000" id="cqc-YJ-42A"/>
+                                        <connections>
+                                            <action selector="horizentalStepperAction:" target="-2" id="RPg-qQ-aSR"/>
+                                        </connections>
                                     </stepper>
                                     <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WNU-SS-y7q">
                                         <rect key="frame" x="456" y="67" width="10" height="16"/>
@@ -293,6 +320,9 @@
                                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FK4-eP-ZsW">
                                         <rect key="frame" x="540" y="61" width="19" height="28"/>
                                         <stepperCell key="cell" continuous="YES" alignment="left" minValue="-1000" maxValue="1000" id="3Z7-UA-5Sc"/>
+                                        <connections>
+                                            <action selector="verticalStepperAction:" target="-2" id="YMz-0X-9OG"/>
+                                        </connections>
                                     </stepper>
                                     <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RTe-5d-eUd">
                                         <rect key="frame" x="14" y="17" width="37" height="16"/>
@@ -477,6 +507,9 @@
                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                 <font key="font" metaFont="system"/>
                             </buttonCell>
+                            <connections>
+                                <action selector="goPrevious:" target="-2" id="KUt-zo-kF2"/>
+                            </connections>
                         </button>
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="u7Q-0V-OLh">
                             <rect key="frame" x="130" y="182" width="61" height="22"/>
@@ -520,6 +553,9 @@
                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                 <font key="font" metaFont="system"/>
                             </buttonCell>
+                            <connections>
+                                <action selector="goNext:" target="-2" id="0FB-JT-pWn"/>
+                            </connections>
                         </button>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dCQ-Gq-Cst">
                             <rect key="frame" x="8" y="11" width="75" height="32"/>
@@ -528,7 +564,7 @@
                                 <font key="font" metaFont="system"/>
                             </buttonCell>
                             <connections>
-                                <action selector="batchButtonAction:" target="-2" id="hQZ-mm-AVA"/>
+                                <action selector="buttonClicked_Batch:" target="-2" id="Ix0-ax-gMh"/>
                             </connections>
                         </button>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="V6K-Pu-pZ6">
@@ -541,7 +577,7 @@ DQ
 </string>
                             </buttonCell>
                             <connections>
-                                <action selector="doneButtonAction:" target="-2" id="pk6-pz-yuj"/>
+                                <action selector="buttonClicked_Done:" target="-2" id="mmP-pS-kCI"/>
                             </connections>
                         </button>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="D5H-CW-WxN">