Browse Source

【OCToSwift】KMPopUpButton

lizhe 1 year ago
parent
commit
348b4461f4

+ 8 - 10
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -214,9 +214,6 @@
 		89E4E6F52963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6F42963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.m */; };
 		89E4E6F62963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6F42963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.m */; };
 		89E4E6F72963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6F42963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.m */; };
-		89E4E6FB2963D341002DBA6F /* KMPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6F92963D341002DBA6F /* KMPopUpButton.m */; };
-		89E4E6FC2963D341002DBA6F /* KMPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6F92963D341002DBA6F /* KMPopUpButton.m */; };
-		89E4E6FD2963D341002DBA6F /* KMPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 89E4E6F92963D341002DBA6F /* KMPopUpButton.m */; };
 		89E4E70B2963D62B002DBA6F /* KMAnnotationFontWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */; };
 		89E4E70C2963D62B002DBA6F /* KMAnnotationFontWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */; };
 		89E4E70D2963D62C002DBA6F /* KMAnnotationFontWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */; };
@@ -1861,6 +1858,9 @@
 		ADDEEA722AD3EFE200EF675D /* KMButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADDEEA712AD3EFE200EF675D /* KMButton.swift */; };
 		ADDEEA732AD3EFE200EF675D /* KMButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADDEEA712AD3EFE200EF675D /* KMButton.swift */; };
 		ADDEEA742AD3EFE200EF675D /* KMButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADDEEA712AD3EFE200EF675D /* KMButton.swift */; };
+		ADDEEA7A2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADDEEA792AD3F4C800EF675D /* KMPopUpButton.swift */; };
+		ADDEEA7B2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADDEEA792AD3F4C800EF675D /* KMPopUpButton.swift */; };
+		ADDEEA7C2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADDEEA792AD3F4C800EF675D /* KMPopUpButton.swift */; };
 		ADE3C19F29A3894900793B13 /* KMSearchTableRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE3C19E29A3894900793B13 /* KMSearchTableRowView.swift */; };
 		ADE3C1A029A3894900793B13 /* KMSearchTableRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE3C19E29A3894900793B13 /* KMSearchTableRowView.swift */; };
 		ADE3C1A129A3894900793B13 /* KMSearchTableRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE3C19E29A3894900793B13 /* KMSearchTableRowView.swift */; };
@@ -3582,8 +3582,6 @@
 		89E4E6EB2963D1B7002DBA6F /* KMColorPickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMColorPickerViewController.h; sourceTree = "<group>"; };
 		89E4E6F32963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMAnnotationPropertiesColorManager.h; sourceTree = "<group>"; };
 		89E4E6F42963D1E9002DBA6F /* KMAnnotationPropertiesColorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMAnnotationPropertiesColorManager.m; sourceTree = "<group>"; };
-		89E4E6F92963D341002DBA6F /* KMPopUpButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMPopUpButton.m; sourceTree = "<group>"; };
-		89E4E6FA2963D341002DBA6F /* KMPopUpButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMPopUpButton.h; sourceTree = "<group>"; };
 		89E4E7082963D62B002DBA6F /* KMAnnotationFontWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMAnnotationFontWindowController.h; sourceTree = "<group>"; };
 		89E4E7092963D62B002DBA6F /* KMAnnotationFontWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMAnnotationFontWindowController.xib; sourceTree = "<group>"; };
 		89E4E70A2963D62B002DBA6F /* KMAnnotationFontWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMAnnotationFontWindowController.m; sourceTree = "<group>"; };
@@ -4205,6 +4203,7 @@
 		ADDEEA692AD3CF3A00EF675D /* KMDrawView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMDrawView.swift; sourceTree = "<group>"; };
 		ADDEEA6D2AD3E16100EF675D /* KMSigntureViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMSigntureViewItem.swift; sourceTree = "<group>"; };
 		ADDEEA712AD3EFE200EF675D /* KMButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMButton.swift; sourceTree = "<group>"; };
+		ADDEEA792AD3F4C800EF675D /* KMPopUpButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPopUpButton.swift; sourceTree = "<group>"; };
 		ADE3C19E29A3894900793B13 /* KMSearchTableRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMSearchTableRowView.swift; sourceTree = "<group>"; };
 		ADE3C1A929A4779E00793B13 /* KMPrintAccessoryController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPrintAccessoryController.swift; sourceTree = "<group>"; };
 		ADE3C1AA29A4779E00793B13 /* KMPrintAccessoryController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPrintAccessoryController.xib; sourceTree = "<group>"; };
@@ -5339,8 +5338,7 @@
 			isa = PBXGroup;
 			children = (
 				ADDEEA712AD3EFE200EF675D /* KMButton.swift */,
