Browse Source

【页面编辑】KMPDFEditPageRangeWindowController OC转Swift

tangchao 1 year ago
parent
commit
676eeed09b

+ 48 - 0
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -1948,6 +1948,21 @@
 		BB0A823229C00400002C5C1B /* KMCommonEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB0A823129C00400002C5C1B /* KMCommonEnum.swift */; };
 		BB0A823329C00400002C5C1B /* KMCommonEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB0A823129C00400002C5C1B /* KMCommonEnum.swift */; };
 		BB0A823429C00400002C5C1B /* KMCommonEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB0A823129C00400002C5C1B /* KMCommonEnum.swift */; };
+		BB10FAE52AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAE42AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift */; };
+		BB10FAE62AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAE42AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift */; };
+		BB10FAE72AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAE42AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift */; };
+		BB10FAE92AFE03CD00F18D65 /* KMPDFEditPageRangeWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB10FAE82AFE03CC00F18D65 /* KMPDFEditPageRangeWindowController.xib */; };
+		BB10FAEA2AFE03CD00F18D65 /* KMPDFEditPageRangeWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB10FAE82AFE03CC00F18D65 /* KMPDFEditPageRangeWindowController.xib */; };
+		BB10FAEB2AFE03CD00F18D65 /* KMPDFEditPageRangeWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB10FAE82AFE03CC00F18D65 /* KMPDFEditPageRangeWindowController.xib */; };
+		BB10FAEE2AFE233C00F18D65 /* KMLineInspector.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAED2AFE233C00F18D65 /* KMLineInspector.swift */; };
+		BB10FAEF2AFE233C00F18D65 /* KMLineInspector.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAED2AFE233C00F18D65 /* KMLineInspector.swift */; };
+		BB10FAF02AFE233C00F18D65 /* KMLineInspector.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAED2AFE233C00F18D65 /* KMLineInspector.swift */; };
+		BB10FAF22AFE23BE00F18D65 /* LineInspector.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB10FAF12AFE23BE00F18D65 /* LineInspector.xib */; };
+		BB10FAF32AFE23BE00F18D65 /* LineInspector.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB10FAF12AFE23BE00F18D65 /* LineInspector.xib */; };
+		BB10FAF42AFE23BE00F18D65 /* LineInspector.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB10FAF12AFE23BE00F18D65 /* LineInspector.xib */; };
+		BB10FAF62AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */; };
+		BB10FAF72AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */; };
+		BB10FAF82AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */; };
 		BB13314E2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */; };
 		BB13314F2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */; };
 		BB1331502AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */; };
