Browse Source

【偏好设置】批注模块(KMNotesPreferences),整理代码

tangchao 1 year ago
parent
commit
4a3c77a7d5

+ 62 - 20
PDF Office/PDF Master/Class/Preference/Controller/KMNotesPreferences.swift

@@ -23,26 +23,63 @@ class KMNotesPreferences: NSViewController {
         NSArray *lineWells2;
         NSArray *lineWells2;
     }
     }
     */
     */
+    @IBOutlet weak var noteLabel: NSTextField!
     
     
+    @IBOutlet weak var textLabel: NSTextField!
+    @IBOutlet weak var textColorWell: NSColorWell!
+    
+    @IBOutlet weak var anchoredLabel: NSTextField!
+    @IBOutlet weak var anchoredColorWell: NSColorWell!
+    
+    @IBOutlet weak var lineLabel: NSTextField!
+    @IBOutlet weak var lineColorWell: NSColorWell!
+    @IBOutlet weak var lineInteriorLabel: NSTextField!
+    @IBOutlet weak var lineInteriorColorWell: NSColorWell!
+    
+    @IBOutlet weak var circleLabel: NSTextField!
+    @IBOutlet weak var circleColorWell: NSColorWell!
+    @IBOutlet weak var circleInteriorLabel: NSTextField!
+    @IBOutlet weak var circleInteriorColorWell: NSColorWell!
+    
+    @IBOutlet weak var rectLabel: NSTextField!
+    @IBOutlet weak var rectColorWell: NSColorWell!
+    @IBOutlet weak var rectInteriorLabel: NSTextField!
+    @IBOutlet weak var rectInteriorColorWell: NSColorWell!
+    
+    @IBOutlet weak var highlightLabel: NSTextField!
+    @IBOutlet weak var highlightColorWell: NSColorWell!
+    @IBOutlet weak var underlineLabel: NSTextField!
+    @IBOutlet weak var underlineColorWell: NSColorWell!
+    @IBOutlet weak var strikeThroughLabel: NSTextField!
+    @IBOutlet weak var strikeThroughColorWell: NSColorWell!
+    @IBOutlet weak var freehandLabel: NSTextField!
+    @IBOutlet weak var freehandColorWell: NSColorWell!
+    
+    @IBOutlet weak var fontLabel: NSTextField!
+    
+    @IBOutlet weak var textFontLabel: NSTextField!
     @IBOutlet var fontWell1: KMFontWell!
     @IBOutlet var fontWell1: KMFontWell!
     @IBOutlet var fontWell2: KMFontWell!
     @IBOutlet var fontWell2: KMFontWell!
+    @IBOutlet weak var anchoredFontLabel: NSTextField!
+    @IBOutlet weak var alignmentSegmentControl: NSSegmentedControl!
     
     
-    @IBOutlet weak var lineWells1_1: KMLineWell!
-    @IBOutlet weak var lineWells1_2: KMLineWell!
-    @IBOutlet weak var lineWells1_3: KMLineWell!
     
     
-    @IBOutlet weak var lineWells2_1: KMLineWell!
-    @IBOutlet weak var lineWells2_2: KMLineWell!
+    @IBOutlet weak var lineAndBorderLabel: NSTextField!
+    @IBOutlet weak var lbTextLabel: NSTextField!
+    @IBOutlet weak var textLineWell: KMLineWell!
+    @IBOutlet weak var ibLineLabel: NSTextField!
+    @IBOutlet weak var lineLineWell: KMLineWell!
+    @IBOutlet weak var ibFreehandLabel: NSTextField!
+    @IBOutlet weak var freehandLineWell: KMLineWell!
+    @IBOutlet weak var ibCircleLabel: NSTextField!
+    @IBOutlet weak var circleLineWell: KMLineWell!
+    @IBOutlet weak var ibRectLabel: NSTextField!
+    @IBOutlet weak var rectLineWell: KMLineWell!
     
     
     override var nibName: NSNib.Name? {
     override var nibName: NSNib.Name? {
         return "NotesPreferences"
         return "NotesPreferences"
     }
     }
     
     
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        // Do view setup here.
-    }
-    
     override var title: String? {
     override var title: String? {
         set {
         set {
             super.title = newValue
             super.title = newValue
@@ -92,23 +129,23 @@ class KMNotesPreferences: NSViewController {
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteDashPatternKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteDashPatternKey) options:nil];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
-        self.lineWells1_1.lineWidth = 0
+        self.textLineWell.lineWidth = 0
 //
 //
 //        lineWell = [lineWells2 objectAtIndex:0];
 //        lineWell = [lineWells2 objectAtIndex:0];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineWidthKey) options:nil];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineWidthKey) options:nil];
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteDashPatternKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteDashPatternKey) options:nil];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleOval];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleOval];
-        self.lineWells2_1.displayStyle = .oval
-        self.lineWells2_1.lineWidth = 2
+        self.circleLineWell.displayStyle = .oval
+        self.circleLineWell.lineWidth = 2
 //
 //
 //        lineWell = [lineWells2 objectAtIndex:1];
 //        lineWell = [lineWells2 objectAtIndex:1];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineWidthKey) options:nil];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineWidthKey) options:nil];
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteDashPatternKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.squareNoteDashPatternKey) options:nil];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
-        self.lineWells2_2.displayStyle = .rectangle
-        self.lineWells2_2.lineWidth = 2
+        self.rectLineWell.displayStyle = .rectangle
+        self.rectLineWell.lineWidth = 2
 //
 //
 //        lineWell = [lineWells1 objectAtIndex:1];
 //        lineWell = [lineWells1 objectAtIndex:1];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineWidthKey) options:nil];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteLineWidthKey) options:nil];