-				89E4E6FA2963D341002DBA6F /* KMPopUpButton.h */,
-				89E4E6F92963D341002DBA6F /* KMPopUpButton.m */,
+				ADDEEA792AD3F4C800EF675D /* KMPopUpButton.swift */,
 				89E4E7202963FB23002DBA6F /* KMGeneralButton.h */,
 				89E4E7212963FB23002DBA6F /* KMGeneralButton.m */,
 				89E4E7172963F5D3002DBA6F /* KMSelfSignAnnotation.h */,
@@ -10645,6 +10643,7 @@
 				9FCFECA02AD17B8A00EAD2CB /* SKProgressController.swift in Sources */,
 				89D9897428FE743E003A3E87 /* KMOutlineView.swift in Sources */,
 				BB6719F92AD2CC05003D44D5 /* CPDFSignatureWidgetAnnotation+PDFListView.swift in Sources */,
+				ADDEEA7A2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
 				ADC63E482A49BEDD00854E02 /* KMSubscribeWaterMarkCollectionItem.swift in Sources */,
 				89752E1D2942CB03003FF08E /* KMSearchMode.swift in Sources */,
 				AD3A3587294C11ED00D72802 /* KMPrintPreviewPresenter.swift in Sources */,
@@ -10969,7 +10968,6 @@
 				ADBC375D29CC61E100D93208 /* KMReadModelView.swift in Sources */,
 				BB6013902AD3AFF000A76FB2 /* NSPopover+KMExtension.swift in Sources */,
 				BB2EDF79296ECE17003BCF58 /* KMPageEditThumbnailItem.swift in Sources */,
-				89E4E6FB2963D341002DBA6F /* KMPopUpButton.m in Sources */,
 				899700E828F3E4D3009AF911 /* MainWindowController.swift in Sources */,
 				BB6DD81C29348F31001F0544 /* KMSecureTextFiled.swift in Sources */,
 				BB8F4572295ACE380037EA22 /* KMHeaderFooterAdjectiveListCell.swift in Sources */,
@@ -11382,6 +11380,7 @@
 				BBC745EB295F067B0072C2ED /* KMCropSettingWindowController.swift in Sources */,
 				ADCB98C62924730000B51A03 /* KMBatchProcessingTableViewModel.swift in Sources */,
 				89E4E73F2964160F002DBA6F /* KMAnnotationLinkViewController.m in Sources */,
+				ADDEEA7B2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
 				BBC3480D29558DC1008D2CD1 /* KMBackgroundController.swift in Sources */,
 				BB6DD8262934D056001F0544 /* KMSecureEncryptSuccessTipView.swift in Sources */,
 				89E4E77A2967B370002DBA6F /* KMDynamicStampViewController.m in Sources */,
@@ -11772,7 +11771,6 @@
 				BB49ED16293F489500C82CA2 /* KMConvertImageSettingView.swift in Sources */,
 				ADBC375E29CC61E100D93208 /* KMReadModelView.swift in Sources */,
 				BB2EDF7A296ECE17003BCF58 /* KMPageEditThumbnailItem.swift in Sources */,
-				89E4E6FC2963D341002DBA6F /* KMPopUpButton.m in Sources */,
 				9FBA0EF628FFC8A0001117AF /* KMCollectionView.swift in Sources */,
 				ADD1B7072946CBB600C3FFF7 /* KMBaseTextFormatter.swift in Sources */,
 				BB8F4573295ACE380037EA22 /* KMHeaderFooterAdjectiveListCell.swift in Sources */,