@@ -4348,6 +4363,11 @@
 		BB0A551C2A30793F00B6E84B /* KMDesignTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMDesignTextField.swift; sourceTree = "<group>"; };
 		BB0A55202A30968900B6E84B /* KMDesignBaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMDesignBaseView.swift; sourceTree = "<group>"; };
 		BB0A823129C00400002C5C1B /* KMCommonEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMCommonEnum.swift; sourceTree = "<group>"; };
+		BB10FAE42AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFEditPageRangeWindowController.swift; sourceTree = "<group>"; };
+		BB10FAE82AFE03CC00F18D65 /* KMPDFEditPageRangeWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMPDFEditPageRangeWindowController.xib; sourceTree = "<group>"; };
+		BB10FAED2AFE233C00F18D65 /* KMLineInspector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMLineInspector.swift; sourceTree = "<group>"; };
+		BB10FAF12AFE23BE00F18D65 /* LineInspector.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LineInspector.xib; sourceTree = "<group>"; };
+		BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNumberArrayFormatter.swift; sourceTree = "<group>"; };
 		BB13314D2AD78DC0008F6791 /* KMPDFMergeSizeTabelViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFMergeSizeTabelViewCell.swift; sourceTree = "<group>"; };
 		BB1331532AD7A6A1008F6791 /* KMFileAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMFileAttribute.swift; sourceTree = "<group>"; };
 		BB135C2929B6CD9A00FD5965 /* KMTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMTools.swift; sourceTree = "<group>"; };
@@ -7370,9 +7390,20 @@
 			path = Designs;
 			sourceTree = "<group>";
 		};
+		BB10FAEC2AFE232300F18D65 /* LineInspector */ = {
+			isa = PBXGroup;
+			children = (
+				BB10FAED2AFE233C00F18D65 /* KMLineInspector.swift */,
+				BB10FAF12AFE23BE00F18D65 /* LineInspector.xib */,
+				BB10FAF52AFE2C2900F18D65 /* KMNumberArrayFormatter.swift */,
+			);
+			path = LineInspector;
+			sourceTree = "<group>";
+		};
 		BB135C2629B6CD4500FD5965 /* Common */ = {
 			isa = PBXGroup;
 			children = (
+				BB10FAEC2AFE232300F18D65 /* LineInspector */,
 				BB0A551B2A3078EB00B6E84B /* Designs */,
 				BB6B43642A04913200E02B54 /* Base */,
 				BBA5429A29F139730041BAD0 /* Control */,
@@ -7758,10 +7789,12 @@
 		BB2EDF49296E6373003BCF58 /* Window */ = {
 			isa = PBXGroup;
 			children = (
+				BB10FAE82AFE03CC00F18D65 /* KMPDFEditPageRangeWindowController.xib */,
 				BB2EDF4A296E63E5003BCF58 /* KMPageEditInsertCustomPageWindowController.swift */,
 				BB2EDF4B296E63E5003BCF58 /* KMPageEditInsertCustomPageWindowController.xib */,
 				BBD1F782296F9DB500343885 /* KMPageEditExtractWindowController.swift */,
 				BBD1F78E296FE6A500343885 /* KMPageEditSplitWindowController.swift */,
+				BB10FAE42AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift */,
 			);
 			path = Window;
 			sourceTree = "<group>";
@@ -9728,6 +9761,7 @@
 				ADE787AE2AA5AA50002EC85A /* KMAccountExceptionView.xib in Resources */,
 				BBEC00B2295C2AF300A26C98 /* KMBatesPreviewController.xib in Resources */,
 				9FD0FA3429CD947000F2AB0D /* KMOpacityPanel.xib in Resources */,
+				BB10FAE92AFE03CD00F18D65 /* KMPDFEditPageRangeWindowController.xib in Resources */,
 				BB4BD9CF2909026500A66A65 /* KMRightSideViewController.xib in Resources */,
 				BB99ACC5292DE22E0048AFD9 /* KMMergeViewController.xib in Resources */,
 				BB6347B82AF224E200F5438E /* KMConvertCollectionViewHeader.xib in Resources */,
@@ -9817,6 +9851,7 @@
 				AD0FA51629A9FA8F00EDEB50 /* KMResetPasswordView.xib in Resources */,
 				BBC3480F29558DC1008D2CD1 /* KMBackgroundController.xib in Resources */,
 				BBC4F9EE2AEB58470098A1A8 /* KMAlertWindowController.xib in Resources */,
+				BB10FAF22AFE23BE00F18D65 /* LineInspector.xib in Resources */,
 				ADF6B8792A48155E0090CB78 /* KMComparativeViewCollectionItem.xib in Resources */,
 				BBADCF642AF3CB92004ECE0C /* KMWatermarkCollectionViewItem.xib in Resources */,
 				ADC31FAC2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib in Resources */,
@@ -10012,6 +10047,7 @@
 				F3B7DF9E2948565000333201 /* CPDFListHoverAnnotationViewController.xib in Resources */,
 				BBADCF592AF3C7B3004ECE0C /* KMBatchOperateAddWatermarkViewController.xib in Resources */,
 				BBC3481029558DC1008D2CD1 /* KMBackgroundController.xib in Resources */,
+				BB10FAEA2AFE03CD00F18D65 /* KMPDFEditPageRangeWindowController.xib in Resources */,
 				BBAFC84E298519F700D0648E /* KMSavePanelAccessoryController.xib in Resources */,
 				ADBC2CF6299C7B3E006280C8 /* Print.xcassets in Resources */,
 				BB5DF1ED2959C5CB0025CDA1 /* KMHeaderFooterPreviewController.xib in Resources */,
@@ -10244,6 +10280,7 @@
 				AD0FA50729A8E61B00EDEB50 /* KMLightMemberAlertView.xib in Resources */,
 				BB69C963299116FD0001A9B1 /* horizontal_line.pdf in Resources */,
 				BBFE6E612930809A00142C01 /* KMMergeCollectionPageViewItem.xib in Resources */,
+				BB10FAF32AFE23BE00F18D65 /* LineInspector.xib in Resources */,
 				ADD5AE5A2A64DD2600C14249 /* KMPurchaseAlertView.xib in Resources */,
 				BB89723E294B3C840045787C /* KMWatermarkPropertyController.xib in Resources */,
 			);
@@ -10456,6 +10493,7 @@
 				9F56648C2988B16F00020985 /* KMTextfieldVC.xib in Resources */,
 				9FA607E328FD4C9F00B46586 /* KMHomePopViewController.xib in Resources */,
 				F356720A29AF184A00740FF3 /* CPDFListAnnotationNoteWindowController.xib in Resources */,
+				BB10FAF42AFE23BE00F18D65 /* LineInspector.xib in Resources */,
 				BB7F7C0529AA586900A3E4E7 /* signAddBack.png in Resources */,
 				BB4BD9D12909026500A66A65 /* KMRightSideViewController.xib in Resources */,
 				9F0CB49429683DEE00007028 /* KMPropertiesPanelLineSubVC.xib in Resources */,
@@ -10486,6 +10524,7 @@
 				9F00CF562A38657400AC462E /* GoogleService-Info.plist in Resources */,
 				9FDD0F69294AB645000C4DAD /* KMMainViewController.xib in Resources */,
 				9FBA0EF328FFC716001117AF /* KMHomeFastToolViewController.xib in Resources */,
+				BB10FAEB2AFE03CD00F18D65 /* KMPDFEditPageRangeWindowController.xib in Resources */,
 				8942F7F52926087200389627 /* KMSearchViewController.xib in Resources */,
 				BBFE6E7A2930E53000142C01 /* KMMergePopoverViewController.xib in Resources */,
 				89D9897128FD50EF003A3E87 /* KMAnnotationCollectionViewItem.xib in Resources */,
@@ -10762,6 +10801,7 @@
 				9F1F82F229373D6E0092C4B4 /* String+KMExtensions.swift in Sources */,
 				BB897236294B38DC0045787C /* KMWatermarkAdjectivePropertyBaseController.swift in Sources */,
 				AD85D19E2AEF927D000F4D28 /* KMQucikToolsModel.swift in Sources */,
+				BB10FAF62AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */,
 				9F1F82D2292F6D510092C4B4 /* KMPDFInsertPreviewViewController.swift in Sources */,
 				AD02573F2A8601CD00EAD5D5 /* KMAppleLoginManager.swift in Sources */,
 				BBC70EB42AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */,
@@ -11218,6 +11258,7 @@
 				BBB9B316299A5D6D004F3235 /* KMDropboxManager.m in Sources */,
 				9F1F82EE293609F60092C4B4 /* CPDFDocument+PageEditManager.swift in Sources */,
 				89D2D2E2294C452B00BFF5FE /* KMPDFThumbnailView.swift in Sources */,
+				BB10FAE52AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift in Sources */,
 				ADD1B6B729420B2300C3FFF7 /* KMPrintChooseView.swift in Sources */,
 				BB146FFF299DC0D100784A6A /* OIDRedirectHTTPHandler.m in Sources */,
 				ADD5AE552A64D31200C14249 /* KMPurchaseAlertView.swift in Sources */,
@@ -11433,6 +11474,7 @@
 				8997010E28F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				BBFDFA932AF328B200E08AA2 /* KMBatchOperateManager.swift in Sources */,
 				BB2F61502966A91D001CB369 /* KMBackgroundPropertyHomeController.swift in Sources */,
+				BB10FAEE2AFE233C00F18D65 /* KMLineInspector.swift in Sources */,
 				BBBB6CD22AD14A5F0035AA66 /* CPDFChoiceWidgetAnnotation+PDFListView.swift in Sources */,
 				9F1FE3DE293EE51F00E952CA /* KMMainDocument.swift in Sources */,
 				9F0201962A1F352100C9B673 /* KMAITranslationConfirmWindowController.swift in Sources */,
@@ -11964,6 +12006,7 @@
 				BB146FF1299DC0D100784A6A /* GTLRUploadParameters.m in Sources */,
 				AD88108429A719D400178CA1 /* KMRegisterView.swift in Sources */,
 				BB31981F2AC57ACA00107371 /* CPDFPage+PDFListView.swift in Sources */,
+				BB10FAE62AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift in Sources */,
 				9F705F77291A3A84005199AD /* KMHistoryFileDeleteWindowController.swift in Sources */,
 				BBC3482F29559E12008D2CD1 /* KMBackgroundModel.swift in Sources */,
 				BB9E2F742A495BCD000DC68D /* KMConvertSettingLimitTipView.swift in Sources */,
@@ -12014,6 +12057,7 @@
 				9F53D5542AD683A700CCF9D8 /* KMAnnotationPropertyBaseController.swift in Sources */,
 				BB2EDF47296E4618003BCF58 /* KMPageEditTools.swift in Sources */,
 				BB853C6C2AF8782A009C20C1 /* KMRemoveWatermarkOperationQueue.swift in Sources */,
+				BB10FAEF2AFE233C00F18D65 /* KMLineInspector.swift in Sources */,
 				9FAAA32B290BD01D0046FFCE /* KMHomeHistoryFileViewController.swift in Sources */,
 				BB49ED16293F489500C82CA2 /* KMConvertImageSettingView.swift in Sources */,
 				ADBC375E29CC61E100D93208 /* KMReadModelView.swift in Sources */,
@@ -12106,6 +12150,7 @@
 				BBB9B31D299A5D6D004F3235 /* KMCloudOperation.m in Sources */,
 				AD9527BB295291F20039D2BC /* KMPrintPage.swift in Sources */,
 				ADE3C1AC29A4779E00793B13 /* KMPrintAccessoryController.swift in Sources */,
+				BB10FAF72AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */,
 				BBD7FE082A13241C00F96075 /* KMOutlineEditViewController.swift in Sources */,
 				BB8F4558295AA1270037EA22 /* KMHeaderFooterPropertyInfoController.swift in Sources */,
 				AD88108E29A760D100178CA1 /* KMRegisterPresenter.swift in Sources */,
@@ -12662,6 +12707,7 @@
 				BB60138A2AD3A3CB00A76FB2 /* CPDFWidgetAnnotation+PDFListView.swift in Sources */,
 				BB0A551F2A30793F00B6E84B /* KMDesignTextField.swift in Sources */,
 				BB146FCE299DC0D100784A6A /* GTMSessionUploadFetcher.m in Sources */,
+				BB10FAF82AFE2C2900F18D65 /* KMNumberArrayFormatter.swift in Sources */,
 				BB3198142AC5142900107371 /* NSMenu+KMExtension.swift in Sources */,
 				BB89724F294C1DCE0045787C /* KMWatermarkAdjectiveListTableCellView.swift in Sources */,
 				ADD1B6E62946C00800C3FFF7 /* KMPrintChoosePageSizePosterView.swift in Sources */,
@@ -12790,6 +12836,7 @@
 				9FBA0EE328FEC253001117AF /* KMProductPromotionViewController.swift in Sources */,
 				8942F7F22926087200389627 /* KMSearchViewController.swift in Sources */,
 				BB853C882AF8BC12009C20C1 /* KMAddPasswordOperationQueue.swift in Sources */,
+				BB10FAE72AFE039E00F18D65 /* KMPDFEditPageRangeWindowController.swift in Sources */,
 				BBC348452956A638008D2CD1 /* KMEditBackgroundController.swift in Sources */,
 				9FDD0F79294FEF64000C4DAD /* KMConvertPDFManager.swift in Sources */,
 				ADDEEA4B2AD38BDB00EF675D /* KMSignatureHelpViewController.swift in Sources */,
@@ -12877,6 +12924,7 @@
 				BB3AAB9229878CE000992A5A /* KMWatermarkAdjectivePropertyMainController.swift in Sources */,
 				9F0201802A1BAC1600C9B673 /* KMAIRewritingVC.swift in Sources */,
 				BBCE57122A72712200508EFC /* NSWindowController+KMExtension.swift in Sources */,
+				BB10FAF02AFE233C00F18D65 /* KMLineInspector.swift in Sources */,
 				ADE3C1A129A3894900793B13 /* KMSearchTableRowView.swift in Sources */,
 				AD1CA41B2A061CE10070541F /* KMAnnotationScreenTypeViewItem.swift in Sources */,
 				AD8810A229A8459000178CA1 /* KMComparativeTableViewController.swift in Sources */,

+ 523 - 0
PDF Office/PDF Master/Class/Common/LineInspector/KMLineInspector.swift

@@ -0,0 +1,523 @@
+//
+//  KMLineInspector.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/11/10.
+//
+
+import Cocoa
+
+class KMLineInspector: NSWindowController {
+    /*
+     extern NSString *SKLineInspectorLineAttributeDidChangeNotification;
+
+     typedef NS_ENUM(NSUInteger, SKLineChangeAction) {
+         SKNoLineChangeAction,
+         SKLineChangeActionLineWidth,
+         SKLineChangeActionStyle,
+         SKLineChangeActionDashPattern,
+         SKLineChangeActionStartLineStyle,
+         SKLineChangeActionEndLineStyle
+     };
+
+     @class SKLineWell;
+
+     @interface SKLineInspector : SKWindowController {
+         NSSlider *lineWidthSlider;
+         NSTextField *lineWidthField;
+         NSSegmentedControl *styleButton;
+         NSTextField *dashPatternField;
+         NSSegmentedControl *startLineStyleButton;
+         NSSegmentedControl *endLineStyleButton;
+         SKLineWell *lineWell;
+         NSTextField *lineWidthLabelField;
+         NSTextField *styleLabelField;
+         NSTextField *dashPatternLabelField;
+         NSTextField *startLineStyleLabelField;
+         NSTextField *endLineStyleLabelField;
+         NSArray *labelFields;
+         CGFloat lineWidth;
+         PDFBorderStyle style;
+         NSArray *dashPattern;
+         PDFLineStyle startLineStyle;
+         PDFLineStyle endLineStyle;
+         SKLineChangeAction currentLineChangeAction;
+     }
+
+     @property (nonatomic, retain) IBOutlet NSArray *labelFields;
+     @property (nonatomic) CGFloat lineWidth;
+     @property (nonatomic) PDFBorderStyle style;
+     @property (nonatomic, copy) NSArray *dashPattern;
+     @property (nonatomic) PDFLineStyle startLineStyle, endLineStyle;
+     @property (nonatomic, readonly) SKLineChangeAction currentLineChangeAction;
+
+     + (id)sharedLineInspector;
+     + (BOOL)sharedLineInspectorExists;
+
+     - (void)setAnnotationStyle:(PDFAnnotation *)annotation;
+     */
+    
+    @IBOutlet var lineWidthSlider: NSSlider!
+    @IBOutlet var lineWidthField: NSTextField!
+    @IBOutlet var dashPatternField: NSTextField!
+    @IBOutlet var styleButton: NSSegmentedControl!
+    @IBOutlet var startLineStyleButton: NSSegmentedControl!
+    @IBOutlet var endLineStyleButton: NSSegmentedControl!
+    @IBOutlet var lineWidthLabelField: NSTextField!
+    @IBOutlet var styleLabelField: NSTextField!
+    @IBOutlet var dashPatternLabelField: NSTextField!
+    @IBOutlet var startLineStyleLabelField: NSTextField!
+    @IBOutlet var endLineStyleLabelField: NSTextField!
+    @IBOutlet var lineWell: KMLineWell!
+
+    @IBOutlet weak var labelField1: NSTextField!
+    @IBOutlet weak var labelField2: NSTextField!
+    @IBOutlet weak var labelField3: NSTextField!
+    @IBOutlet weak var labelField4: NSTextField!
+    @IBOutlet weak var labelField5: NSTextField!
+    
+    static let shared = KMLineInspector(windowNibName: "LineInspector")
+    
+    override func windowDidLoad() {
+        super.windowDidLoad()
+    
+        // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+    }
+    
+    /*
+     SString *SKLineInspectorLineAttributeDidChangeNotification = @"SKLineInspectorLineAttributeDidChangeNotification";
+
+     #define LINEWIDTH_KEY       @"lineWidth"
+     #define STYLE_KEY           @"style"
+     #define DASHPATTERN_KEY     @"dashPattern"
+     #define STARTLINESTYLE_KEY  @"startLineStyle"
+     #define ENDLINESTYLE_KEY    @"endLineStyle"
+     #define ACTION_KEY          @"action"
+
+     #define SKLineInspectorFrameAutosaveName @"SKLineInspector"
+
+     @implementation SKLineInspector
+
+     @synthesize lineWidthSlider, lineWidthField, dashPatternField, styleButton, startLineStyleButton, endLineStyleButton, lineWell, lineWidthLabelField, styleLabelField, dashPatternLabelField, startLineStyleLabelField, endLineStyleLabelField, labelFields, lineWidth, style, dashPattern, startLineStyle, endLineStyle, currentLineChangeAction;
+
+     static SKLineInspector *sharedLineInspector = nil;
+
+     + (id)sharedLineInspector {
+         if (sharedLineInspector == nil)
+             sharedLineInspector = [[self alloc] init];
+         return sharedLineInspector;
+     }
+
+     + (BOOL)sharedLineInspectorExists {
+         return sharedLineInspector != nil;
+     }
+
+     - (id)init {
+         if (sharedLineInspector) NSLog(@"Attempt to allocate second instance of %@", [self class]);
+         self = [super initWithWindowNibName:@"LineInspector"];
+         if (self) {
+             style = kPDFBorderStyleSolid;
+             lineWidth = 1.0;
+             dashPattern = nil;
+             startLineStyle = kPDFLineStyleNone;
+             endLineStyle = kPDFLineStyleNone;
+             currentLineChangeAction = SKNoLineChangeAction;
+         }
+         return self;
+     }
+
+     - (void)dealloc {
+         SKDESTROY(dashPattern);
+         SKDESTROY(lineWidthSlider);
+         SKDESTROY(lineWidthField);
+         SKDESTROY(dashPatternField);
+         SKDESTROY(styleButton);
+         SKDESTROY(startLineStyleButton);
+         SKDESTROY(endLineStyleButton);
+         SKDESTROY(lineWell);
+         SKDESTROY(lineWidthLabelField);
+         SKDESTROY(styleLabelField);
+         SKDESTROY(dashPatternLabelField);
+         SKDESTROY(startLineStyleLabelField);
+         SKDESTROY(endLineStyleLabelField);
+         SKDESTROY(labelFields);
+         [super dealloc];
+     }
+
+     - (void)windowDidLoad {
+         [lineWell setCanActivate:NO];
+         [lineWell bind:SKLineWellLineWidthKey toObject:self withKeyPath:LINEWIDTH_KEY options:nil];
+         [lineWell bind:SKLineWellStyleKey toObject:self withKeyPath:STYLE_KEY options:nil];
+         [lineWell bind:SKLineWellDashPatternKey toObject:self withKeyPath:DASHPATTERN_KEY options:nil];
+         [lineWell bind:SKLineWellStartLineStyleKey toObject:self withKeyPath:STARTLINESTYLE_KEY options:nil];
+         [lineWell bind:SKLineWellEndLineStyleKey toObject:self withKeyPath:ENDLINESTYLE_KEY options:nil];
+         
+         [styleButton setHelp:NSLocalizedString(@"Solid line style", @"Tool tip message") forSegment:kPDFBorderStyleSolid];
+         [styleButton setHelp:NSLocalizedString(@"Dashed line style", @"Tool tip message") forSegment:kPDFBorderStyleDashed];
+         [styleButton setHelp:NSLocalizedString(@"Beveled line style", @"Tool tip message") forSegment:kPDFBorderStyleBeveled];
+         [styleButton setHelp:NSLocalizedString(@"Inset line style", @"Tool tip message") forSegment:kPDFBorderStyleInset];
+         [styleButton setHelp:NSLocalizedString(@"Underline line style", @"Tool tip message") forSegment:kPDFBorderStyleUnderline];
+         
+         [startLineStyleButton setHelp:NSLocalizedString(@"No start line style", @"Tool tip message") forSegment:kPDFLineStyleNone];
+         [startLineStyleButton setHelp:NSLocalizedString(@"Square start line style", @"Tool tip message") forSegment:kPDFLineStyleSquare];
+         [startLineStyleButton setHelp:NSLocalizedString(@"Circle start line style", @"Tool tip message") forSegment:kPDFLineStyleCircle];
+         [startLineStyleButton setHelp:NSLocalizedString(@"Diamond start line style", @"Tool tip message") forSegment:kPDFLineStyleDiamond];
+         [startLineStyleButton setHelp:NSLocalizedString(@"Open arrow start line style", @"Tool tip message") forSegment:kPDFLineStyleOpenArrow];
+         [startLineStyleButton setHelp:NSLocalizedString(@"Closed arrow start line style", @"Tool tip message") forSegment:kPDFLineStyleClosedArrow];
+         
+         [endLineStyleButton setHelp:NSLocalizedString(@"No end line style", @"Tool tip message") forSegment:kPDFLineStyleNone];
+         [endLineStyleButton setHelp:NSLocalizedString(@"Square end line style", @"Tool tip message") forSegment:kPDFLineStyleSquare];
+         [endLineStyleButton setHelp:NSLocalizedString(@"Circle end line style", @"Tool tip message") forSegment:kPDFLineStyleCircle];
+         [endLineStyleButton setHelp:NSLocalizedString(@"Diamond end line style", @"Tool tip message") forSegment:kPDFLineStyleDiamond];
+         [endLineStyleButton setHelp:NSLocalizedString(@"Open arrow end line style", @"Tool tip message") forSegment:kPDFLineStyleOpenArrow];
+         [endLineStyleButton setHelp:NSLocalizedString(@"Closed arrow end line style", @"Tool tip message") forSegment:kPDFLineStyleClosedArrow];
+         
+         CGFloat dw = SKAutoSizeLabelFields(labelFields, [NSArray arrayWithObjects:lineWidthSlider, lineWidthField, styleButton, dashPatternField, startLineStyleButton, endLineStyleButton, nil], NO);
+         if (fabs(dw) > 0.0)
+             SKResizeWindow([self window], dw);
+         
+         [self setWindowFrameAutosaveName:SKLineInspectorFrameAutosaveName];
+
+         NSImage *image = nil;
+         NSSize size = NSMakeSize(29.0, 12.0);
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(6.0, 3.0, 17.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [styleButton setImage:image forSegment:kPDFBorderStyleSolid];
+             
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(6.0, 5.0)];
+             [path lineToPoint:NSMakePoint(6.0, 3.0)];
+             [path lineToPoint:NSMakePoint(9.0, 3.0)];
+             [path moveToPoint:NSMakePoint(12.0, 3.0)];
+             [path lineToPoint:NSMakePoint(17.0, 3.0)];
+             [path moveToPoint:NSMakePoint(20.0, 3.0)];
+             [path lineToPoint:NSMakePoint(23.0, 3.0)];
+             [path lineToPoint:NSMakePoint(23.0, 5.0)];
+             [path moveToPoint:NSMakePoint(23.0, 7.0)];
+             [path lineToPoint:NSMakePoint(23.0, 9.0)];
+             [path lineToPoint:NSMakePoint(20.0, 9.0)];
+             [path moveToPoint:NSMakePoint(17.0, 9.0)];
+             [path lineToPoint:NSMakePoint(12.0, 9.0)];
+             [path moveToPoint:NSMakePoint(9.0, 9.0)];
+             [path lineToPoint:NSMakePoint(6.0, 9.0)];
+             [path lineToPoint:NSMakePoint(6.0, 7.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [styleButton setImage:image forSegment:kPDFBorderStyleDashed];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(6.0, 3.0, 17.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor colorWithCalibratedWhite:0.0 alpha:0.25] setStroke];
+             [path stroke];
+             path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(7.0, 3.0)];
+             [path lineToPoint:NSMakePoint(23.0, 3.0)];
+             [path lineToPoint:NSMakePoint(23.0, 8.0)];
+             [path setLineWidth:2.0];
+             [[NSColor colorWithCalibratedWhite:0.0 alpha:0.35] set];
+             [path stroke];
+             path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(5.0, 2.0)];
+             [path lineToPoint:NSMakePoint(7.0, 4.0)];
+             [path lineToPoint:NSMakePoint(7.0, 2.0)];
+             [path closePath];
+             [path moveToPoint:NSMakePoint(24.0, 10.0)];
+             [path lineToPoint:NSMakePoint(22.0, 8.0)];
+             [path lineToPoint:NSMakePoint(24.0, 8.0)];
+             [path closePath];
+             [path fill];
+             return YES;
+         }];
+         [styleButton setImage:image forSegment:kPDFBorderStyleBeveled];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(6.0, 3.0, 17.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor colorWithCalibratedWhite:0.0 alpha:0.25] setStroke];
+             [path stroke];
+             path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(6.0, 4.0)];
+             [path lineToPoint:NSMakePoint(6.0, 9.0)];
+             [path lineToPoint:NSMakePoint(22.0, 9.0)];
+             [path setLineWidth:2.0];
+             [[NSColor colorWithCalibratedWhite:0.0 alpha:0.35] set];
+             [path stroke];
+             path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(5.0, 2.0)];
+             [path lineToPoint:NSMakePoint(7.0, 4.0)];
+             [path lineToPoint:NSMakePoint(5.0, 4.0)];
+             [path closePath];
+             [path moveToPoint:NSMakePoint(24.0, 10.0)];
+             [path lineToPoint:NSMakePoint(22.0, 8.0)];
+             [path lineToPoint:NSMakePoint(22.0, 10.0)];
+             [path closePath];
+             [path fill];
+             return YES;
+         }];
+         [styleButton setImage:image forSegment:kPDFBorderStyleInset];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(6.0, 3.0)];
+             [path lineToPoint:NSMakePoint(23.0, 3.0)];
+             [path setLineWidth:2.0];
+             [[NSColor colorWithCalibratedWhite:0.0 alpha:0.5] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [styleButton setImage:image forSegment:kPDFBorderStyleUnderline];
+         
+         size = NSMakeSize(24.0, 12.0);
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(20.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [startLineStyleButton setImage:image forSegment:kPDFLineStyleNone];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(4.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [endLineStyleButton setImage:image forSegment:kPDFLineStyleNone];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(20.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path appendBezierPathWithRect:NSMakeRect(5.0, 3.0, 6.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [startLineStyleButton setImage:image forSegment:kPDFLineStyleSquare];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(4.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path appendBezierPathWithRect:NSMakeRect(13.0, 3.0, 6.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [endLineStyleButton setImage:image forSegment:kPDFLineStyleSquare];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(20.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path appendBezierPathWithOvalInRect:NSMakeRect(5.0, 3.0, 6.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [startLineStyleButton setImage:image forSegment:kPDFLineStyleCircle];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(4.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path appendBezierPathWithOvalInRect:NSMakeRect(13.0, 3.0, 6.0, 6.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [endLineStyleButton setImage:image forSegment:kPDFLineStyleCircle];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(20.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path moveToPoint:NSMakePoint(12.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 10.0)];
+             [path lineToPoint:NSMakePoint(4.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 2.0)];
+             [path closePath];
+             [path setLineWidth:2.0];
+             [path stroke];
+             return YES;
+         }];
+         [startLineStyleButton setImage:image forSegment:kPDFLineStyleDiamond];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(4.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path moveToPoint:NSMakePoint(12.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 10.0)];
+             [path lineToPoint:NSMakePoint(20.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 2.0)];
+             [path closePath];
+             [path setLineWidth:2.0];
+             [path stroke];
+             return YES;
+         }];
+         [endLineStyleButton setImage:image forSegment:kPDFLineStyleDiamond];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(20.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path moveToPoint:NSMakePoint(14.0, 3.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path lineToPoint:NSMakePoint(14.0, 9.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [startLineStyleButton setImage:image forSegment:kPDFLineStyleOpenArrow];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(4.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path moveToPoint:NSMakePoint(10.0, 3.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path lineToPoint:NSMakePoint(10.0, 9.0)];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [endLineStyleButton setImage:image forSegment:kPDFLineStyleOpenArrow];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(20.0, 6.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path moveToPoint:NSMakePoint(14.0, 3.0)];
+             [path lineToPoint:NSMakePoint(8.0, 6.0)];
+             [path lineToPoint:NSMakePoint(14.0, 9.0)];
+             [path closePath];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [startLineStyleButton setImage:image forSegment:kPDFLineStyleClosedArrow];
+         
+         image = [NSImage imageWithSize:size drawingHandler:^(NSRect rect){
+             NSBezierPath *path = [NSBezierPath bezierPath];
+             [path moveToPoint:NSMakePoint(4.0, 6.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path moveToPoint:NSMakePoint(10.0, 3.0)];
+             [path lineToPoint:NSMakePoint(16.0, 6.0)];
+             [path lineToPoint:NSMakePoint(10.0, 9.0)];
+             [path closePath];
+             [path setLineWidth:2.0];
+             [[NSColor blackColor] setStroke];
+             [path stroke];
+             return YES;
+         }];
+         [endLineStyleButton setImage:image forSegment:kPDFLineStyleClosedArrow];
+     }
+
+     - (void)notifyChangeAction:(SKLineChangeAction)action {
+         currentLineChangeAction = action;
+         
+         SEL selector = @selector(changeLineAttribute:);
+         NSWindow *mainWindow = [NSApp mainWindow];
+         NSResponder *responder = [mainWindow firstResponder];
+         
+         while (responder && [responder respondsToSelector:selector] == NO)
+             responder = [responder nextResponder];
+         
+         [responder performSelector:selector withObject:self];
+         
+         NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:action], ACTION_KEY, nil];
+         [[NSNotificationCenter defaultCenter] postNotificationName:SKLineInspectorLineAttributeDidChangeNotification object:self userInfo:userInfo];
+         
+         currentLineChangeAction = SKNoLineChangeAction;
+     }
+
+     #pragma mark Accessors
+
+     - (void)setLineWidth:(CGFloat)width {
+         if (fabs(lineWidth - width) > 0.00001) {
+             lineWidth = width;
+             [self notifyChangeAction:SKLineChangeActionLineWidth];
+         }
+     }
+
+     - (void)setStyle:(PDFBorderStyle)newStyle {
+         if (newStyle != style) {
+             style = newStyle;
+             [self notifyChangeAction:SKLineChangeActionStyle];
+         }
+     }
+
+     - (void)setDashPattern:(NSArray *)pattern {
+         if ([pattern isEqualToArray:dashPattern] == NO && (pattern || dashPattern)) {
+             [dashPattern release];
+             dashPattern = [pattern copy];
+             [self notifyChangeAction:SKLineChangeActionDashPattern];
+         }
+     }
+
+     - (void)setStartLineStyle:(PDFLineStyle)newStyle {
+         if (newStyle != startLineStyle) {
+             startLineStyle = newStyle;
+             [self notifyChangeAction:SKLineChangeActionStartLineStyle];
+         }
+     }
+
+     - (void)setEndLineStyle:(PDFLineStyle)newStyle {
+         if (newStyle != endLineStyle) {
+             endLineStyle = newStyle;
+             [self notifyChangeAction:SKLineChangeActionEndLineStyle];
+         }
+     }
+
+     - (void)setAnnotationStyle:(PDFAnnotation *)annotation {
+         NSString *type = [annotation type];
+         if ([type isEqualToString:SKNFreeTextString] || [type isEqualToString:SKNCircleString] || [type isEqualToString:SKNSquareString] || [type isEqualToString:SKNLineString] || [type isEqualToString:SKNInkString]) {
+             [self setLineWidth:[annotation border] ? [[annotation border] lineWidth] : 0.0];
+             [self setDashPattern:[[annotation border] dashPattern]];
+             [self setStyle:[annotation border] ? [[annotation border] style] : 0];
+         }
+         if ([type isEqualToString:SKNLineString]) {
+             [self setStartLineStyle:[(PDFAnnotationLine *)annotation startLineStyle]];
+             [self setEndLineStyle:[(PDFAnnotationLine *)annotation endLineStyle]];
+         }
+     }
+
+     - (void)setNilValueForKey:(NSString *)key {
+         if ([key isEqualToString:LINEWIDTH_KEY]) {
+             [self setValue:[NSNumber numberWithDouble:0.0] forKey:key];
+         } else if ([key isEqualToString:STYLE_KEY] || [key isEqualToString:STARTLINESTYLE_KEY] || [key isEqualToString:ENDLINESTYLE_KEY]) {
+             [self setValue:[NSNumber numberWithInteger:0] forKey:key];
+         } else {
+             [super setNilValueForKey:key];
+         }
+     }
+
+     */
+
+}

+ 16 - 0
PDF Office/PDF Master/Class/Common/LineInspector/KMNumberArrayFormatter.swift

@@ -0,0 +1,16 @@
+//
+//  KMNumberArrayFormatter.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/11/10.
+//
+
+import Cocoa
+
+//class KMNumberArrayFormatter: Formatter {
+//    override init() {
+//        super.init()
+//        
+//        
+//    }
+//}

+ 241 - 0
PDF Office/PDF Master/Class/Common/LineInspector/LineInspector.xib

@@ -0,0 +1,241 @@
+<?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">
+    <dependencies>
+        <deployment version="1070" 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="KMLineInspector" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="dashPatternField" destination="8" id="63"/>
+                <outlet property="dashPatternLabelField" destination="16" id="93"/>
+                <outlet property="endLineStyleButton" destination="52" id="62"/>
+                <outlet property="endLineStyleLabelField" destination="18" id="94"/>
+                <outlet property="labelField1" destination="7" id="Wy5-Pj-3Mi"/>
+                <outlet property="labelField2" destination="15" id="aEL-i1-fhs"/>
+                <outlet property="labelField3" destination="16" id="cBh-I2-bsn"/>
+                <outlet property="labelField4" destination="17" id="42S-At-d3Y"/>
+                <outlet property="labelField5" destination="18" id="OOx-fS-f6F"/>
+                <outlet property="lineWell" destination="69" id="70"/>
+                <outlet property="lineWidthField" destination="10" id="59"/>
+                <outlet property="lineWidthLabelField" destination="7" id="97"/>
+                <outlet property="lineWidthSlider" destination="12" id="58"/>
+                <outlet property="startLineStyleButton" destination="13" id="61"/>
+                <outlet property="startLineStyleLabelField" destination="17" id="95"/>
+                <outlet property="styleButton" destination="9" id="60"/>
+                <outlet property="styleLabelField" destination="15" id="96"/>
+                <outlet property="window" destination="5" id="36"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Lines" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Panel" customClass="NSPanel">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" utility="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="242" y="510" width="249" height="250"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <value key="minSize" type="size" width="213" height="113"/>
+            <view key="contentView" id="6">
+                <rect key="frame" x="0.0" y="0.0" width="249" height="250"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7">
+                        <rect key="frame" x="19" y="143" width="64" height="14"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Line Width:" id="78">
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField toolTip="Dash pattern as numbers separated by space" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8">
+                        <rect key="frame" x="88" y="93" width="151" height="19"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="79">
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                        <connections>
+                            <accessibilityConnection property="title" destination="16" id="72"/>
+                            <binding destination="-2" name="value" keyPath="dashPattern" id="141"/>
+                            <outlet property="formatter" destination="142" id="143"/>
+                            <outlet property="nextKeyView" destination="13" id="42"/>
+                        </connections>
+                    </textField>
+                    <segmentedControl verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9">
+                        <rect key="frame" x="86" y="117" width="155" height="20"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <segmentedCell key="cell" controlSize="small" borderStyle="border" alignment="left" segmentDistribution="fill" style="rounded" trackingMode="selectOne" id="80">
+                            <font key="font" metaFont="smallSystem"/>
+                            <segments>
+                                <segment imageScaling="none" width="29"/>
+                                <segment imageScaling="none" width="29" tag="1"/>
+                                <segment imageScaling="none" width="29" tag="2"/>
+                                <segment imageScaling="none" width="29" tag="3"/>
+                                <segment imageScaling="none" width="29" tag="4"/>
+                            </segments>
+                        </segmentedCell>
+                        <connections>
+                            <accessibilityConnection property="link" destination="8" id="100"/>
+                            <accessibilityConnection property="title" destination="15" id="76"/>
+                            <binding destination="-2" name="selectedTag" keyPath="style" id="47"/>
+                            <outlet property="nextKeyView" destination="8" id="41"/>
+                        </connections>
+                    </segmentedControl>
+                    <textField toolTip="Line width" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="10">
+                        <rect key="frame" x="217" y="143" width="22" height="19"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="81">
+                            <numberFormatter key="formatter" formatterBehavior="10_0" positiveFormat="0" negativeFormat="-0" localizesFormat="NO" hasThousandSeparators="NO" thousandSeparator="," id="11">
+                                <attributedString key="attributedStringForZero">
+                                    <fragment content="0"/>
+                                </attributedString>
+                                <decimal key="minimum" value="0"/>
+                                <real key="maximum" value="100"/>
+                            </numberFormatter>
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                        <connections>
+                            <accessibilityConnection property="title" destination="7" id="73"/>
+                            <binding destination="-2" name="value" keyPath="lineWidth" id="67">
+                                <dictionary key="options">
+                                    <integer key="NSContinuouslyUpdatesValue" value="1"/>
+                                </dictionary>
+                            </binding>
+                            <outlet property="nextKeyView" destination="9" id="40"/>
+                        </connections>
+                    </textField>
+                    <slider toolTip="Line width" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12">
+                        <rect key="frame" x="88" y="143" width="121" height="18"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <sliderCell key="cell" controlSize="small" alignment="left" maxValue="10" doubleValue="1" tickMarkPosition="above" numberOfTickMarks="11" allowsTickMarkValuesOnly="YES" sliderType="linear" id="82">
+                            <font key="font" size="12" name="Helvetica"/>
+                        </sliderCell>
+                        <connections>
+                            <accessibilityConnection property="link" destination="10" id="98"/>
+                            <accessibilityConnection property="link" destination="9" id="99"/>
+                            <accessibilityConnection property="title" destination="7" id="71"/>
+                            <binding destination="-2" name="value" keyPath="lineWidth" id="45"/>
+                            <outlet property="nextKeyView" destination="10" id="39"/>
+                        </connections>
+                    </slider>
+                    <segmentedControl verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="13">
+                        <rect key="frame" x="86" y="34" width="155" height="20"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <segmentedCell key="cell" controlSize="small" borderStyle="border" alignment="left" segmentDistribution="fill" style="rounded" trackingMode="selectOne" id="83">
+                            <font key="font" metaFont="smallSystem"/>
+                            <segments>
+                                <segment imageScaling="none" width="24"/>
+                                <segment imageScaling="none" width="24" tag="1"/>
+                                <segment imageScaling="none" width="24" tag="2"/>
+                                <segment imageScaling="none" width="24" tag="3"/>
+                                <segment imageScaling="none" width="24" tag="4"/>
+                                <segment imageScaling="none" width="24" tag="5"/>
+                            </segments>
+                        </segmentedCell>
+                        <connections>
+                            <accessibilityConnection property="link" destination="52" id="101"/>
+                            <accessibilityConnection property="title" destination="17" id="74"/>
+                            <binding destination="-2" name="selectedTag" keyPath="startLineStyle" id="49"/>
+                            <outlet property="nextKeyView" destination="52" id="53"/>
+                        </connections>
+                    </segmentedControl>
+                    <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="15">
+                        <rect key="frame" x="24" y="121" width="59" height="14"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Line Style:" id="84">
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="16">
+                        <rect key="frame" x="7" y="95" width="76" height="14"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Dash Pattern:" id="85">
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="17">
+                        <rect key="frame" x="50" y="38" width="33" height="14"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Start:" id="86">
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="18">
+                        <rect key="frame" x="55" y="13" width="28" height="14"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="End:" id="87">
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="31">
+                        <rect key="frame" x="7" y="170" width="235" height="14"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Line and Border Style" id="88">
+                            <font key="font" metaFont="smallSystemBold"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="32">
+                        <rect key="frame" x="7" y="62" width="235" height="14"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Line Ending Style" id="89">
+                            <font key="font" metaFont="smallSystemBold"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <box verticalHuggingPriority="750" fixedFrame="YES" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="34">
+                        <rect key="frame" x="10" y="82" width="229" height="5"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                    </box>
+                    <segmentedControl verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="52">
+                        <rect key="frame" x="86" y="9" width="155" height="20"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <segmentedCell key="cell" controlSize="small" borderStyle="border" alignment="left" segmentDistribution="fill" style="rounded" trackingMode="selectOne" id="90">
+                            <font key="font" metaFont="smallSystem"/>
+                            <segments>
+                                <segment imageScaling="none" width="24"/>
+                                <segment imageScaling="none" width="24" tag="1"/>
+                                <segment imageScaling="none" width="24" tag="2"/>
+                                <segment imageScaling="none" width="24" tag="3"/>
+                                <segment imageScaling="none" width="24" tag="4"/>
+                                <segment imageScaling="none" width="24" tag="5"/>
+                            </segments>
+                        </segmentedCell>
+                        <connections>
+                            <accessibilityConnection property="title" destination="18" id="75"/>
+                            <binding destination="-2" name="selectedTag" keyPath="endLineStyle" id="55"/>
+                            <outlet property="nextKeyView" destination="12" id="54"/>
+                        </connections>
+                    </segmentedControl>
+                    <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="69" customClass="SKLineWell">
+                        <rect key="frame" x="10" y="192" width="229" height="48"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                    </customView>
+                </subviews>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="37"/>
+                <outlet property="initialFirstResponder" destination="12" id="38"/>
+            </connections>
+            <point key="canvasLocation" x="139" y="131"/>
+        </window>
+        <customObject id="102" userLabel="Label Fields" customClass="SKIBArray"/>
+        <userDefaultsController representsSharedInstance="YES" id="138"/>
+        <customObject id="142" customClass="SKNumberArrayFormatter"/>
+    </objects>
+</document>

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Merge/Model/KMFileAttribute.swift

@@ -39,7 +39,7 @@ import Cocoa
             let document = CPDFDocument.init(url: URL(string: filePath))
             isLocked = document!.isLocked
             
-            fileImage = NSImage.previewForFile(path: URL(string: filePath)!, ofSize: CGSizeMake(136, 214), asIcon: true) ?? NSImage()
+            fileImage = NSImage.previewForFile(path: URL(fileURLWithPath: filePath), ofSize: CGSizeMake(136, 214), asIcon: true) ?? NSImage()
         }
     }
     

+ 13 - 6
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -959,12 +959,19 @@ extension KMPDFEditViewController {
         
 //        obj.editable = type == .custom
         if (type == .custom) {
-//            self.clearSelectPages()
-//            DispatchQueue.main.async {
-//                self.toolBar.pageRangeView?.stringValue = ""
-//                self.view.window?.makeFirstResponder(self.toolBar.pageRangeView?.textField)
-//            }
-            Swift.debugPrint("KMPDFEditViewController-km_comboBoxSelectionDidChange-custom ...")
+            let windowC = KMPDFEditPageRangeWindowController()
+            windowC.pdfDocument = self.pdfDocument
+            windowC.pageSelectCallBack = { [weak self] pagesArray in
+                var indexpaths = Set<IndexPath>()
+                for page in pagesArray {
+                    indexpaths.insert(IndexPath(item: page.intValue-1, section: 0))
+                }
+                
+                self?.selectPages(indexpaths: indexpaths)
+                self?.km_endSheet()
+            }
+            self.km_beginSheet(windowC: windowC)
+            
         } else {
             self.pageEditThumbnailView.selectPages(at: indexpaths)
         }

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/PageEdit/View/KMPDFEditToolbar.swift

@@ -419,7 +419,7 @@ extension KMPDFEditToolbar: KMToolbarViewDelegate {
 //            item?.toolTip = NSLocalizedString("pageRange", comment: "")
             item?.titleName = NSLocalizedString("Page Range", comment: "")
             item?.boxImagePosition = .imageExpandLeft
-            item?.btnAction = #selector(pageRangeMenuAction)
+//            item?.btnAction = #selector(pageRangeMenuAction)
             item?.needExpandAction = true
             
 //            let view = NSView()

+ 70 - 0
PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditPageRangeWindowController.swift

@@ -0,0 +1,70 @@
+//
+//  KMPDFEditPageRangeWindowController.swift
+//  PDF Master
+//
+//  Created by tangchao on 2023/11/10.
+//
+
+import Cocoa
+
+class KMPDFEditPageRangeWindowController: NSWindowController {
+    var pdfDocument: CPDFDocument?
+    var pageSelectCallBack: (([NSNumber]) -> Void)?
+    
+    @IBOutlet var pageRangeLabel: NSTextField!
+    @IBOutlet var pageRangeTextField: NSTextField!
+    @IBOutlet var totalPageCountLabel: NSTextField!
+    @IBOutlet var detailLabel: NSTextField!
+    @IBOutlet var cancelButton: NSButton!
+    @IBOutlet var okButton: NSButton!
+    
+    override var windowNibName: NSNib.Name? {
+        return "KMPDFEditPageRangeWindowController"
+    }
+    
+    deinit {
+        KMPrint("KMPDFEditPageRangeWindowController deinit.")
+    }
+    
+    override func windowDidLoad() {
+        super.windowDidLoad()
+    
+        self.pageRangeLabel.stringValue = KMLocalizedString("Page Range", nil)
+        self.pageRangeTextField.placeholderString = KMLocalizedString("e.g. 1,3-5,10", nil)
+    //    self.totalPageCountLabel.integerValue = self.pdfDocument.pageCount;
+        
+        self.totalPageCountLabel.stringValue = String(format: ", Total %ld Pages", self.pdfDocument?.pageCount ?? 0)
+        self.detailLabel.stringValue = ""
+        self.cancelButton.title = KMLocalizedString("Cancel", nil)
+        self.okButton.title = KMLocalizedString("OK", nil)
+        
+        self.window?.title = KMLocalizedString("Page Range", nil)
+    }
+    
+    @IBAction func buttonClicked_Cancel(_ sender: AnyObject?) {
+        if let win = self.window {
+            self.window?.sheetParent?.endSheet(win)
+        }
+    }
+
+    @IBAction func buttonClicked_Done(_ sender: AnyObject?) {
+        let fileAttribute = KMFileAttribute()
+        fileAttribute.filePath = self.pdfDocument?.documentURL.path ?? ""
+        fileAttribute.pdfDocument = self.pdfDocument
+        fileAttribute.bAllPage = false
+        fileAttribute.pagesString = self.pageRangeTextField.stringValue
+        
+        if fileAttribute.fetchSelectPages().isEmpty {
+            let alert = NSAlert()
+            alert.alertStyle = .critical
+            alert.messageText = String(format: "%@ %@", self.pdfDocument?.documentURL.lastPathComponent.lastPathComponent ?? "", KMLocalizedString("Invalid page range or the page number is out of range. Please try again.", nil))
+            alert.runModal()
+            self.window?.makeFirstResponder(self.pageRangeTextField)
+            return
+        } else {
+            if (self.pageSelectCallBack != nil) {
+                self.pageSelectCallBack!(fileAttribute.fetchSelectPages());
+            }
+        }
+    }
+}

+ 114 - 0
PDF Office/PDF Master/Class/PDFTools/PageEdit/Window/KMPDFEditPageRangeWindowController.xib

@@ -0,0 +1,114 @@
+<?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="KMPDFEditPageRangeWindowController" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="cancelButton" destination="olX-uy-ep7" id="kcv-1Z-NP6"/>
+                <outlet property="detailLabel" destination="3RZ-kO-gik" id="IWw-Iy-LGK"/>
+                <outlet property="okButton" destination="KWl-OO-JcO" id="TlR-ob-hvz"/>
+                <outlet property="pageRangeLabel" destination="CMW-TV-OdV" id="0S8-dj-GhZ"/>
+                <outlet property="pageRangeTextField" destination="8ZD-TC-XGF" id="ZQs-9o-eyL"/>
+                <outlet property="totalPageCountLabel" destination="bIJ-I9-uy4" id="Knn-Hc-PwO"/>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+            <rect key="contentRect" x="361" y="300" width="480" height="270"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <view key="contentView" misplaced="YES" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CMW-TV-OdV">
+                        <rect key="frame" x="22" y="99" width="76" height="16"/>
+                        <textFieldCell key="cell" lineBreakMode="clipping" title="page Range" id="elC-6i-Rgc">
+                            <font key="font" usesAppearanceFont="YES"/>
+                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8ZD-TC-XGF">
+                        <rect key="frame" x="24" y="73" width="160" height="21"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="160" id="V1x-tt-HYV"/>
+                        </constraints>
+                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="tOs-iR-0pw">
+                            <font key="font" metaFont="system"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3RZ-kO-gik">
+                        <rect key="frame" x="22" y="53" width="436" height="16"/>
+                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="YJa-bt-CHv">
+                            <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>
+                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="olX-uy-ep7">
+                        <rect key="frame" x="323" y="11" width="75" height="32"/>
+                        <buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="uZv-JV-YYf">
+                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                            <font key="font" metaFont="system"/>
+                        </buttonCell>
+                        <connections>
+                            <action selector="buttonClicked_Cancel:" target="-2" id="249-vv-rey"/>
+                        </connections>
+                    </button>
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bIJ-I9-uy4">
+                        <rect key="frame" x="190" y="76" width="37" height="16"/>
+                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="aQg-cT-Dgr">
+                            <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>
+                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KWl-OO-JcO">
+                        <rect key="frame" x="398" y="11" width="75" height="32"/>
+                        <buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kgK-UK-CkY">
+                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                            <font key="font" metaFont="system"/>
+                            <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                        </buttonCell>
+                        <connections>
+                            <action selector="buttonClicked_Done:" target="-2" id="OsZ-6c-Ut5"/>
+                        </connections>
+                    </button>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="KWl-OO-JcO" firstAttribute="centerY" secondItem="olX-uy-ep7" secondAttribute="centerY" id="4SE-2M-jxp"/>
+                    <constraint firstItem="olX-uy-ep7" firstAttribute="top" secondItem="3RZ-kO-gik" secondAttribute="bottom" constant="15" id="Dn8-bC-iIC"/>
+                    <constraint firstItem="CMW-TV-OdV" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="24" id="HM1-28-hRI"/>
+                    <constraint firstItem="CMW-TV-OdV" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="20" id="ISk-Cl-bCf"/>
+                    <constraint firstItem="3RZ-kO-gik" firstAttribute="top" secondItem="8ZD-TC-XGF" secondAttribute="bottom" constant="4" id="JLS-Zp-kZN"/>
+                    <constraint firstItem="3RZ-kO-gik" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="LUC-Hq-kaG"/>
+                    <constraint firstItem="KWl-OO-JcO" firstAttribute="leading" secondItem="olX-uy-ep7" secondAttribute="trailing" constant="14" id="OTV-if-uLn"/>
+                    <constraint firstAttribute="trailing" secondItem="KWl-OO-JcO" secondAttribute="trailing" constant="14" id="SmZ-Bz-iJg"/>
+                    <constraint firstItem="3RZ-kO-gik" firstAttribute="leading" secondItem="CMW-TV-OdV" secondAttribute="leading" id="UgH-cZ-hQb"/>
+                    <constraint firstItem="8ZD-TC-XGF" firstAttribute="top" secondItem="CMW-TV-OdV" secondAttribute="bottom" constant="5" id="Vdo-1P-NdJ"/>
+                    <constraint firstAttribute="bottom" secondItem="olX-uy-ep7" secondAttribute="bottom" constant="18" id="XI5-py-CNL"/>
+                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="CMW-TV-OdV" secondAttribute="trailing" constant="24" id="klE-fb-CHj"/>
+                    <constraint firstItem="8ZD-TC-XGF" firstAttribute="leading" secondItem="CMW-TV-OdV" secondAttribute="leading" id="nI1-9g-GxC"/>
+                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="bIJ-I9-uy4" secondAttribute="trailing" constant="24" id="oZI-wi-ZSP"/>
+                    <constraint firstItem="bIJ-I9-uy4" firstAttribute="leading" secondItem="8ZD-TC-XGF" secondAttribute="trailing" constant="8" id="tMg-IA-giq"/>
+                    <constraint firstItem="bIJ-I9-uy4" firstAttribute="centerY" secondItem="8ZD-TC-XGF" secondAttribute="centerY" id="tdJ-f8-zkM"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="-208" y="83"/>
+        </window>
+    </objects>
+</document>

+ 19 - 13
PDF Office/PDF Master/Class/Preference/View/KMLineWell.swift

@@ -268,7 +268,7 @@ class KMLineWell: NSControl {
         
         if self.refusesFirstResponder == false && NSApp.isActive && self.window!.isKeyWindow && self.window!.firstResponder == self {
             NSGraphicsContext.saveGraphicsState()
-//            NSSetFocusRingStyle(NSFocusRingOnly);
+            NSFocusRingPlacement.only.set()
             bounds.fill()
             NSGraphicsContext.restoreGraphicsState()
         }
@@ -329,7 +329,16 @@ class KMLineWell: NSControl {
         }
     }
     
-   
+    override func performClick(_ sender: Any?) {
+        if (self.isEnabled) {
+            if (self.isActive) {
+                self._deactivate()
+            } else {
+                self._activate(true)
+            }
+        }
+    }
+    
     
     /*
 
@@ -369,14 +378,7 @@ class KMLineWell: NSControl {
          [[info objectForKey:NSObservedObjectKey] setValue:[self valueForKey:key] forKeyPath:[info objectForKey:NSObservedKeyPathKey]];
      }
 
-     - (void)performClick:(id)sender {
-         if ([self isEnabled]) {
-             if ([self isActive])
-                 [self deactivate];
-             else
-                 [self activate:YES];
-         }
-     }
+
 
      - (void)lineInspectorWindowWillClose:(NSNotification *)notification {
          [self deactivate];
@@ -600,6 +602,8 @@ extension KMLineWell {
         __lwFlags.canActivate = true
         __lwFlags.existsActiveLineWell = 0
         
+        self.isEnabled = true
+        
 //        [self registerForDraggedTypes:[NSArray arrayWithObjects:SKPasteboardTypeLineStyle, nil]];
     }
     
@@ -613,8 +617,9 @@ extension KMLineWell {
     }
     
     private func _changedValue(forKey key: String) {
-//        if ([self isActive])
-    //        [[SKLineInspector sharedLineInspector] setValue:[self valueForKey:key] forKey:key];
+        if (self.isActive) {
+            //        [[SKLineInspector sharedLineInspector] setValue:[self valueForKey:key] forKey:key];
+        }
         self.needsDisplay = true
     }
     
@@ -732,7 +737,7 @@ extension KMLineWell {
     private func _activate(_ exclusive: Bool) {
         if (self.canActivate) {
             let nc = NotificationCenter.default
-    //        SKLineInspector *inspector = [SKLineInspector sharedLineInspector];
+            let inspector = KMLineInspector.shared
             
             __lwFlags.existsActiveLineWell = 0
             
@@ -756,6 +761,7 @@ extension KMLineWell {
                 }
             }
     //        [[inspector window] orderFront:self];
+            inspector.window?.orderFront(self)
             
             nc.addObserver(self, selector: #selector(_lineWellWillBecomeActive), name: NSNotification.Name(SKLineWellWillBecomeActiveNotification), object: nil)
     //        [nc addObserver:self selector:@selector(lineInspectorWindowWillClose:)