@@ -116,23 +153,28 @@ class KMNotesPreferences: NSViewController {
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteDashPatternKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteDashPatternKey) options:nil];
 //        [lineWell bind:SKLineWellStartLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteStartLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellStartLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteStartLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellEndLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteEndLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellEndLineStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.lineNoteEndLineStyleKey) options:nil];
-        self.lineWells1_2.displayStyle = .line
-        self.lineWells1_2.lineWidth = 2
-        self.lineWells1_2.endLineStyle = .openArrow
+        self.lineLineWell.displayStyle = .line
+        self.lineLineWell.lineWidth = 2
+        self.lineLineWell.endLineStyle = .openArrow
 //
 //
 //        lineWell = [lineWells1 objectAtIndex:2];
 //        lineWell = [lineWells1 objectAtIndex:2];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineWidthKey) options:nil];
 //        [lineWell bind:SKLineWellLineWidthKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineWidthKey) options:nil];
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellStyleKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteLineStyleKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteDashPatternKey) options:nil];
 //        [lineWell bind:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.inkNoteDashPatternKey) options:nil];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleSimpleLine];
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleSimpleLine];
-        self.lineWells1_3.displayStyle = .simpleLine
-        self.lineWells1_3.lineWidth = 2
+        self.freehandLineWell.displayStyle = .simpleLine
+        self.freehandLineWell.lineWidth = 2
         
         
 //    let fontWell = self.fontWell1
 //    let fontWell = self.fontWell1
 //        NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:NSUnarchiveFromDataTransformerName, NSValueTransformerNameBindingOption, nil];
 //        NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:NSUnarchiveFromDataTransformerName, NSValueTransformerNameBindingOption, nil];
 //        [fontWell setHasTextColor:YES];
 //        [fontWell setHasTextColor:YES];
 //        [fontWell bind:@"textColor" toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteFontColorKey) options:options];
 //        [fontWell bind:@"textColor" toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.freeTextNoteFontColorKey) options:options];
     }
     }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+    }
 }
 }
 
 
 extension KMNotesPreferences: KMPreferencePane {
 extension KMNotesPreferences: KMPreferencePane {

+ 40 - 5
PDF Office/PDF Master/Class/Preference/Controller/NotesPreferences.xib

@@ -8,13 +8,48 @@
     <objects>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMNotesPreferences" customModule="PDF_Master" customModuleProvider="target">
         <customObject id="-2" userLabel="File's Owner" customClass="KMNotesPreferences" customModule="PDF_Master" customModuleProvider="target">
             <connections>
             <connections>
+                <outlet property="alignmentSegmentControl" destination="273" id="j6J-Xf-kb3"/>
+                <outlet property="anchoredColorWell" destination="4" id="9NS-IB-Iup"/>
+                <outlet property="anchoredFontLabel" destination="40" id="ymg-MT-8z0"/>
+                <outlet property="anchoredLabel" destination="5" id="Whu-vm-aUB"/>
+                <outlet property="circleColorWell" destination="6" id="6jJ-dY-zBZ"/>
+                <outlet property="circleInteriorColorWell" destination="35" id="sus-b4-p68"/>
+                <outlet property="circleInteriorLabel" destination="36" id="bMB-Tn-J7w"/>
+                <outlet property="circleLabel" destination="7" id="XxF-Nq-k2w"/>
+                <outlet property="circleLineWell" destination="29" id="Ork-fj-GxL"/>
+                <outlet property="fontLabel" destination="19" id="vPo-py-rni"/>
                 <outlet property="fontWell1" destination="41" id="TmV-5P-zGD"/>
                 <outlet property="fontWell1" destination="41" id="TmV-5P-zGD"/>
                 <outlet property="fontWell2" destination="42" id="mTG-QM-jMN"/>
                 <outlet property="fontWell2" destination="42" id="mTG-QM-jMN"/>
-                <outlet property="lineWells1_1" destination="23" id="GeP-cl-1jV"/>
-                <outlet property="lineWells1_2" destination="25" id="gkJ-Ks-DdN"/>
-                <outlet property="lineWells1_3" destination="27" id="yhh-8h-4M1"/>
-                <outlet property="lineWells2_1" destination="29" id="NPy-Xh-Hpp"/>
-                <outlet property="lineWells2_2" destination="31" id="F2f-7g-oY9"/>
+                <outlet property="freehandColorWell" destination="16" id="uLG-u1-9dB"/>
+                <outlet property="freehandLabel" destination="17" id="wgI-cu-ggm"/>
+                <outlet property="freehandLineWell" destination="27" id="MsW-cL-JvU"/>
+                <outlet property="highlightColorWell" destination="10" id="ZWo-8b-HuA"/>
+                <outlet property="highlightLabel" destination="11" id="miS-c4-yMQ"/>
+                <outlet property="ibCircleLabel" destination="30" id="vyX-zs-4pZ"/>
+                <outlet property="ibFreehandLabel" destination="28" id="zNY-NJ-Qo6"/>
+                <outlet property="ibLineLabel" destination="26" id="HOb-hk-aMH"/>
+                <outlet property="ibRectLabel" destination="32" id="xuX-4d-Wd2"/>
+                <outlet property="lbTextLabel" destination="24" id="EpI-Jf-bMo"/>
+                <outlet property="lineAndBorderLabel" destination="34" id="rVJ-UI-CvI"/>
+                <outlet property="lineColorWell" destination="21" id="spf-Kb-3hb"/>
+                <outlet property="lineInteriorColorWell" destination="262" id="0Fu-7q-goC"/>
+                <outlet property="lineInteriorLabel" destination="263" id="cDf-Nz-dsx"/>
+                <outlet property="lineLabel" destination="22" id="ZJL-Vc-TQH"/>
+                <outlet property="lineLineWell" destination="25" id="Il0-M4-rBC"/>
+                <outlet property="noteLabel" destination="18" id="6GV-E9-2u9"/>
+                <outlet property="rectColorWell" destination="8" id="d7w-ki-n3L"/>
+                <outlet property="rectInteriorColorWell" destination="37" id="6sW-ZW-P7g"/>
+                <outlet property="rectInteriorLabel" destination="38" id="Hhh-J9-9Sk"/>
+                <outlet property="rectLabel" destination="9" id="mFA-Fz-ITP"/>
+                <outlet property="rectLineWell" destination="31" id="ECi-Ih-QQd"/>
+                <outlet property="strikeThroughColorWell" destination="14" id="OX8-Fd-gNp"/>
+                <outlet property="strikeThroughLabel" destination="15" id="pdF-Jh-8L7"/>
+                <outlet property="textColorWell" destination="2" id="eAA-o9-k2v"/>
+                <outlet property="textFontLabel" destination="39" id="INx-1S-BXI"/>
+                <outlet property="textLabel" destination="3" id="1ZO-cD-aWl"/>
+                <outlet property="textLineWell" destination="23" id="4sd-xs-Ime"/>
+                <outlet property="underlineColorWell" destination="12" id="G2Q-X3-478"/>
+                <outlet property="underlineLabel" destination="13" id="oLw-Hs-qR0"/>
                 <outlet property="view" destination="1" id="112"/>
                 <outlet property="view" destination="1" id="112"/>
             </connections>
             </connections>
         </customObject>
         </customObject>