@@ -12750,7 +12748,6 @@
 				9F8DDF2829237910006CDC73 /* Array+KMExtensions.swift in Sources */,
 				9F0CB5172986566D00007028 /* KMDesignToken+BorderRadiusTopLeft.swift in Sources */,
 				BBBB6CCC2AD109F30035AA66 /* CPDFAnnotation+PDFListView.swift in Sources */,
-				89E4E6FD2963D341002DBA6F /* KMPopUpButton.m in Sources */,
 				BB49ECDF293EED6100C82CA2 /* KMConvertWordWindowController.swift in Sources */,
 				BBE0BDF529A22EF300440583 /* KMMainViewController+MenuAction.swift in Sources */,
 				8942F7EB2925E1C400389627 /* KMLiftSideCellView.swift in Sources */,
@@ -12758,6 +12755,7 @@
 				9F02016C2A1B088700C9B673 /* KMAIOpenPDFFilesVC.swift in Sources */,
 				9F1F82D4292F6D510092C4B4 /* KMPDFInsertPreviewViewController.swift in Sources */,
 				ADB1FE7029752BB700ED072D /* KMBatchConvertPDFView.swift in Sources */,
+				ADDEEA7C2AD3F4C800EF675D /* KMPopUpButton.swift in Sources */,
 				9F705F8F291E579F005199AD /* KMHistoryFileTableView.swift in Sources */,
 				9F0CB4812967F64D00007028 /* KMPropertiesPanelReadOnlySubVC.swift in Sources */,
 				9F0CB53B2986570600007028 /* KMDesignToken+BoxShadow.swift in Sources */,

+ 41 - 41
PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -8303,10 +8303,10 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2036"
-            endingLineNumber = "2036"
-            landmarkName = "KMGeneralAnnotationViewController"
-            landmarkType = "3">
+            startingLineNumber = "2035"
+            endingLineNumber = "2035"
+            landmarkName = "-annotationChangeNotification:"
+            landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -8319,8 +8319,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2049"
-            endingLineNumber = "2049"
+            startingLineNumber = "2048"
+            endingLineNumber = "2048"
             landmarkName = "-popoverWillShow:"
             landmarkType = "7">
             <Locations>
@@ -8412,8 +8412,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2093"
-            endingLineNumber = "2093"
+            startingLineNumber = "2092"
+            endingLineNumber = "2092"
             landmarkName = "-km_comboBoxSelectionDidChange:"
             landmarkType = "7">
             <Locations>
@@ -8505,8 +8505,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2084"
-            endingLineNumber = "2084"
+            startingLineNumber = "2083"
+            endingLineNumber = "2083"
             landmarkName = "-km_comboBoxSelectionDidChange:"
             landmarkType = "7">
             <Locations>
@@ -8598,8 +8598,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2069"
-            endingLineNumber = "2069"
+            startingLineNumber = "2068"
+            endingLineNumber = "2068"
             landmarkName = "-km_comboBoxSelectionDidChange:"
             landmarkType = "7">
             <Locations>
@@ -8691,8 +8691,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2110"
-            endingLineNumber = "2110"
+            startingLineNumber = "2109"
+            endingLineNumber = "2109"
             landmarkName = "-km_comboBoxSelectionDidChange:"
             landmarkType = "7">
             <Locations>
@@ -8784,9 +8784,9 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2232"
-            endingLineNumber = "2232"
-            landmarkName = "-resetTextPresuppositionData"
+            startingLineNumber = "2231"
+            endingLineNumber = "2231"
+            landmarkName = "-updateTextPresupposition:size:needChangeListView:"
             landmarkType = "7">
             <Locations>
                <Location
@@ -8877,8 +8877,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2225"
-            endingLineNumber = "2225"
+            startingLineNumber = "2224"
+            endingLineNumber = "2224"
             landmarkName = "-updateTextPresupposition:size:needChangeListView:"
             landmarkType = "7">
             <Locations>
