Quellcode durchsuchen

【偏好设置】KMLineInspector补充数据处理和事件

tangchao vor 1 Jahr
Ursprung
Commit
2f55ac9219

+ 180 - 80
PDF Office/PDF Master/Class/Common/LineInspector/KMLineInspector.swift

@@ -17,8 +17,8 @@ enum KMLineChangeAction: Int {
 }
 
 class KMLineInspector: NSWindowController {
-    private let LINEWIDTH_KEY = "style"
-    private let STYLE_KEY = "lineWidth"
+    private let LINEWIDTH_KEY = "lineWidth"
+    private let STYLE_KEY = "style"
     private let DASHPATTERN_KEY = "dashPattern"
     private let STARTLINESTYLE_KEY = "startLineStyle"
     private let ENDLINESTYLE_KEY = "endLineStyle"
@@ -66,6 +66,8 @@ class KMLineInspector: NSWindowController {
         set {
             if (abs(self.lineWidth - newValue) > 0.00001) {
                 self._lineWidth = newValue
+                self.lineWell?.lineWidth = newValue
+                
                 self._notifyChangeAction(.lineWidth)
             }
         }
@@ -79,6 +81,8 @@ class KMLineInspector: NSWindowController {
         set {
             if (newValue != self._style) {
                 self._style = newValue
+                self.lineWell?.style = CPDFBorderStyle(rawValue: newValue) ?? .solid
+                
                 self._notifyChangeAction(.style)
             }
         }
@@ -92,6 +96,8 @@ class KMLineInspector: NSWindowController {
         set {
             if (newValue != self.startLineStyle) {
                 self._startLineStyle = newValue
+                self.lineWell?.startLineStyle = CPDFLineStyle(rawValue: newValue) ?? .none
+                
                 self._notifyChangeAction(.startLineStyle)
             }
         }
@@ -105,6 +111,8 @@ class KMLineInspector: NSWindowController {
         set {
             if (newValue != self.endLineStyle) {
                 self._endLineStyle = newValue
+                self.lineWell?.endLineStyle = CPDFLineStyle(rawValue: newValue) ?? .none
+                
                 self._notifyChangeAction(.endLineStyle)
             }
         }
@@ -117,6 +125,8 @@ class KMLineInspector: NSWindowController {
         set {
             if newValue != self._dashPattern && (newValue.isEmpty == false || self._dashPattern.isEmpty == false) {
                 self._dashPattern = newValue
+                
+                self.lineWell?.dashPattern = newValue as NSArray
                 self._notifyChangeAction(.dashPattern)
             }
         }
@@ -127,22 +137,24 @@ class KMLineInspector: NSWindowController {
     override func windowDidLoad() {
         super.windowDidLoad()
         
-        self.labelFields = [self.labelField1, self.labelField2, self.labelField3, self.labelField4, self.labelField5]
+        self._initDefalutValue()
+        self._initLayoutUI()
+        self._initValues()
+        self._initActions()
         
-        self.style = CPDFBorderStyle.solid.rawValue
-        self.lineWidth = 1.0
-        self.dashPattern = []
-        self.startLineStyle = CPDFLineStyle.none.rawValue
-        self.endLineStyle = CPDFLineStyle.none.rawValue
-        self._currentLineChangeAction = .no
+        self._initStyleImages()
+        self._initStartImages()
+        self._initEndImages()
+    }
     
-        self.lineWell.canActivate = false
-//        self.lineWell.bind(NSBindingName(rawValue: KMLineWell.widthKey), to: self, withKeyPath: LINEWIDTH_KEY)
-//        self.lineWell.bind(NSBindingName(KMLineWell.styleKey), to: self, withKeyPath: STYLE_KEY)
-//        self.lineWell.bind(NSBindingName(KMLineWell.dashPatternKey), to: self, withKeyPath: DASHPATTERN_KEY)
-//        self.lineWell.bind(NSBindingName(KMLineWell.startLineStyleKey), to: self, withKeyPath: STARTLINESTYLE_KEY)
-//        self.lineWell.bind(NSBindingName(KMLineWell.endLineStyleKey), to: self, withKeyPath: ENDLINESTYLE_KEY)
-        
+    private func _initLayoutUI() {
+        let dw = KMAutoSizeLabelFields(labelFields, [lineWidthSlider, lineWidthField, styleButton, dashPatternField, startLineStyleButton, endLineStyleButton], false)
+        if (abs(dw) > 0.0) {
+            KMResizeWindow(self.window!, dw)
+        }
+    }
+    
+    private func _initDefalutValue() {
         self.styleButton.setHelp(KMLocalizedString("Solid line style", "Tool tip message"), for: CPDFBorderStyle.solid.rawValue)
         self.styleButton.setHelp(KMLocalizedString("Dashed line style", "Tool tip message"), for: CPDFBorderStyle.dashed.rawValue)
         self.styleButton.setHelp(KMLocalizedString("Beveled line style", "Tool tip message"), for: CPDFBorderStyle.beveled.rawValue)
@@ -163,13 +175,39 @@ class KMLineInspector: NSWindowController {
         self.endLineStyleButton.setHelp(KMLocalizedString("Open arrow end line style", "Tool tip message"), for: CPDFLineStyle.openArrow.rawValue)
         self.endLineStyleButton.setHelp(KMLocalizedString("Closed arrow end line style", "Tool tip message"), for: CPDFLineStyle.closedArrow.rawValue)
         
-        let dw = KMAutoSizeLabelFields(labelFields, [lineWidthSlider, lineWidthField, styleButton, dashPatternField, startLineStyleButton, endLineStyleButton], false)
-        if (abs(dw) > 0.0) {
-            KMResizeWindow(self.window!, dw)
-        }
-        
         self.windowFrameAutosaveName = SKLineInspectorFrameAutosaveName
-
+        self._currentLineChangeAction = .no
+    }
+    
+    private func _initValues() {
+        self.labelFields = [self.labelField1, self.labelField2, self.labelField3, self.labelField4, self.labelField5]
+        
+        self.lineWell.canActivate = false
+        self.lineWell.lineWidth = self.lineWidth
+        self.lineWell.style = CPDFBorderStyle(rawValue: self.style) ?? .solid
+        self.lineWell.dashPattern = self.dashPattern as NSArray
+        self.lineWell.startLineStyle = CPDFLineStyle(rawValue: self.startLineStyle) ?? .none
+        self.lineWell.endLineStyle = CPDFLineStyle(rawValue: self.endLineStyle) ?? .none
+        
+        self.lineWidthSlider.floatValue = Float(self.lineWidth)
+        self.lineWidthField.stringValue = "\(self.lineWidth)"
+        self.styleButton.selectedSegment = self.style
+        self.startLineStyleButton.selectedSegment = self.startLineStyle
+        self.endLineStyleButton.selectedSegment = self.endLineStyle
+    }
+    
+    private func _initActions() {
+        self.lineWidthSlider.target = self
+        self.lineWidthSlider.action = #selector(lineWidthSliderAction)
+        self.styleButton.target = self
+        self.styleButton.action = #selector(styleAction)
+        self.startLineStyleButton.target = self
+        self.startLineStyleButton.action = #selector(startLineStyleAction)
+        self.endLineStyleButton.target = self
+        self.endLineStyleButton.action = #selector(endLineStyleAction)
+    }
+    
+    private func _initStyleImages() {
         var image: NSImage?
         var size = NSMakeSize(29.0, 12.0)
         image = NSImage.image(with: size, drawingHandler: { rect in
@@ -268,8 +306,11 @@ class KMLineInspector: NSWindowController {
             return true
         })
         self.styleButton.setImage(image, forSegment: CPDFBorderStyle.underline.rawValue)
-
-        size = NSMakeSize(24.0, 12.0)
+    }
+    
+    private func _initStartImages() {
+        var image: NSImage?
+        var size = NSMakeSize(24.0, 12.0)
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
             path.move(to: NSMakePoint(20.0, 6.0))
@@ -281,17 +322,6 @@ class KMLineInspector: NSWindowController {
         })
         self.startLineStyleButton.setImage(image, forSegment: CPDFLineStyle.none.rawValue)
         
-        image = NSImage.image(with: size, drawingHandler: { dstRect in
-            let path = NSBezierPath()
-            path.move(to: NSMakePoint(4.0, 6.0))
-            path.line(to: NSMakePoint(16.0, 6.0))
-            path.lineWidth = 2.0
-            NSColor.black.setStroke()
-            path.stroke()
-            return true
-        })
-        self.endLineStyleButton.setImage(image, forSegment: CPDFLineStyle.none.rawValue)
-        
         image = NSImage.image(with: size, drawingHandler: { rect in
             let path = NSBezierPath()
             path.move(to: NSMakePoint(20.0, 6.0))
@@ -302,116 +332,140 @@ class KMLineInspector: NSWindowController {
             path.stroke()
             return true
         })
-        self.startLineStyleButton.setImage(image, forSegment: CPDFLineStyle.square.rawValue)
-
+        // CPDFLineStyle.square.rawValue
+        self.startLineStyleButton.setImage(image, forSegment: 1)
+        
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
-            path.move(to: NSMakePoint(4.0, 6.0))
-            path.line(to: NSMakePoint(16.0, 6.0))
-            path.appendRect(NSMakeRect(13.0, 3.0, 6.0, 6.0))
+            path.move(to: NSMakePoint(20.0, 6.0))
+            path.line(to: NSMakePoint(8.0, 6.0))
+            path.appendOval(in: NSMakeRect(5.0, 3.0, 6.0, 6.0))
             path.lineWidth = 2.0
             NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.endLineStyleButton.setImage(image, forSegment: CPDFLineStyle.square.rawValue)
+        // CPDFLineStyle.circle.rawValue
+        self.startLineStyleButton.setImage(image, forSegment: 2)
         
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
             path.move(to: NSMakePoint(20.0, 6.0))
             path.line(to: NSMakePoint(8.0, 6.0))
-            path.appendOval(in: NSMakeRect(5.0, 3.0, 6.0, 6.0))
+            path.move(to: NSMakePoint(12.0, 6.0))
+            path.line(to: NSMakePoint(8.0, 10.0))
+            path.line(to: NSMakePoint(4.0, 6.0))
+            path.line(to: NSMakePoint(8.0, 2.0))
+            path.close()
             path.lineWidth = 2.0
-            NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.startLineStyleButton.setImage(image, forSegment: CPDFLineStyle.circle.rawValue)
+        // CPDFLineStyle.diamond.rawValue
+        self.startLineStyleButton.setImage(image, forSegment: 3)
         
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
-            path.move(to: NSMakePoint(4.0, 6.0))
-            path.line(to: NSMakePoint(16.0, 6.0))
-            path.appendOval(in: NSMakeRect(13.0, 3.0, 6.0, 6.0))
+            path.move(to: NSMakePoint(20.0, 6.0))
+            path.line(to: NSMakePoint(8.0, 6.0))
+            path.move(to: NSMakePoint(14.0, 3.0))
+            path.line(to: NSMakePoint(8.0, 6.0))
+            path.line(to: NSMakePoint(14.0, 9.0))
             path.lineWidth = 2.0
             NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.endLineStyleButton.setImage(image, forSegment: CPDFLineStyle.circle.rawValue)
+        // CPDFLineStyle.openArrow.rawValue
+        self.startLineStyleButton.setImage(image, forSegment: 4)
         
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
             path.move(to: NSMakePoint(20.0, 6.0))
             path.line(to: NSMakePoint(8.0, 6.0))
-            path.move(to: NSMakePoint(12.0, 6.0))
-            path.line(to: NSMakePoint(8.0, 10.0))
-            path.line(to: NSMakePoint(4.0, 6.0))
-            path.line(to: NSMakePoint(8.0, 2.0))
+            path.move(to: NSMakePoint(14.0, 3.0))
+            path.line(to: NSMakePoint(8.0, 6.0))
+            path.line(to: NSMakePoint(14.0, 9.0))
             path.close()
-            path.lineWidth = 2.0
+            path.lineWidth = 2
+            NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.startLineStyleButton.setImage(image, forSegment: CPDFLineStyle.diamond.rawValue)
-        
+        // CPDFLineStyle.closedArrow.rawValue
+        self.startLineStyleButton.setImage(image, forSegment: 5)
+    }
+    
+    private func _initEndImages() {
+        var image: NSImage?
+        var size = NSMakeSize(24.0, 12.0)
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
             path.move(to: NSMakePoint(4.0, 6.0))
             path.line(to: NSMakePoint(16.0, 6.0))
-            path.move(to: NSMakePoint(12.0, 6.0))
-            path.line(to: NSMakePoint(16.0, 10.0))
-            path.line(to: NSMakePoint(20.0, 6.0))
-            path.line(to: NSMakePoint(16.0, 2.0))
-            path.close()
             path.lineWidth = 2.0
+            NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.endLineStyleButton.setImage(image, forSegment: CPDFLineStyle.diamond.rawValue)
-        
+        self.endLineStyleButton.setImage(image, forSegment: CPDFLineStyle.none.rawValue)
+
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
-            path.move(to: NSMakePoint(20.0, 6.0))
-            path.line(to: NSMakePoint(8.0, 6.0))
-            path.move(to: NSMakePoint(14.0, 3.0))
-            path.line(to: NSMakePoint(8.0, 6.0))
-            path.line(to: NSMakePoint(14.0, 9.0))
+            path.move(to: NSMakePoint(4.0, 6.0))
+            path.line(to: NSMakePoint(16.0, 6.0))
+            path.appendRect(NSMakeRect(13.0, 3.0, 6.0, 6.0))
             path.lineWidth = 2.0
             NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.startLineStyleButton.setImage(image, forSegment: CPDFLineStyle.openArrow.rawValue)
+        // CPDFLineStyle.square.rawValue
+        self.endLineStyleButton.setImage(image, forSegment: 1)
         
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
             path.move(to: NSMakePoint(4.0, 6.0))
             path.line(to: NSMakePoint(16.0, 6.0))
-            path.move(to: NSMakePoint(10.0, 3.0))
-            path.line(to: NSMakePoint(16.0, 6.0))
-            path.line(to: NSMakePoint(10.0, 9.0))
-            path.lineWidth = 2
+            path.appendOval(in: NSMakeRect(13.0, 3.0, 6.0, 6.0))
+            path.lineWidth = 2.0
             NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.endLineStyleButton.setImage(image, forSegment: CPDFLineStyle.openArrow.rawValue)
+        // CPDFLineStyle.circle.rawValue
+        self.endLineStyleButton.setImage(image, forSegment: 2)
         
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
-            path.move(to: NSMakePoint(20.0, 6.0))
-            path.line(to: NSMakePoint(8.0, 6.0))
-            path.move(to: NSMakePoint(14.0, 3.0))
-            path.line(to: NSMakePoint(8.0, 6.0))
-            path.line(to: NSMakePoint(14.0, 9.0))
+            path.move(to: NSMakePoint(4.0, 6.0))
+            path.line(to: NSMakePoint(16.0, 6.0))
+            path.move(to: NSMakePoint(12.0, 6.0))
+            path.line(to: NSMakePoint(16.0, 10.0))
+            path.line(to: NSMakePoint(20.0, 6.0))
+            path.line(to: NSMakePoint(16.0, 2.0))
             path.close()
+            path.lineWidth = 2.0
+            path.stroke()
+            return true
+        })
+        // CPDFLineStyle.diamond.rawValue
+        self.endLineStyleButton.setImage(image, forSegment: 3)
+        
+        image = NSImage.image(with: size, drawingHandler: { dstRect in
+            let path = NSBezierPath()
+            path.move(to: NSMakePoint(4.0, 6.0))
+            path.line(to: NSMakePoint(16.0, 6.0))
+            path.move(to: NSMakePoint(10.0, 3.0))
+            path.line(to: NSMakePoint(16.0, 6.0))
+            path.line(to: NSMakePoint(10.0, 9.0))
             path.lineWidth = 2
             NSColor.black.setStroke()
             path.stroke()
             return true
         })
-        self.startLineStyleButton.setImage(image, forSegment: CPDFLineStyle.closedArrow.rawValue)
+        // CPDFLineStyle.openArrow.rawValue
+        self.endLineStyleButton.setImage(image, forSegment: 4)
         
         image = NSImage.image(with: size, drawingHandler: { dstRect in
             let path = NSBezierPath()
@@ -426,7 +480,8 @@ class KMLineInspector: NSWindowController {
             path.stroke()
             return true
         })
-        self.endLineStyleButton.setImage(image, forSegment: CPDFLineStyle.closedArrow.rawValue)
+        // CPDFLineStyle.closedArrow.rawValue
+        self.endLineStyleButton.setImage(image, forSegment: 5)
     }
     
     override func setNilValueForKey(_ key: String) {
@@ -464,6 +519,51 @@ class KMLineInspector: NSWindowController {
             }
         }
     }
+    
+    // MARK: - Actions
+    
+    @objc func lineWidthSliderAction(_ sender: NSSlider) {
+        self.lineWidth = sender.floatValue.cgFloat
+        self.lineWidthField.stringValue = String(format: "%.0f", sender.floatValue)
+    }
+    
+    @objc func styleAction(_ sender: NSSegmentedControl) {
+        self.style = sender.selectedSegment
+    }
+    
+    @objc func startLineStyleAction(_ sender: NSSegmentedControl) {
+        let index = sender.selectedSegment
+        if index == 0 {
+            self.startLineStyle = CPDFLineStyle.none.rawValue
+        } else if index == 1 {
+            self.startLineStyle = CPDFLineStyle.square.rawValue
+        } else if index == 2 {
+            self.startLineStyle = CPDFLineStyle.circle.rawValue
+        } else if index == 3 {
+            self.startLineStyle = CPDFLineStyle.diamond.rawValue
+        } else if index == 4 {
+            self.startLineStyle = CPDFLineStyle.openArrow.rawValue
+        } else if index == 5 {
+            self.startLineStyle = CPDFLineStyle.closedArrow.rawValue
+        }
+    }
+    
+    @objc func endLineStyleAction(_ sender: NSSegmentedControl) {
+        let index = sender.selectedSegment
+        if index == 0 {
+            self.endLineStyle = CPDFLineStyle.none.rawValue
+        } else if index == 1 {
+            self.endLineStyle = CPDFLineStyle.square.rawValue
+        } else if index == 2 {
+            self.endLineStyle = CPDFLineStyle.circle.rawValue
+        } else if index == 3 {
+            self.endLineStyle = CPDFLineStyle.diamond.rawValue
+        } else if index == 4 {
+            self.endLineStyle = CPDFLineStyle.openArrow.rawValue
+        } else if index == 5 {
+            self.endLineStyle = CPDFLineStyle.closedArrow.rawValue
+        }
+    }
 }
 
 // MARK: - Private Methods

+ 0 - 2
PDF Office/PDF Master/Class/Preference/Controller/KMNotesPreferences.swift

@@ -88,11 +88,9 @@ class KMNotesPreferences: NSViewController {
 //        [lineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
         self.textLineWell.lineWidth = 0
 //
-//        lineWell = [lineWells2 objectAtIndex:0];
 //        [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:SKLineWellDashPatternKey toObject:sudc withKeyPath:VALUES_KEY_PATH(SKStringConstants.circleNoteDashPatternKey) options:nil];
-//        [lineWell setDisplayStyle:SKLineWellDisplayStyleOval];
         self.circleLineWell.displayStyle = .oval
         self.circleLineWell.lineWidth = 2
 //

+ 34 - 17
PDF Office/PDF Master/Class/Preference/View/KMLineWell.swift

@@ -337,8 +337,32 @@ class KMLineWell: NSControl {
                 self._activate(true)
             }
         }
+        
     }
     
+    func takeValue(for key: String, from object: AnyObject) {
+        if let inspector = object as? KMLineInspector {
+            if key == Self.widthKey {
+                self.lineWidth = inspector.lineWidth
+            } else if key == Self.styleKey {
+                self.style = CPDFBorderStyle(rawValue: inspector.style) ?? .solid
+            } else if key == Self.startLineStyleKey {
+                self.startLineStyle = CPDFLineStyle(rawValue: inspector.startLineStyle) ?? .none
+            } else if key == Self.endLineStyleKey {
+                self.endLineStyle = CPDFLineStyle(rawValue: inspector.endLineStyle) ?? .none
+            } else if key == Self.dashPatternKey {
+                self.dashPattern = inspector.dashPattern as NSArray
+            }
+        }
+    }
+    
+//    - (void)takeValueForKey:(NSString *)key from:(id)object {
+//        [self setValue:[object valueForKey:key] forKey:key];
+//        NSDictionary *info = [self infoForBinding:key];
+//        [[info objectForKey:NSObservedObjectKey] setValue:[self valueForKey:key] forKeyPath:[info objectForKey:NSObservedKeyPathKey]];
+//    }
+
+    
     
     /*
 
@@ -372,12 +396,6 @@ class KMLineWell: NSControl {
      //    [super dealloc];
      }
 
-     - (void)takeValueForKey:(NSString *)key from:(id)object {
-         [self setValue:[object valueForKey:key] forKey:key];
-         NSDictionary *info = [self infoForBinding:key];
-         [[info objectForKey:NSObservedObjectKey] setValue:[self valueForKey:key] forKeyPath:[info objectForKey:NSObservedKeyPathKey]];
-     }
-
      #pragma mark Accessors
 
      - (SEL)action { return action; }
@@ -738,23 +756,22 @@ extension KMLineWell {
             nc.post(name: NSNotification.Name(rawValue: SKLineWellWillBecomeActiveNotification), object: self, userInfo: [EXCLUSIVE_KEY : NSNumber(value: exclusive)])
             
             if (__lwFlags.existsActiveLineWell != 0) {
-    //            [self takeValueForKey:SKLineWellLineWidthKey from:inspector];
-    //            [self takeValueForKey:SKLineWellDashPatternKey from:inspector];
-    //            [self takeValueForKey:SKLineWellStyleKey from:inspector];
+                self.takeValue(for: SKLineWellLineWidthKey, from: inspector)
+                self.takeValue(for: SKLineWellDashPatternKey, from: inspector)
+                self.takeValue(for: SKLineWellStyleKey, from: inspector)
                 if (self.displayStyle == .line) {
-    //                [self takeValueForKey:SKLineWellStartLineStyleKey from:inspector];
-    //                [self takeValueForKey:SKLineWellEndLineStyleKey from:inspector];
+                    self.takeValue(for: SKLineWellStartLineStyleKey, from: inspector)
+                    self.takeValue(for: SKLineWellEndLineStyleKey, from: inspector)
                 }
             } else {
-    //            [inspector setLineWidth:[self lineWidth]];
-    //            [inspector setDashPattern:[self dashPattern]];
-    //            [inspector setStyle:[self style]];
+                inspector.lineWidth = self.lineWidth
+                inspector.dashPattern = self.dashPattern as? [CGFloat] ?? []
+                inspector.style = self.style.rawValue
                 if (self.displayStyle == .line) {
-    //                [inspector setStartLineStyle:[self startLineStyle]];
-    //                [inspector setEndLineStyle:[self endLineStyle]];
+                    inspector.startLineStyle = self.startLineStyle.rawValue
+                    inspector.endLineStyle = self.endLineStyle.rawValue
                 }
             }
-    //        [[inspector window] orderFront:self];
             inspector.window?.orderFront(self)
             
             nc.addObserver(self, selector: #selector(_lineWellWillBecomeActive), name: NSNotification.Name(SKLineWellWillBecomeActiveNotification), object: nil)

+ 5 - 0
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -5,6 +5,11 @@
 	<key>SchemeUserState</key>
 	<dict>
 		<key>PDF Reader Pro DMG.xcscheme_^#shared#^_</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>2</integer>
+		</dict>
+		<key>PDF Reader Pro Edition.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
 			<integer>0</integer>