@@ -8970,10 +8970,10 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2205"
-            endingLineNumber = "2205"
-            landmarkName = "-updateTextPresupposition:needChangeListView:"
-            landmarkType = "7">
+            startingLineNumber = "2204"
+            endingLineNumber = "2204"
+            landmarkName = "KMGeneralAnnotationViewController(Font)"
+            landmarkType = "3">
             <Locations>
                <Location
                   uuid = "6587786D-9FE4-4185-8EBF-43F8E1553692 - a54da4d559a2405"
@@ -9063,8 +9063,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2196"
-            endingLineNumber = "2196"
+            startingLineNumber = "2195"
+            endingLineNumber = "2195"
             landmarkName = "-updateTextTextPresuppositionState:size:"
             landmarkType = "7">
             <Locations>
@@ -9264,8 +9264,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1016"
-            endingLineNumber = "1016"
+            startingLineNumber = "1015"
+            endingLineNumber = "1015"
             landmarkName = "-updateAnnotation"
             landmarkType = "7">
             <Locations>
@@ -9327,10 +9327,10 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1970"
-            endingLineNumber = "1970"
-            landmarkName = "-textAnnotationStyleAction:"
-            landmarkType = "7">
+            startingLineNumber = "1969"
+            endingLineNumber = "1969"
+            landmarkName = "KMGeneralAnnotationViewController"
+            landmarkType = "3">
             <Locations>
                <Location
                   uuid = "E125D63F-7F74-4267-ACFC-5DCE91770F6E - 4048455193cadab8"
@@ -9405,8 +9405,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2320"
-            endingLineNumber = "2320"
+            startingLineNumber = "2319"
+            endingLineNumber = "2319"
             landmarkName = "-updateFontSize:needChangeListView:needSave:"
             landmarkType = "7">
             <Locations>
@@ -9498,8 +9498,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2264"
-            endingLineNumber = "2264"
+            startingLineNumber = "2263"
+            endingLineNumber = "2263"
             landmarkName = "-updateFontNameAndStyle:style:needChangeListView:needSave:"
             landmarkType = "7">
             <Locations>
@@ -9996,8 +9996,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "534"
-            endingLineNumber = "534"
+            startingLineNumber = "533"
+            endingLineNumber = "533"
             landmarkName = "-configureUIView"
             landmarkType = "7">
             <Locations>
@@ -13227,8 +13227,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureWindowController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "317"
-            endingLineNumber = "317"
+            startingLineNumber = "316"
+            endingLineNumber = "316"
             landmarkName = "-windowDidLoad"
             landmarkType = "7">
             <Locations>
@@ -13275,8 +13275,8 @@
             filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureWindowController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "326"
-            endingLineNumber = "326"
+            startingLineNumber = "325"
+            endingLineNumber = "325"
             landmarkName = "-windowDidLoad"
             landmarkType = "7">
          </BreakpointContent>

+ 1 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m

@@ -7,7 +7,6 @@
 
 #import "KMGeneralAnnotationViewController.h"
 #import "KMColorPickerViewController.h"
-#import "KMPopUpButton.h"
 #import "KMAnnotationFontWindowController.h"
 #import "KMSelfSignAnnotation.h"
 #import "KMSelfSignAnnotationFreeText.h"
@@ -441,7 +440,7 @@
         self.fillColorPickerVC.isFreeText = NO;
     }
     
-    _datePopupButton.type = KMPopUpButtonType_ArrowUpDown;
+    _datePopupButton.type = KMPopUpButtonTypeArrowUpDown;
     
     self.generalImageView.image = [self.annotationModel annotationImage];
     if (CAnnotationTypeSignFalse != _annotationType &&

+ 0 - 25
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/View/KMPopUpButton.h

@@ -1,25 +0,0 @@
-//
-//  KMPopUpButton.h
-//  SignFlow
-//
-//  Created by wanjun on 2021/1/14.
-//
-
-#import <Cocoa/Cocoa.h>
-
-typedef NS_ENUM(NSUInteger, KMPopUpButtonType) {
-    KMPopUpButtonType_Table = 0,
-    KMPopUpButtonType_ArrowDown,
-    KMPopUpButtonType_ArrowUpDown,
-    KMPopUpButtonType_NoArrow
-};
-
-@interface KMPopUpButton : NSPopUpButton
-
-@property (nonatomic, assign) KMPopUpButtonType type;
-
-@end
-
-@interface KMPopUpButtonCell : NSPopUpButtonCell
-
-@end

+ 0 - 90
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/View/KMPopUpButton.m

@@ -1,90 +0,0 @@
-//
-//  KMPopUpButton.m
-//  SignFlow
-//
-//  Created by wanjun on 2021/1/14.
-//
-
-#import "KMPopUpButton.h"
-
-@implementation KMPopUpButton
-
-- (id)initWithFrame:(NSRect)frame
-{
-   self = [super initWithFrame:frame];
-   if (self) {
-       // Initialization code here.
-   }
-   return self;
-}
--(BOOL) isFlipped
-{
-   return YES;
-}
-
-- (void)drawRect:(NSRect)dirtyRect {
-    [super drawRect:dirtyRect];
-    
-    NSImage *image = [NSImage imageNamed:@"KMImageNameUXIconBtnArrowDown"];;
-    if (_type == KMPopUpButtonType_ArrowUpDown) {
-        image = [NSImage imageNamed:@"KMImageNameUXIconBtnArrowUpdown"];
-    }
-    NSRect rect =NSZeroRect;
-    rect.size = image.size;
-    NSPoint p = dirtyRect.origin;
-    p.x +=dirtyRect.size.width - rect.size.width - 1;
-    p.y +=(dirtyRect.size.height-rect.size.height)/2;
-    if(_type == KMPopUpButtonType_NoArrow) {
-        p.x =(dirtyRect.size.width - rect.size.width)/2;
-    }
-    [image drawInRect:NSMakeRect(p.x , p.y, image.size.width, image.size.width) fromRect:rect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
-}
-
-#pragma mark - Private Methods
-
-- (void)setType:(KMPopUpButtonType)type {
-    _type = type;
-    switch (type) {
-        case KMPopUpButtonType_Table:
-        case KMPopUpButtonType_ArrowDown:
-        case KMPopUpButtonType_ArrowUpDown:
-        {
-            self.wantsLayer = YES;
-            self.layer.borderWidth = 1.0;
-            self.layer.cornerRadius = 4.0;
-            self.layer.borderColor = [NSColor colorWithRed:223.0/255.0 green:225.0/255.0 blue:229.0/255.0 alpha:1].CGColor;
-            self.layer.backgroundColor = [NSColor whiteColor].CGColor;
-            self.bezelStyle = NSBezelStyleShadowlessSquare;
-            self.bordered = NO;
-        }
-            break;
-            
-        default:
-            break;
-    }
-}
-
-@end
-
-@implementation KMPopUpButtonCell
-
-- (NSRect)adjustedFrameToVerticallyCenterText:(NSRect)frame
-{
-    NSInteger offset = floor((NSHeight(frame)/2 - ([[self font] ascender] + [[self font] descender])));
-    return NSInsetRect(frame, 0.0, offset);
-}
-- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)editor delegate:(id)delegate event:(NSEvent *)event
-{
-    [super editWithFrame:[self adjustedFrameToVerticallyCenterText:aRect] inView:controlView editor:editor delegate:delegate event:event];
-}
-- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)editor delegate:(id)delegate start:(NSInteger)start length:(NSInteger)length
-{
-    [super selectWithFrame:[self adjustedFrameToVerticallyCenterText:aRect] inView:controlView editor:editor delegate:delegate start:start length:length];
-}
-- (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)view
-{
-    [super drawInteriorWithFrame:
-    [self adjustedFrameToVerticallyCenterText:frame] inView:view];
-}
-
-@end

+ 76 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/View/KMPopUpButton.swift

@@ -0,0 +1,76 @@
+//
+//  KMPopUpButton.swift
+//  PDF Master
+//
+//  Created by lizhe on 2023/10/9.
+//
+
+import Cocoa
+
+@objc enum KMPopUpButtonType: Int {
+    case table = 0
+    case arrowDown = 1
+    case arrowUpDown = 2
+    case noArrow = 3
+}
+
+@objcMembers class KMPopUpButton: NSPopUpButton {
+    var type: KMPopUpButtonType = .arrowUpDown {
+        didSet {
+            switch type {
+            case .table, .arrowDown, .arrowUpDown:
+                wantsLayer = true
+                layer?.borderWidth = 1.0
+                layer?.cornerRadius = 4.0
+                layer?.borderColor = NSColor(red: 223.0/255.0, green: 225.0/255.0, blue: 229.0/255.0, alpha: 1).cgColor
+                layer?.backgroundColor = NSColor.white.cgColor
+                bezelStyle = .shadowlessSquare
+            case .noArrow:
+                break
+            }
+        }
+    }
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+        
+        var imageName = "KMImageNameUXIconBtnArrowDown"
+        if type == .arrowUpDown {
+            imageName = "KMImageNameUXIconBtnArrowUpdown"
+        }
+        
+        if type != .noArrow {
+            if let image = NSImage(named: imageName) {
+                let rect = NSZeroRect
+                var p = dirtyRect.origin
+                p.x += dirtyRect.size.width - image.size.width - 1
+                p.y += (dirtyRect.size.height - image.size.height) / 2
+                
+                if type == .noArrow {
+                    p.x = (dirtyRect.size.width - image.size.width) / 2
+                }
+                
+                image.draw(in: NSRect(origin: NSMakePoint(p.x, p.y), size: image.size), from: rect, operation: .sourceOver, fraction: 1.0, respectFlipped: true, hints: nil)
+            }
+        }
+    }
+}
+
+class KMPopUpButtonCell: NSPopUpButtonCell {
+    override func edit(withFrame cellFrame: NSRect, in controlView: NSView, editor textObj: NSText, delegate: Any?, event: NSEvent?) {
+        super.edit(withFrame: adjustedFrameToVerticallyCenterText(cellFrame), in: controlView, editor: textObj, delegate: delegate, event: event)
+    }
+    
+    override func select(withFrame cellFrame: NSRect, in controlView: NSView, editor textObj: NSText, delegate: Any?, start selStart: Int, length selLength: Int) {
+        super.select(withFrame: adjustedFrameToVerticallyCenterText(cellFrame), in: controlView, editor: textObj, delegate: delegate, start: selStart, length: selLength)
+    }
+    
+    override func drawInterior(withFrame cellFrame: NSRect, in controlView: NSView) {
+        super.drawInterior(withFrame: adjustedFrameToVerticallyCenterText(cellFrame), in: controlView)
+    }
+    
+    private func adjustedFrameToVerticallyCenterText(_ frame: NSRect) -> NSRect {
+        let offset = floor((frame.size.height / 2 - (font!.ascender + font!.descender)))
+        return frame.insetBy(dx: 0.0, dy: offset)
+    }
+}

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/Signature/KMSignatureWindowController.m

@@ -8,7 +8,6 @@
 
 #import "KMSignatureWindowController.h"
 #import "NSImage+CustomImage.h"
-#import "KMPopUpButton.h"
 #import "CPDFListView.h"
 #import <PDF_Master-Swift.h>
 

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/StampList/KMAnnotationStampViewController.m

@@ -6,7 +6,6 @@
 //
 
 #import "KMAnnotationStampViewController.h"
-#import "KMPopUpButton.h"
 #import "KMStampManager.h"
 #import "KMCustomizeStampViewController.h"
 #import "KMDynamicStampViewController.h"

+ 0 - 1
PDF Office/PDF Master/PDF_Master DMG-Bridging-Header.h

@@ -27,7 +27,6 @@
 
 #import "CPDFListView+Tool.h"
 #import "NSBitmapImageRep_SKExtensions.h"
-#import "KMPopUpButton.h"
 #import <Masonry/Masonry.h>
 #import "TextFieldFormatter.h"
 #import "KMPDFEditAppendWindow.h"

+ 0 - 1
PDF Office/PDF Master/PDF_Master-Bridging-Header.h

@@ -28,7 +28,6 @@
 
 #import "CPDFListView+Tool.h"
 #import "NSBitmapImageRep_SKExtensions.h"
-#import "KMPopUpButton.h"
 #import <Masonry/Masonry.h>
 #import "TextFieldFormatter.h"
 #import "KMPDFEditAppendWindow.h"