Browse Source

【文字图片编辑】排列UI 组件化

lizhe 1 year ago
parent
commit
62f94e359b

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

@@ -1579,6 +1579,12 @@
 		ADC25DFC2923BA710080A3F6 /* KMImageToPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC25DF82923BA710080A3F6 /* KMImageToPDFWindowController.xib */; };
 		ADC25DFD2923BA710080A3F6 /* KMImageToPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC25DF82923BA710080A3F6 /* KMImageToPDFWindowController.xib */; };
 		ADC25DFE2923BA710080A3F6 /* KMImageToPDFWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC25DF82923BA710080A3F6 /* KMImageToPDFWindowController.xib */; };
+		ADC31FA62A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC31FA52A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift */; };
+		ADC31FA72A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC31FA52A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift */; };
+		ADC31FA82A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC31FA52A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift */; };
+		ADC31FAC2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC31FAB2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib */; };
+		ADC31FAD2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC31FAB2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib */; };
+		ADC31FAE2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADC31FAB2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib */; };
 		ADC6FC19297630BA00D7C274 /* KMBatchProcessingColumnHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC6FC18297630BA00D7C274 /* KMBatchProcessingColumnHeaderCell.swift */; };
 		ADC6FC1A297630BA00D7C274 /* KMBatchProcessingColumnHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC6FC18297630BA00D7C274 /* KMBatchProcessingColumnHeaderCell.swift */; };
 		ADC6FC1B297630BA00D7C274 /* KMBatchProcessingColumnHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC6FC18297630BA00D7C274 /* KMBatchProcessingColumnHeaderCell.swift */; };
@@ -3960,6 +3966,8 @@
 		ADC07623298CB805006C752F /* KMBatchSettingItemViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchSettingItemViewModel.swift; sourceTree = "<group>"; };
 		ADC25DF72923BA710080A3F6 /* KMImageToPDFWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMImageToPDFWindowController.swift; sourceTree = "<group>"; };
 		ADC25DF82923BA710080A3F6 /* KMImageToPDFWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMImageToPDFWindowController.xib; sourceTree = "<group>"; };
+		ADC31FA52A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMEditPropertyAlignmentView.swift; sourceTree = "<group>"; };
+		ADC31FAB2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMEditPropertyAlignmentView.xib; sourceTree = "<group>"; };
 		ADC6FC18297630BA00D7C274 /* KMBatchProcessingColumnHeaderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchProcessingColumnHeaderCell.swift; sourceTree = "<group>"; };
 		ADC6FC582976953900D7C274 /* Batch.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Batch.xcassets; sourceTree = "<group>"; };
 		ADCB98C0292472F200B51A03 /* KMBatchProcessingTableViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMBatchProcessingTableViewPresenter.swift; sourceTree = "<group>"; };
@@ -4962,6 +4970,7 @@
 		8996CFE4295BE15800D32783 /* EditPDF */ = {
 			isa = PBXGroup;
 			children = (
+				ADC31FA92A0E0C1E00ED44A2 /* View */,
 				89D2D306295A83B500BFF5FE /* KMEditPDFTextPropertyViewController.swift */,
 				89E9B3F8295BE2EC00AEFA61 /* KMEditPDFTextPropertyViewController.xib */,
 				89E9B404295D268E00AEFA61 /* KMEditImagePropertyViewController.swift */,
@@ -6638,6 +6647,23 @@
 			path = KMBatchProcessingTableViewModel;
 			sourceTree = "<group>";
 		};
+		ADC31FA92A0E0C1E00ED44A2 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				ADC31FAA2A0E0C2500ED44A2 /* AlignmentView */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
+		ADC31FAA2A0E0C2500ED44A2 /* AlignmentView */ = {
+			isa = PBXGroup;
+			children = (
+				ADC31FA52A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift */,
+				ADC31FAB2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib */,
+			);
+			path = AlignmentView;
+			sourceTree = "<group>";
+		};
 		ADCB98FA29274B8D00B51A03 /* Views */ = {
 			isa = PBXGroup;
 			children = (
@@ -9311,6 +9337,7 @@
 				9F728FAB29926B4300F0C225 /* black_pdfreaderpro_home_en.pdf in Resources */,
 				AD0FA51629A9FA8F00EDEB50 /* KMResetPasswordView.xib in Resources */,
 				BBC3480F29558DC1008D2CD1 /* KMBackgroundController.xib in Resources */,
+				ADC31FAC2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib in Resources */,
 				ADD1B6F82946C0CA00C3FFF7 /* KMPrintChoosePageSizeMultipageView.xib in Resources */,
 				89E4E76429656A88002DBA6F /* KMAnnotationStampViewController.xib in Resources */,
 				BBC745ED295F067B0072C2ED /* KMCropSettingWindowController.xib in Resources */,
@@ -9640,6 +9667,7 @@
 				9F8DDF312924B855006CDC73 /* KMPDFToolsViewController.xib in Resources */,
 				9F853A002947137500DF644E /* throbber.png in Resources */,
 				BBC348372955A118008D2CD1 /* KMCreateBackgroundController.xib in Resources */,
+				ADC31FAD2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib in Resources */,
 				ADC075BB29866984006C752F /* KMBatchConverPDFWordView.xib in Resources */,
 				9F0CB4832967F64D00007028 /* KMPropertiesPanelReadOnlySubVC.xib in Resources */,
 				899700FA28F4051B009AF911 /* KMAnnotationViewController.xib in Resources */,
@@ -9986,6 +10014,7 @@
 				AD867F8D29D950B400F00440 /* KMBOTAOutlineView.xib in Resources */,
 				9F1F82CF292F6CF90092C4B4 /* KMPDFInsertPageWindow.xib in Resources */,
 				89E93EDD2999DA6D00F10F66 /* KMNoteFilterCollevtionViewItem.xib in Resources */,
+				ADC31FAE2A0E0C3900ED44A2 /* KMEditPropertyAlignmentView.xib in Resources */,
 				ADE3C1B029A4779E00793B13 /* KMPrintAccessoryController.xib in Resources */,
 				9FAAA32F290BD01D0046FFCE /* KMHomeHistoryFileViewController.xib in Resources */,
 				89D2D300294C806000BFF5FE /* KMPDFThumbnailItem.xib in Resources */,
@@ -10148,6 +10177,7 @@
 				BBC3482429559506008D2CD1 /* KMBackgroundManager.swift in Sources */,
 				AD867FC529DFFBC400F00440 /* KMAnnotationOutlineRowView.swift in Sources */,
 				BB4EEF2D29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */,
+				ADC31FA62A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift in Sources */,
 				ADCB9962292B8DAB00B51A03 /* KMOCRManager.swift in Sources */,
 				BB99ACCF292E2AEF0048AFD9 /* KMMergeCollectionViewItem.swift in Sources */,
 				BB7648EC29ECEEF400931039 /* KMAppearance.swift in Sources */,
@@ -10924,6 +10954,7 @@
 				BBC3482529559506008D2CD1 /* KMBackgroundManager.swift in Sources */,
 				AD867FC629DFFBC400F00440 /* KMAnnotationOutlineRowView.swift in Sources */,
 				BB4EEF2E29763EE7003A3537 /* KMRedactBaseWindowController.swift in Sources */,
+				ADC31FA72A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift in Sources */,
 				F373230C292DF9410013862C /* CPDFTextWidgetAnnotation+PDFListView.m in Sources */,
 				9FAAA333290BD0A20046FFCE /* KMHistoryFileCollectionViewItem.swift in Sources */,
 				BB7648ED29ECEEF400931039 /* KMAppearance.swift in Sources */,
@@ -11933,6 +11964,7 @@
 				F37322E6292DF9410013862C /* CPDFCircleAnnotation+PDFListView.m in Sources */,
 				9F1FE49529406E4700E952CA /* common.m in Sources */,
 				BBC3481E295593F0008D2CD1 /* KMBackgroundListController.swift in Sources */,
+				ADC31FA82A0E0C1A00ED44A2 /* KMEditPropertyAlignmentView.swift in Sources */,
 				8997010028F40710009AF911 /* KMBookMarkViewController.swift in Sources */,
 				9FDD0F822952FC36000C4DAD /* KMDesignToken.swift in Sources */,
 				BB7648EE29ECEEF400931039 /* KMAppearance.swift in Sources */,

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

@@ -3752,22 +3752,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "70CC19BE-9C55-49DA-BB97-50BA782A6B8C"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/KMLightMember/Manager/KMRequestServerManager.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "361"
-            endingLineNumber = "361"
-            landmarkName = "getUserInfo2()"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -3955,6 +3939,21 @@
                   endingLineNumber = "1665"
                   offsetFromSymbolStart = "128">
                </Location>
+               <Location
+                  uuid = "E7F4D56E-1C39-4024-BBA5-68C70086BBFF - bee3ec104df3c7ab"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMMainViewController.pdfListViewAddAnnotations(_: Swift.Optional&lt;__C.CPDFListView&gt;, forAdd: Swift.Optional&lt;Swift.Array&lt;__C.CPDFAnnotation&gt;&gt;, in: Swift.Optional&lt;__C.CPDFPage&gt;) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "1667"
+                  endingLineNumber = "1667"
+                  offsetFromSymbolStart = "128">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -4288,8 +4287,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1507"
             endingLineNumber = "1507"
-            landmarkName = "pdfListViewMenu(forEvent:for:click:)"
-            landmarkType = "7">
+            landmarkName = "KMMainViewController"
+            landmarkType = "3">
             <Locations>
                <Location
                   uuid = "65F4D04A-29F5-4749-B335-908237727731 - 67e34bd3bd1e0529"
@@ -4321,6 +4320,21 @@
                   endingLineNumber = "1507"
                   offsetFromSymbolStart = "316">
                </Location>
+               <Location
+                  uuid = "65F4D04A-29F5-4749-B335-908237727731 - 67e34bd3bd1e056b"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMMainViewController.pdfListViewMenu(forEvent: Swift.Optional&lt;__C.CPDFListView&gt;, for: Swift.Optional&lt;__C.NSEvent&gt;, click: Swift.Optional&lt;Swift.AutoreleasingUnsafeMutablePointer&lt;Swift.Optional&lt;__C.NSMenu&gt;&gt;&gt;) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "1509"
+                  endingLineNumber = "1509"
+                  offsetFromSymbolStart = "316">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -4338,22 +4352,38 @@
             endingLineNumber = "679"
             landmarkName = "-menuForEvent:"
             landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "9302F79A-BAA9-4166-A829-2AA7E8D58643"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "365"
-            endingLineNumber = "365"
-            landmarkName = "-menuForEvent:"
-            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "7391BC80-B1EA-4EA9-B41D-72C423ED7A90 - 3fe3e90c7499987c"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[CPDFListView(Event) menuForEvent:]"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "679"
+                  endingLineNumber = "679"
+                  offsetFromSymbolStart = "13456">
+               </Location>
+               <Location
+                  uuid = "7391BC80-B1EA-4EA9-B41D-72C423ED7A90 - 3fe3e90c7499987c"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[CPDFListView(Event) menuForEvent:]"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "679"
+                  endingLineNumber = "679"
+                  offsetFromSymbolStart = "14044">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -4417,6 +4447,21 @@
                   endingLineNumber = "1531"
                   offsetFromSymbolStart = "5716">
                </Location>
+               <Location
+                  uuid = "1D488FC5-D0A3-4443-B188-197E6CD0755A - 67e34bd3bd1e0241"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMMainViewController.pdfListViewMenu(forEvent: Swift.Optional&lt;__C.CPDFListView&gt;, for: Swift.Optional&lt;__C.NSEvent&gt;, click: Swift.Optional&lt;Swift.AutoreleasingUnsafeMutablePointer&lt;Swift.Optional&lt;__C.NSMenu&gt;&gt;&gt;) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/ViewController/KMMainViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "1531"
+                  endingLineNumber = "1531"
+                  offsetFromSymbolStart = "5320">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -4432,8 +4477,40 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "750"
             endingLineNumber = "750"
-            landmarkName = "-menuItemsEditingAtPoint:forPage:"
+            landmarkName = "-validateMenuItem:"
             landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "18B2AE70-9733-466E-83BA-36FD4726B700 - fcbaf7727200cc87"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[CPDFListView(Event) validateMenuItem:]"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "750"
+                  endingLineNumber = "750"
+                  offsetFromSymbolStart = "1532">
+               </Location>
+               <Location
+                  uuid = "18B2AE70-9733-466E-83BA-36FD4726B700 - fcbaf7727200cca0"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[CPDFListView(Event) validateMenuItem:]"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "751"
+                  endingLineNumber = "751"
+                  offsetFromSymbolStart = "2384">
+               </Location>
+            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -4448,8 +4525,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1470"
             endingLineNumber = "1470"
-            landmarkName = "pdfListViewMenuItemsEditing(at:for:menuItems:)"
-            landmarkType = "7">
+            landmarkName = "KMMainViewController"
+            landmarkType = "3">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -4484,54 +4561,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "F2AC8957-865E-489D-873D-F574FAD1E041"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1937"
-            endingLineNumber = "1937"
-            landmarkName = "mainToolDidClicked(_:_:_:_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "A6A48552-05C3-4D75-A8B5-F72FAA2E5E10"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "163"
-            endingLineNumber = "163"
-            landmarkName = "selectItem(_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "7278CB38-1E09-4E07-9C30-022BCBCD5AE0"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1987"
-            endingLineNumber = "1987"
-            landmarkName = "clickChildTool(type:index:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -4548,84 +4577,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "27AFF88B-4687-4554-9AC3-1A7843B303D3"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "462"
-            endingLineNumber = "462"
-            landmarkName = "changeAnnotationModeAction(item:)"
-            landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "27AFF88B-4687-4554-9AC3-1A7843B303D3 - 96ead7ba0cb99c5b"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "(1) suspend resume partial function for closure #1 @Sendable () async -&gt; () in PDF_Master.KMToolbarController.changeAnnotationModeAction(item: __C.KMToolbarClickButton) -&gt; ()"
-                  moduleName = "PDF Master"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "462"
-                  endingLineNumber = "462"
-                  offsetFromSymbolStart = "168">
-               </Location>
-               <Location
-                  uuid = "27AFF88B-4687-4554-9AC3-1A7843B303D3 - 96ead7ba0cb99c5b"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "(1) suspend resume partial function for closure #1 @Sendable () async -&gt; () in PDF_Master.KMToolbarController.changeAnnotationModeAction(item: __C.KMToolbarClickButton) -&gt; ()"
-                  moduleName = "PDF Master"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "462"
-                  endingLineNumber = "462"
-                  offsetFromSymbolStart = "192">
-               </Location>
-               <Location
-                  uuid = "27AFF88B-4687-4554-9AC3-1A7843B303D3 - 96ead7ba0cb99c5b"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "(1) suspend resume partial function for closure #1 @Sendable () async -&gt; () in PDF_Master.KMToolbarController.changeAnnotationModeAction(item: __C.KMToolbarClickButton) -&gt; ()"
-                  moduleName = "PDF Master"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "462"
-                  endingLineNumber = "462"
-                  offsetFromSymbolStart = "216">
-               </Location>
-               <Location
-                  uuid = "27AFF88B-4687-4554-9AC3-1A7843B303D3 - 96ead7ba0cb99c5b"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "(1) suspend resume partial function for closure #1 @Sendable () async -&gt; () in PDF_Master.KMToolbarController.changeAnnotationModeAction(item: __C.KMToolbarClickButton) -&gt; ()"
-                  moduleName = "PDF Master"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "462"
-                  endingLineNumber = "462"
-                  offsetFromSymbolStart = "232">
-               </Location>
-            </Locations>
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -4652,8 +4603,8 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "174"
-            endingLineNumber = "174"
+            startingLineNumber = "177"
+            endingLineNumber = "177"
             landmarkName = "changeAnnotationModeAction(item:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -4703,6 +4654,21 @@
                   endingLineNumber = "513"
                   offsetFromSymbolStart = "976">
                </Location>
+               <Location
+                  uuid = "2EDE8A22-38EF-43BC-A56C-DCECEEEA3BD4 - 2ea34dd5bf34a12a"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMToolbarController.toolbarViewController(_: PDF_Master.KMToolbarViewController, clickMode: PDF_Master.KMToolbarViewType, toolbar: __C.KMToolBoxItem, _: Swift.Array&lt;Swift.Int&gt;) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "513"
+                  endingLineNumber = "513"
+                  offsetFromSymbolStart = "1008">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -4751,6 +4717,21 @@
                   endingLineNumber = "519"
                   offsetFromSymbolStart = "1380">
                </Location>
+               <Location
+                  uuid = "07487698-4968-448C-ADE0-F6EFE45DDC7A - 2ea34dd5bf34a0e4"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMToolbarController.toolbarViewController(_: PDF_Master.KMToolbarViewController, clickMode: PDF_Master.KMToolbarViewType, toolbar: __C.KMToolBoxItem, _: Swift.Array&lt;Swift.Int&gt;) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "519"
+                  endingLineNumber = "519"
+                  offsetFromSymbolStart = "1416">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -4994,6 +4975,51 @@
                   endingLineNumber = "478"
                   offsetFromSymbolStart = "932">
                </Location>
+               <Location
+                  uuid = "5B80F998-3B3F-4A3F-842D-1EDB32380522 - 96ead7ba0cb9e24b"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "(1) suspend resume partial function for closure #1 @Sendable () async -&gt; () in PDF_Master.KMToolbarController.changeAnnotationModeAction(item: __C.KMToolbarClickButton) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "478"
+                  endingLineNumber = "478"
+                  offsetFromSymbolStart = "1864">
+               </Location>
+               <Location
+                  uuid = "5B80F998-3B3F-4A3F-842D-1EDB32380522 - 7e5c896f07412649"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "(3) suspend resume partial function for closure #1 @Sendable () async -&gt; () in PDF_Master.KMToolbarController.changeAnnotationModeAction(item: __C.KMToolbarClickButton) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "478"
+                  endingLineNumber = "478"
+                  offsetFromSymbolStart = "1588">
+               </Location>
+               <Location
+                  uuid = "5B80F998-3B3F-4A3F-842D-1EDB32380522 - e70e7ac01e686a4f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "(5) suspend resume partial function for closure #1 @Sendable () async -&gt; () in PDF_Master.KMToolbarController.changeAnnotationModeAction(item: __C.KMToolbarClickButton) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "478"
+                  endingLineNumber = "478"
+                  offsetFromSymbolStart = "688">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -5029,5 +5055,116 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "DF7E8AFE-6BCF-4B78-833A-10BF1B3E2F31"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "256"
+            endingLineNumber = "256"
+            landmarkName = "refreshSelectAreaProperty()"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "DF7E8AFE-6BCF-4B78-833A-10BF1B3E2F31 - 980cd0c5270dbea7"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMEditPDFTextPropertyViewController.refreshSelectAreaProperty() -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "386"
+                  endingLineNumber = "386"
+                  offsetFromSymbolStart = "2820">
+               </Location>
+               <Location
+                  uuid = "DF7E8AFE-6BCF-4B78-833A-10BF1B3E2F31 - 980cd0c5270dbf9f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMEditPDFTextPropertyViewController.refreshSelectAreaProperty() -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "394"
+                  endingLineNumber = "394"
+                  offsetFromSymbolStart = "140">
+               </Location>
+               <Location
+                  uuid = "DF7E8AFE-6BCF-4B78-833A-10BF1B3E2F31 - 980cd0c5270dbffc"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMEditPDFTextPropertyViewController.refreshSelectAreaProperty() -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "391"
+                  endingLineNumber = "391"
+                  offsetFromSymbolStart = "140">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "74283C43-458C-4189-AF4A-493D54D9633E"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "164"
+            endingLineNumber = "164"
+            landmarkName = "selectItem(_:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "D04FD167-D917-4F12-A213-50A0C6F6EBD0"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "567"
+            endingLineNumber = "567"
+            landmarkName = "updateFontNameAndStyle(name:style:needChangeListView:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "4E28A3BA-3CE6-42E6-99FC-4279DABBA52F"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/KMLightMember/Manager/KMRequestServerManager.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "361"
+            endingLineNumber = "361"
+            landmarkName = "getUserInfo2()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 8 - 360
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -55,37 +55,7 @@ class KMEditPDFTextPropertyViewController: NSViewController {
     @IBOutlet weak var fontColorButton: NSButton!
     @IBOutlet weak var fontCustomColorButton: NSButton!
     
-//    @IBOutlet weak var alignTitleLabel: NSTextField!
-//    @IBOutlet weak var areasLeftButton: NSButton!
-//    @IBOutlet weak var areasVerticalCenterButton: NSButton!
-//    @IBOutlet weak var areasHorzontalButton: NSButton!
-//    @IBOutlet weak var areasVerticalButton: NSButton!
-//    @IBOutlet weak var areasBotoomButton: NSButton!
-//    @IBOutlet weak var areasHorizontalCenterButton: NSButton!
-//    @IBOutlet weak var areasTopButton: NSButton!
-//    @IBOutlet weak var areasRightButton: NSButton!
-    
-    
-    @IBOutlet weak var alignmentLabel: NSTextField!
-    @IBOutlet weak var leftAreasBox: NSBox!
-    @IBOutlet weak var verticalCenterAreasBox: NSBox!
-    @IBOutlet weak var rightButtonAreasBox: NSBox!
-    @IBOutlet weak var horzontalAreasBox: NSBox!
-    @IBOutlet weak var topAreasBox: NSBox!
-    @IBOutlet weak var horizontalCenterAreasBox: NSBox!
-    @IBOutlet weak var botoomAreasBox: NSBox!
-    @IBOutlet weak var verticalAreasBox: NSBox!
-    @IBOutlet weak var alignmentLine1: NSView!
-    @IBOutlet weak var alignmentLine2: NSView!
-    
-    var leftAreasVC: KMDesignPropertySelector?
-    var verticalCenterAreasVC: KMDesignPropertySelector?
-    var rightButtonAreasVC: KMDesignPropertySelector?
-    var horzontalAreasVC: KMDesignPropertySelector?
-    var topAreasVC: KMDesignPropertySelector?
-    var horizontalCenterAreasVC: KMDesignPropertySelector?
-    var botoomAreasVC: KMDesignPropertySelector?
-    var verticalAreasVC: KMDesignPropertySelector?
+    @IBOutlet weak var alignmentView: KMEditPropertyAlignmentView!
     
     var textPresuppositionVC: KMDesignSelect?
     var textPresuppositionResetVC: KMDesignPropertySelector?
@@ -140,12 +110,6 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         self.fontTitleLabel.font = NSFont.SFProTextSemibold(12.0)
         self.fontTitleLabel.textColor = NSColor(hex: "#616469")
         
-        self.alignmentLabel.font = NSFont.SFProTextSemibold(12.0)
-        self.alignmentLabel.textColor = NSColor(hex: "#616469")
-        
-        self.alignmentLine1.backgroundColor(NSColor(hex: "#000000", alpha: 0.1))
-        self.alignmentLine2.backgroundColor(NSColor(hex: "#000000", alpha: 0.1))
-        
         self.headerBox.backgroundColor(NSColor(hex: "#FFFFFF"))
         self.headerBox.border(NSColor(hex: "#DFE1E5"), 0, 4)
         
@@ -224,109 +188,11 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         textPresuppositionResetVC?.action = #selector(resetTextPresuppositionButtonAction)
         textPresuppositionResetVC?.image = NSImage(named: "KMImagePropertPanelTextDefaultMore")!
         
-//        let norIcons : [String] = ["KMImageNameEditPDFImage20","KMImageNameEditPDFImage21","KMImageNameEditPDFImage45","KMImageNameEditPDFImage46",
-//        "KMImageNameEditPDFImage47","KMImageNameEditPDFImage48","KMImageNameEditPDFImage49","KMImageNameEditPDFImage50"]
-//        let selectIcons : [String] = ["KMImageNameEditPDFImage20_1","KMImageNameEditPDFImage21_1","KMImageNameEditPDFImage45_1","KMImageNameEditPDFImage46_1",
-//                           "KMImageNameEditPDFImage47_1","KMImageNameEditPDFImage48_1","KMImageNameEditPDFImage49_1","KMImageNameEditPDFImage50_1"]
-//
-        //areasAlignment
-        leftAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        leftAreasBox.contentView = leftAreasVC?.view
-        leftAreasBox.fillColor = NSColor.clear
-        leftAreasVC?.target = self
-        leftAreasVC?.button.tag = 0
-        leftAreasVC?.action = #selector(areasAlignStyleAction)
-        leftAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage45")!
-        leftAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage45_1")!
-        leftAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage45_1")!
-        leftAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage45_1")!
-        leftAreasVC?.updateUI()
-        
-        verticalCenterAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        verticalCenterAreasBox.contentView = verticalCenterAreasVC?.view
-        verticalCenterAreasBox.fillColor = NSColor.clear
-        verticalCenterAreasVC?.target = self
-        verticalCenterAreasVC?.button.tag = 1
-        verticalCenterAreasVC?.action = #selector(areasAlignStyleAction)
-        verticalCenterAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage46")!
-        verticalCenterAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage46_1")!
-        verticalCenterAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage46_1")!
-        verticalCenterAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage46_1")!
-        verticalCenterAreasVC?.updateUI()
-        
-        rightButtonAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        rightButtonAreasBox.contentView = rightButtonAreasVC?.view
-        rightButtonAreasBox.fillColor = NSColor.clear
-        rightButtonAreasVC?.target = self
-        rightButtonAreasVC?.button.tag = 2
-        rightButtonAreasVC?.action = #selector(areasAlignStyleAction)
-        rightButtonAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage47_1")!
-        rightButtonAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage47")!
-        rightButtonAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage47_1")!
-        rightButtonAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage47_1")!
-        rightButtonAreasVC?.updateUI()
-        
-        horzontalAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        horzontalAreasBox.contentView = horzontalAreasVC?.view
-        horzontalAreasBox.fillColor = NSColor.clear
-        horzontalAreasVC?.target = self
-        horzontalAreasVC?.button.tag = 7
-        horzontalAreasVC?.action = #selector(areasAlignStyleAction)
-        horzontalAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage21_1")!
-        horzontalAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage21")!
-        horzontalAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage21_1")!
-        horzontalAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage21_1")!
-        horzontalAreasVC?.updateUI()
-        
-        topAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        topAreasBox.contentView = topAreasVC?.view
-        topAreasBox.fillColor = NSColor.clear
-        topAreasVC?.button.tag = 3
-        topAreasVC?.target = self
-        topAreasVC?.action = #selector(areasAlignStyleAction)
-        topAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage48_1")!
-        topAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage48")!
-        topAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage48_1")!
-        topAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage48_1")!
-        topAreasVC?.updateUI()
-        
-        horizontalCenterAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        horizontalCenterAreasBox.contentView = horizontalCenterAreasVC?.view
-        horizontalCenterAreasBox.fillColor = NSColor.clear
-        horizontalCenterAreasVC?.button.tag = 4
-        horizontalCenterAreasVC?.target = self
-        horizontalCenterAreasVC?.action = #selector(areasAlignStyleAction)
-        horizontalCenterAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage49_1")!
-        horizontalCenterAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage49")!
-        horizontalCenterAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage49_1")!
-        horizontalCenterAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage49_1")!
-        horizontalCenterAreasVC?.updateUI()
-        
-        botoomAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        botoomAreasBox.contentView = botoomAreasVC?.view
-        botoomAreasBox.fillColor = NSColor.clear
-        botoomAreasVC?.button.tag = 5
-        botoomAreasVC?.target = self
-        botoomAreasVC?.action = #selector(areasAlignStyleAction)
-        botoomAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage50_1")!
-        botoomAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage50")!
-        botoomAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage50_1")!
-        botoomAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage50_1")!
-        botoomAreasVC?.updateUI()
-        
-        verticalAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
-        verticalAreasBox.contentView = verticalAreasVC?.view
-        verticalAreasBox.fillColor = NSColor.clear
-        verticalAreasVC?.button.tag = 6
-        verticalAreasVC?.target = self
-        verticalAreasVC?.action = #selector(areasAlignStyleAction)
-        verticalAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage20_1")!
-        verticalAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage20")!
-        verticalAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage20_1")!
-        verticalAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage20_1")!
-        verticalAreasVC?.updateUI()
-        
         self.colorBox.borderColor = NSColor(hex: "#DFE1E5")
+        
+        self.alignmentView.didChange = { [unowned self] view, areasArray, boundsArray in
+            self.changeAreasAlign(areas: areasArray, newBounds: boundsArray)
+        }
     }
     
     func initData() {
@@ -349,8 +215,6 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         self.fontColorButton.image = self.swatchWithColor(color: self.currentColor, size: NSSize(width: 20, height: 20))
         
         self.fonts = CPDFAnnotationModel.supportFonts() as! [NSDictionary]
-        
-        self.updateFormAearsAlignmentState()
     }
     
     func updateUI() {
@@ -364,10 +228,11 @@ class KMEditPDFTextPropertyViewController: NSViewController {
     func reloadData() {
         if self.listView.editingAreas() != nil &&
             self.listView.editingAreas().count > 0 {
-            self.updateFormAearsAlignmentState()
             textsAreas = []
-
+            
             let areas = self.listView.editingAreas()
+            self.alignmentView.editingAreas = areas ?? []
+            
             for i in 0 ... areas!.count-1 {
                 if areas![i] is CPDFEditTextArea {
                     textsAreas.append(areas![i] as! CPDFEditTextArea)
@@ -461,11 +326,6 @@ extension KMEditPDFTextPropertyViewController {
         self.updatePreviewImage()
     }
     
-    
-    @objc func areasAlignStyleAction(_ sender: NSButton) {
-        self.updateFormAearsAlignMangent(stype: CPDFActiveAreasAlignType.init(rawValue: sender.tag) ?? .Left)
-    }
-    
     @objc func leftAlignmentAction() {
         self.leftAlignmentVC?.state = .Sel
         self.rightAlignmentVC?.state = .Norm
@@ -696,218 +556,6 @@ extension KMEditPDFTextPropertyViewController {
     
 }
 
-//MARK: - FormAears
-extension KMEditPDFTextPropertyViewController {
-    func updateFormAearsAlignmentState() {
-        let areasArray = [leftAreasVC, verticalCenterAreasVC, rightButtonAreasVC, horzontalAreasVC, topAreasVC, horizontalCenterAreasVC, botoomAreasVC, verticalAreasVC]
-        if self.listView.editingAreas()?.count ?? 0 < 2 {
-            for view in areasArray {
-                view?.image = (view?._image_disabled)!
-                view?._enabled = false
-            }
-        } else if self.listView.editingAreas()?.count ?? 0 == 2 {
-            for view in areasArray {
-                if view == verticalAreasVC || view == horzontalAreasVC {
-                    view?.image = (view?._image_disabled)!
-                    view?._enabled = false
-                } else {
-                    view?.image = (view?._image_sel)!
-                    view?._enabled = true
-                }
-            }
-        } else if self.listView.editingAreas()?.count ?? 0 > 2 {
-            for view in areasArray {
-                view?.image = (view?._image_sel)!
-                view?._enabled = true
-            }
-        }
-    }
-    
-    func updateFormAearsAlignMangent(stype: CPDFActiveAreasAlignType) {
-        print("updateFormAearsAlignMangent")
-        if self.listView.editingAreas() == nil || self.listView.editingAreas().count < 2 {
-           return
-        }
-        var zeroRect = NSRect.null
-        var highestRect = NSZeroRect
-        var widthestRect = NSZeroRect
-        
-        let fristArea : CPDFEditArea = self.listView.editingAreas().first as! CPDFEditArea
-        var leftestRect = fristArea.bounds
-        var rightestRect = fristArea.bounds
-        var topestRect = fristArea.bounds
-        var bottomestRect = fristArea.bounds
-        
-        var leftestArea : CPDFEditArea = fristArea
-        var rightestArea : CPDFEditArea = fristArea
-        var topestArea : CPDFEditArea = fristArea
-        var bottomestArea : CPDFEditArea = fristArea
-        
-        var totalWidth = 0.0
-        var totalHeight = 0.0
-        
-        for i in 0 ... self.listView.editingAreas().count-1 {
-            let area : CPDFEditArea = self.listView.editingAreas()[i] as! CPDFEditArea
-            zeroRect = zeroRect.union(area.bounds)
-            totalWidth = totalWidth + area.bounds.width
-            totalHeight = totalHeight + area.bounds.height
-            
-            if area.bounds.height > highestRect.height {
-                highestRect = area.bounds
-            }
-            
-            if area.bounds.width > widthestRect.width {
-                widthestRect = area.bounds
-            }
-            
-            if leftestRect.minX > area.bounds.minX {
-                leftestRect = area.bounds
-                leftestArea = area
-            }
-            
-            if area.bounds.maxX > rightestRect.maxX {
-                rightestRect = area.bounds
-                rightestArea = area
-            }
-            
-            if area.bounds.maxY > topestRect.maxY {
-                topestRect = area.bounds
-                topestArea = area
-            }
-            
-            if bottomestRect.minY > area.bounds.minY {
-                bottomestRect = area.bounds
-                bottomestArea = area
-            }
-        }
-        
-        if stype == .Left {
-            var newBoundsArray : [String] = []
-            for i in 0 ... self.listView.editingAreas().count-1 {
-                let areas = self.listView.editingAreas()[i] as! CPDFEditArea
-                var bounds = areas.bounds
-                bounds.origin.x = zeroRect.origin.x
-                newBoundsArray.append(NSStringFromRect(bounds))
-            }
-            self.changeAreasAlign(areas: self.listView.editingAreas(), newBounds: newBoundsArray)
-        } else if stype == .Right {
-            var newBounds : [String] = []
-            for i in 0 ... self.listView.editingAreas().count-1 {
-                let areas = self.listView.editingAreas()[i] as! CPDFEditArea
-                var bounds = areas.bounds
-                bounds.origin.x = zeroRect.maxX - bounds.size.width
-                newBounds.append(NSStringFromRect(bounds))
-            }
-            self.changeAreasAlign(areas: self.listView.editingAreas(), newBounds: newBounds)
-        } else if stype == .Top {
-            var newBounds : [String] = []
-            for i in 0 ... self.listView.editingAreas().count-1 {
-                let areas = self.listView.editingAreas()[i] as! CPDFEditArea
-                var bounds = areas.bounds
-                bounds.origin.y = zeroRect.maxY - bounds.size.height
-                newBounds.append(NSStringFromRect(bounds))
-            }
-            self.changeAreasAlign(areas: self.listView.editingAreas(), newBounds: newBounds)
-        } else if stype == .Bottom {
-            var newBounds : [String] = []
-            for i in 0 ... self.listView.editingAreas().count-1 {
-                let areas = self.listView.editingAreas()[i] as! CPDFEditArea
-                var bounds = areas.bounds
-                bounds.origin.y = zeroRect.minY
-                newBounds.append(NSStringFromRect(bounds))
-            }
-            self.changeAreasAlign(areas: self.listView.editingAreas(), newBounds: newBounds)
-        } else if stype == .Horizontally {
-            var newBounds : [String] = []
-            for i in 0 ... self.listView.editingAreas().count-1 {
-                let areas = self.listView.editingAreas()[i] as! CPDFEditArea
-                var bounds = areas.bounds
-                bounds.origin.y = highestRect.midY - bounds.height/2
-                newBounds.append(NSStringFromRect(bounds))
-            }
-            self.changeAreasAlign(areas: self.listView.editingAreas(), newBounds: newBounds)
-        } else if stype == .Vertical {
-            var newBounds : [String] = []
-            for i in 0 ... self.listView.editingAreas().count-1 {
-                let areas = self.listView.editingAreas()[i] as! CPDFEditArea
-                var bounds = areas.bounds
-                bounds.origin.x = widthestRect.midX - bounds.width/2
-                newBounds.append(NSStringFromRect(bounds))
-            }
-            self.changeAreasAlign(areas: self.listView.editingAreas(), newBounds: newBounds)
-        } else if stype == .DisHorizontally {
-            let middleGap = zeroRect.width - leftestRect.width - rightestRect.width
-            let otherAreasTotalWidth = totalWidth - leftestRect.width - rightestRect.width
-            
-            let gap = (middleGap - otherAreasTotalWidth)/CGFloat(self.listView.editingAreas().count - 1)
-            var areasCopyArray : [CPDFEditArea] = self.listView.editingAreas() as! [CPDFEditArea]
-            areasCopyArray.sorted(by: { obj1, obj2 in
-                let area1 = obj1
-                let area2 = obj2
-                if area1.bounds.origin.x < area2.bounds.origin.x {
-                    return true
-                } else {
-                    return false
-                }
-            })
-
-            if let index = areasCopyArray.firstIndex(of: leftestArea) {
-                areasCopyArray.remove(at: index)
-            }
-            
-            if let index = areasCopyArray.firstIndex(of: rightestArea) {
-                areasCopyArray.remove(at: index)
-            }
-            
-            var newBounds : [String] = []
-            
-            var leftStartX = leftestRect.maxX + gap
-            for i in 0 ... areasCopyArray.count-1 {
-                let areas = areasCopyArray[i]
-                var bounds = areas.bounds
-                bounds.origin.x = leftStartX
-                newBounds.append(NSStringFromRect(bounds))
-                leftStartX = leftStartX + bounds.width + gap
-            }
-            self.changeAreasAlign(areas: areasCopyArray, newBounds: newBounds)
-        } else if stype == .DisVertical {
-            let middleGap = zeroRect.height - topestRect.height - bottomestRect.height
-            let otherAreasTotalHeight = totalHeight - topestRect.height - bottomestRect.height
-            
-            let gap = (middleGap - otherAreasTotalHeight)/CGFloat(self.listView.editingAreas().count - 1)
-            var areasCopyArray : [CPDFEditArea] = self.listView.editingAreas() as! [CPDFEditArea]
-            areasCopyArray.sorted(by: { obj1, obj2 in
-                let area1 = obj1
-                let area2 = obj2
-                if area1.bounds.origin.x < area2.bounds.origin.x {
-                    return true
-                } else {
-                    return false
-                }
-            })
-            if let index = areasCopyArray.firstIndex(of: topestArea) {
-                areasCopyArray.remove(at: index)
-            }
-            
-            if let index = areasCopyArray.firstIndex(of: bottomestArea) {
-                areasCopyArray.remove(at: index)
-            }
-            
-            var newBounds : [String] = []
-            
-            var bottomStartY = bottomestRect.maxY + gap
-            for i in 0 ... areasCopyArray.count-1 {
-                let areas = areasCopyArray[i]
-                var bounds = areas.bounds
-                bounds.origin.y = bottomStartY
-                newBounds.append(NSStringFromRect(bounds))
-                bottomStartY = bottomStartY + bounds.height + gap
-            }
-            self.changeAreasAlign(areas: areasCopyArray, newBounds: newBounds)
-        }
-    }
-}
-
 //MARK: - Private
 extension KMEditPDFTextPropertyViewController {
     func updateFontNameAndStyle(name: String, style: String, needChangeListView: Bool = true) {

+ 2 - 167
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.xib

@@ -8,10 +8,7 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="KMEditPDFTextPropertyViewController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
-                <outlet property="alignmentLabel" destination="6VB-fk-JWF" id="SV7-B6-an5"/>
-                <outlet property="alignmentLine1" destination="6k0-iq-Vr0" id="eI8-ZT-hSG"/>
-                <outlet property="alignmentLine2" destination="y0g-VH-w2H" id="l4C-Ok-rdN"/>
-                <outlet property="botoomAreasBox" destination="SPI-Mw-sd7" id="9ad-IM-4xt"/>
+                <outlet property="alignmentView" destination="Oi3-L1-ffT" id="rBC-Tk-pG6"/>
                 <outlet property="centerAlignmentBox" destination="rXF-2b-cRj" id="fi9-sF-XfO"/>
                 <outlet property="colorBox" destination="Dcy-0U-AoP" id="ADd-OX-dJd"/>
                 <outlet property="contentView" destination="dAY-3A-lfL" id="mu3-cD-1Tc"/>
@@ -24,22 +21,15 @@
                 <outlet property="fontStyleBox" destination="AHN-i5-WYB" id="4Kd-4C-shy"/>
                 <outlet property="fontTitleLabel" destination="2gN-hL-7Ez" id="tyg-5J-p4e"/>
                 <outlet property="headerBox" destination="UXh-hG-Hue" id="jlW-sY-853"/>
-                <outlet property="horizontalCenterAreasBox" destination="6Dm-bi-kCX" id="KsR-xJ-cZH"/>
-                <outlet property="horzontalAreasBox" destination="y56-ET-DSj" id="ztl-b4-tAS"/>
                 <outlet property="imageContentView" destination="ZNj-I9-Lej" id="iZl-EK-5FC"/>
                 <outlet property="imageViewHeightConstraint" destination="QxJ-yS-QZJ" id="w65-Uu-Eu8"/>
                 <outlet property="leftAlignmentBox" destination="ywS-TH-Tgz" id="hpW-Eo-Zyr"/>
-                <outlet property="leftAreasBox" destination="vgL-9q-udC" id="Dph-O3-Izr"/>
                 <outlet property="preImageView" destination="Nlt-O1-sL5" id="hXP-Vn-Ue1"/>
                 <outlet property="propertyTitle" destination="TmC-Oc-Dxd" id="Zcp-fv-Y6Y"/>
                 <outlet property="resetTextPresuppositionBox" destination="cZ0-Lb-7rt" id="NTl-SG-HeT"/>
                 <outlet property="rightAlignmentBox" destination="LB3-jb-9Hl" id="fLg-Cb-V6u"/>
-                <outlet property="rightButtonAreasBox" destination="OLl-X4-svg" id="rWT-PF-fQj"/>
                 <outlet property="textPresuppositionBox" destination="Pd8-gf-nbc" id="sMR-ru-581"/>
                 <outlet property="textPresuppositionTopContstraint" destination="eXm-YW-Pwj" id="pUO-ce-FC5"/>
-                <outlet property="topAreasBox" destination="Aqu-4E-hjV" id="1Xl-oI-Lyt"/>
-                <outlet property="verticalAreasBox" destination="RRh-ON-yME" id="wQn-hN-Eyu"/>
-                <outlet property="verticalCenterAreasBox" destination="QLr-MM-s1R" id="hmo-DW-0v4"/>
                 <outlet property="view" destination="4mG-P9-QH2" id="rSY-kX-3d6"/>
             </connections>
         </customObject>
@@ -285,164 +275,9 @@
                                     <constraint firstAttribute="bottom" secondItem="cZ0-Lb-7rt" secondAttribute="bottom" id="zHr-Q3-Fwg"/>
                                 </constraints>
                             </customView>
-                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Oi3-L1-ffT">
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Oi3-L1-ffT" customClass="KMEditPropertyAlignmentView" customModule="PDF_Master" customModuleProvider="target">
                                 <rect key="frame" x="16" y="187" width="228" height="100"/>
-                                <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6VB-fk-JWF">
-                                        <rect key="frame" x="-2" y="84" width="35" height="16"/>
-                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Align" id="h5f-rI-zlE">
-                                            <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>
-                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="7LJ-33-jhf">
-                                        <rect key="frame" x="0.0" y="0.0" width="228" height="76"/>
-                                        <subviews>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" translatesAutoresizingMaskIntoConstraints="NO" id="vgL-9q-udC">
-                                                <rect key="frame" x="0.0" y="44" width="32" height="32"/>
-                                                <view key="contentView" id="PEn-tq-KFP">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="32" id="5io-my-vKD"/>
-                                                    <constraint firstAttribute="width" constant="32" id="Wxa-cs-SMi"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="QLr-MM-s1R">
-                                                <rect key="frame" x="40" y="44" width="32" height="32"/>
-                                                <view key="contentView" id="zYe-lu-Pim">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="32" id="9Jv-TT-1zH"/>
-                                                    <constraint firstAttribute="width" constant="32" id="Bx3-6Z-aRv"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="OLl-X4-svg">
-                                                <rect key="frame" x="80" y="44" width="32" height="32"/>
-                                                <view key="contentView" id="vNT-m8-5L1">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="32" id="V0f-us-eHT"/>
-                                                    <constraint firstAttribute="width" constant="32" id="y7P-cL-w32"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="y56-ET-DSj">
-                                                <rect key="frame" x="129" y="44" width="32" height="32"/>
-                                                <view key="contentView" id="tYg-Ht-IIU">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" constant="32" id="7Ju-gS-Qoi"/>
-                                                    <constraint firstAttribute="height" constant="32" id="AdJ-yB-mbg"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Aqu-4E-hjV">
-                                                <rect key="frame" x="0.0" y="4" width="32" height="32"/>
-                                                <view key="contentView" id="15k-Ul-fqm">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" constant="32" id="2w6-LT-Sl7"/>
-                                                    <constraint firstAttribute="height" constant="32" id="RAc-lT-TnZ"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="6Dm-bi-kCX">
-                                                <rect key="frame" x="40" y="4" width="32" height="32"/>
-                                                <view key="contentView" id="0ab-0q-Mkd">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="32" id="IFT-ro-YYQ"/>
-                                                    <constraint firstAttribute="width" constant="32" id="uT7-LM-kGW"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="SPI-Mw-sd7">
-                                                <rect key="frame" x="80" y="4" width="32" height="32"/>
-                                                <view key="contentView" id="8vp-Vt-364">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="32" id="RGL-ua-kLF"/>
-                                                    <constraint firstAttribute="width" constant="32" id="sDF-ZU-NVr"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="6k0-iq-Vr0">
-                                                <rect key="frame" x="120" y="52" width="1" height="16"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" constant="1" id="YbI-JK-WG2"/>
-                                                    <constraint firstAttribute="height" constant="16" id="dQ6-rh-c0j"/>
-                                                </constraints>
-                                            </customView>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="y0g-VH-w2H">
-                                                <rect key="frame" x="120" y="12" width="1" height="16"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="16" id="D0N-Gf-Gtf"/>
-                                                    <constraint firstAttribute="width" constant="1" id="W0o-0q-dT7"/>
-                                                </constraints>
-                                            </customView>
-                                            <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="RRh-ON-yME">
-                                                <rect key="frame" x="129" y="4" width="32" height="32"/>
-                                                <view key="contentView" id="i8U-dO-pSd">
-                                                    <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                </view>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="32" id="8a2-Wo-w1V"/>
-                                                    <constraint firstAttribute="width" constant="32" id="Lao-HP-aWq"/>
-                                                </constraints>
-                                                <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            </box>
-                                        </subviews>
-                                        <constraints>
-                                            <constraint firstItem="QLr-MM-s1R" firstAttribute="top" secondItem="7LJ-33-jhf" secondAttribute="top" id="6G0-4F-d2l"/>
-                                            <constraint firstItem="6Dm-bi-kCX" firstAttribute="leading" secondItem="Aqu-4E-hjV" secondAttribute="trailing" constant="8" id="A4H-2Y-0A1"/>
-                                            <constraint firstItem="SPI-Mw-sd7" firstAttribute="top" secondItem="OLl-X4-svg" secondAttribute="bottom" constant="8" id="B65-n6-864"/>
-                                            <constraint firstItem="OLl-X4-svg" firstAttribute="top" secondItem="PEn-tq-KFP" secondAttribute="top" id="BDr-Qr-IeM"/>
-                                            <constraint firstItem="OLl-X4-svg" firstAttribute="leading" secondItem="QLr-MM-s1R" secondAttribute="trailing" constant="8" id="GxG-tJ-zhd"/>
-                                            <constraint firstItem="Aqu-4E-hjV" firstAttribute="leading" secondItem="7LJ-33-jhf" secondAttribute="leading" id="KW3-78-uQA"/>
-                                            <constraint firstItem="QLr-MM-s1R" firstAttribute="leading" secondItem="vgL-9q-udC" secondAttribute="trailing" constant="8" id="M5v-HM-gt9"/>
-                                            <constraint firstItem="RRh-ON-yME" firstAttribute="top" secondItem="y56-ET-DSj" secondAttribute="bottom" constant="8" id="McK-dL-30k"/>
-                                            <constraint firstItem="6k0-iq-Vr0" firstAttribute="top" secondItem="7LJ-33-jhf" secondAttribute="top" constant="8" id="Pnd-pZ-TTO"/>
-                                            <constraint firstItem="y56-ET-DSj" firstAttribute="leading" secondItem="6k0-iq-Vr0" secondAttribute="trailing" constant="8" id="Q2d-HR-JyK"/>
-                                            <constraint firstItem="6Dm-bi-kCX" firstAttribute="top" secondItem="QLr-MM-s1R" secondAttribute="bottom" constant="8" id="dGA-c0-A0r"/>
-                                            <constraint firstItem="Aqu-4E-hjV" firstAttribute="top" secondItem="vgL-9q-udC" secondAttribute="bottom" constant="8" id="dkl-H2-yun"/>
-                                            <constraint firstItem="6k0-iq-Vr0" firstAttribute="leading" secondItem="OLl-X4-svg" secondAttribute="trailing" constant="8" id="hhc-ZV-qCn"/>
-                                            <constraint firstItem="SPI-Mw-sd7" firstAttribute="leading" secondItem="6Dm-bi-kCX" secondAttribute="trailing" constant="8" id="hqm-RZ-LWS"/>
-                                            <constraint firstItem="y0g-VH-w2H" firstAttribute="leading" secondItem="SPI-Mw-sd7" secondAttribute="trailing" constant="8" id="iDp-vw-cPZ"/>
-                                            <constraint firstItem="vgL-9q-udC" firstAttribute="leading" secondItem="7LJ-33-jhf" secondAttribute="leading" id="k5h-yh-lw6"/>
-                                            <constraint firstItem="OLl-X4-svg" firstAttribute="top" secondItem="7LJ-33-jhf" secondAttribute="top" id="p7m-7n-BWh"/>
-                                            <constraint firstItem="vgL-9q-udC" firstAttribute="top" secondItem="7LJ-33-jhf" secondAttribute="top" id="q6D-OS-f1a"/>
-                                            <constraint firstItem="y56-ET-DSj" firstAttribute="top" secondItem="PEn-tq-KFP" secondAttribute="top" id="tkT-je-3qQ"/>
-                                            <constraint firstItem="y56-ET-DSj" firstAttribute="top" secondItem="7LJ-33-jhf" secondAttribute="top" id="uQV-UC-FO7"/>
-                                            <constraint firstItem="y0g-VH-w2H" firstAttribute="top" secondItem="Aqu-4E-hjV" secondAttribute="top" constant="8" id="xa3-iS-gMg"/>
-                                            <constraint firstItem="RRh-ON-yME" firstAttribute="leading" secondItem="y0g-VH-w2H" secondAttribute="trailing" constant="8" id="y7v-8z-cfC"/>
-                                        </constraints>
-                                    </customView>
-                                </subviews>
                                 <constraints>
-                                    <constraint firstAttribute="bottom" secondItem="7LJ-33-jhf" secondAttribute="bottom" id="N9d-y0-5wL"/>
-                                    <constraint firstAttribute="trailing" secondItem="7LJ-33-jhf" secondAttribute="trailing" id="OVb-bF-Vov"/>
-                                    <constraint firstItem="7LJ-33-jhf" firstAttribute="top" secondItem="6VB-fk-JWF" secondAttribute="bottom" constant="8" id="QE1-nX-o9r"/>
-                                    <constraint firstItem="7LJ-33-jhf" firstAttribute="leading" secondItem="Oi3-L1-ffT" secondAttribute="leading" id="QUv-Uv-K4g"/>
-                                    <constraint firstItem="6VB-fk-JWF" firstAttribute="top" secondItem="Oi3-L1-ffT" secondAttribute="top" id="fPr-VQ-mrw"/>
-                                    <constraint firstItem="6VB-fk-JWF" firstAttribute="leading" secondItem="Oi3-L1-ffT" secondAttribute="leading" id="gHC-ML-tdu"/>
                                     <constraint firstAttribute="height" constant="100" id="lQ0-Zl-AJK"/>
                                 </constraints>
                             </customView>

+ 368 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/View/AlignmentView/KMEditPropertyAlignmentView.swift

@@ -0,0 +1,368 @@
+//
+//  KMEditPropertyAlignmentView.swift
+//  PDF Master
+//
+//  Created by lizhe on 2023/5/12.
+//
+
+import Cocoa
+
+
+typealias KMEditPropertyAlignmentViewDidChange = (_ view: KMEditPropertyAlignmentView, _ areasArray: [Any], _ newBoundsArray: [String]) -> ()
+
+class KMEditPropertyAlignmentView: KMBaseXibView {
+    @IBOutlet weak var alignmentLabel: NSTextField!
+    @IBOutlet weak var leftAreasBox: NSBox!
+    @IBOutlet weak var verticalCenterAreasBox: NSBox!
+    @IBOutlet weak var rightButtonAreasBox: NSBox!
+    @IBOutlet weak var horzontalAreasBox: NSBox!
+    @IBOutlet weak var topAreasBox: NSBox!
+    @IBOutlet weak var horizontalCenterAreasBox: NSBox!
+    @IBOutlet weak var botoomAreasBox: NSBox!
+    @IBOutlet weak var verticalAreasBox: NSBox!
+    @IBOutlet weak var alignmentLine1: NSView!
+    @IBOutlet weak var alignmentLine2: NSView!
+    
+    var leftAreasVC: KMDesignPropertySelector?
+    var verticalCenterAreasVC: KMDesignPropertySelector?
+    var rightButtonAreasVC: KMDesignPropertySelector?
+    var horzontalAreasVC: KMDesignPropertySelector?
+    var topAreasVC: KMDesignPropertySelector?
+    var horizontalCenterAreasVC: KMDesignPropertySelector?
+    var botoomAreasVC: KMDesignPropertySelector?
+    var verticalAreasVC: KMDesignPropertySelector?
+    
+    var editingAreas: [Any] = [] {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
+    var didChange: KMEditPropertyAlignmentViewDidChange?
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+        
+    }
+    
+    override func setup() {
+        alignmentLabel.font = NSFont.SFProTextSemibold(12.0)
+        alignmentLabel.textColor = NSColor(hex: "#616469")
+        
+        alignmentLine1.backgroundColor(NSColor(hex: "#000000", alpha: 0.1))
+        alignmentLine2.backgroundColor(NSColor(hex: "#000000", alpha: 0.1))
+        
+        leftAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        leftAreasBox.contentView = leftAreasVC?.view
+        leftAreasBox.fillColor = NSColor.clear
+        leftAreasVC?.target = self
+        leftAreasVC?.button.tag = 0
+        leftAreasVC?.action = #selector(areasAlignStyleAction)
+        leftAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage45")!
+        leftAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage45_1")!
+        leftAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage45_1")!
+        leftAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage45_1")!
+        leftAreasVC?.updateUI()
+        
+        verticalCenterAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        verticalCenterAreasBox.contentView = verticalCenterAreasVC?.view
+        verticalCenterAreasBox.fillColor = NSColor.clear
+        verticalCenterAreasVC?.target = self
+        verticalCenterAreasVC?.button.tag = 1
+        verticalCenterAreasVC?.action = #selector(areasAlignStyleAction)
+        verticalCenterAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage46")!
+        verticalCenterAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage46_1")!
+        verticalCenterAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage46_1")!
+        verticalCenterAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage46_1")!
+        verticalCenterAreasVC?.updateUI()
+        
+        rightButtonAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        rightButtonAreasBox.contentView = rightButtonAreasVC?.view
+        rightButtonAreasBox.fillColor = NSColor.clear
+        rightButtonAreasVC?.target = self
+        rightButtonAreasVC?.button.tag = 2
+        rightButtonAreasVC?.action = #selector(areasAlignStyleAction)
+        rightButtonAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage47_1")!
+        rightButtonAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage47")!
+        rightButtonAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage47_1")!
+        rightButtonAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage47_1")!
+        rightButtonAreasVC?.updateUI()
+        
+        horzontalAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        horzontalAreasBox.contentView = horzontalAreasVC?.view
+        horzontalAreasBox.fillColor = NSColor.clear
+        horzontalAreasVC?.target = self
+        horzontalAreasVC?.button.tag = 7
+        horzontalAreasVC?.action = #selector(areasAlignStyleAction)
+        horzontalAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage21_1")!
+        horzontalAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage21")!
+        horzontalAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage21_1")!
+        horzontalAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage21_1")!
+        horzontalAreasVC?.updateUI()
+        
+        topAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        topAreasBox.contentView = topAreasVC?.view
+        topAreasBox.fillColor = NSColor.clear
+        topAreasVC?.button.tag = 3
+        topAreasVC?.target = self
+        topAreasVC?.action = #selector(areasAlignStyleAction)
+        topAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage48_1")!
+        topAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage48")!
+        topAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage48_1")!
+        topAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage48_1")!
+        topAreasVC?.updateUI()
+        
+        horizontalCenterAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        horizontalCenterAreasBox.contentView = horizontalCenterAreasVC?.view
+        horizontalCenterAreasBox.fillColor = NSColor.clear
+        horizontalCenterAreasVC?.button.tag = 4
+        horizontalCenterAreasVC?.target = self
+        horizontalCenterAreasVC?.action = #selector(areasAlignStyleAction)
+        horizontalCenterAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage49_1")!
+        horizontalCenterAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage49")!
+        horizontalCenterAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage49_1")!
+        horizontalCenterAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage49_1")!
+        horizontalCenterAreasVC?.updateUI()
+        
+        botoomAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        botoomAreasBox.contentView = botoomAreasVC?.view
+        botoomAreasBox.fillColor = NSColor.clear
+        botoomAreasVC?.button.tag = 5
+        botoomAreasVC?.target = self
+        botoomAreasVC?.action = #selector(areasAlignStyleAction)
+        botoomAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage50_1")!
+        botoomAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage50")!
+        botoomAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage50_1")!
+        botoomAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage50_1")!
+        botoomAreasVC?.updateUI()
+        
+        verticalAreasVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
+        verticalAreasBox.contentView = verticalAreasVC?.view
+        verticalAreasBox.fillColor = NSColor.clear
+        verticalAreasVC?.button.tag = 6
+        verticalAreasVC?.target = self
+        verticalAreasVC?.action = #selector(areasAlignStyleAction)
+        verticalAreasVC?.image = NSImage(named: "KMImageNameEditPDFImage20_1")!
+        verticalAreasVC?._image_disabled = NSImage(named: "KMImageNameEditPDFImage20")!
+        verticalAreasVC?._image_sel = NSImage(named: "KMImageNameEditPDFImage20_1")!
+        verticalAreasVC?._image_hov = NSImage(named: "KMImageNameEditPDFImage20_1")!
+        verticalAreasVC?.updateUI()
+    }
+    
+    override func reloadData() {
+        self.updateFormAearsAlignmentState()
+    }
+}
+
+extension KMEditPropertyAlignmentView {
+    @objc func areasAlignStyleAction(_ sender: NSButton) {
+        self.updateFormAearsAlignMangent(stype: CPDFActiveAreasAlignType.init(rawValue: sender.tag) ?? .Left)
+    }
+}
+
+extension KMEditPropertyAlignmentView {
+    func updateFormAearsAlignmentState() {
+        let areasArray = [leftAreasVC, verticalCenterAreasVC, rightButtonAreasVC, horzontalAreasVC, topAreasVC, horizontalCenterAreasVC, botoomAreasVC, verticalAreasVC]
+        if self.editingAreas.count < 2 {
+            for view in areasArray {
+                view?.image = (view?._image_disabled)!
+                view?._enabled = false
+            }
+        } else if self.editingAreas.count == 2 {
+            for view in areasArray {
+                if view == verticalAreasVC || view == horzontalAreasVC {
+                    view?.image = (view?._image_disabled)!
+                    view?._enabled = false
+                } else {
+                    view?.image = (view?._image_sel)!
+                    view?._enabled = true
+                }
+            }
+        } else if self.editingAreas.count > 2 {
+            for view in areasArray {
+                view?.image = (view?._image_sel)!
+                view?._enabled = true
+            }
+        }
+    }
+    
+    func updateFormAearsAlignMangent(stype: CPDFActiveAreasAlignType) {
+        print("updateFormAearsAlignMangent")
+        let editingAreas = self.editingAreas
+        if editingAreas.count >= 2 {
+            
+            var zeroRect = NSRect.null
+            var highestRect = NSZeroRect
+            var widthestRect = NSZeroRect
+            
+            let fristArea : CPDFEditArea = editingAreas.first as! CPDFEditArea
+            var leftestRect = fristArea.bounds
+            var rightestRect = fristArea.bounds
+            var topestRect = fristArea.bounds
+            var bottomestRect = fristArea.bounds
+            
+            var leftestArea : CPDFEditArea = fristArea
+            var rightestArea : CPDFEditArea = fristArea
+            var topestArea : CPDFEditArea = fristArea
+            var bottomestArea : CPDFEditArea = fristArea
+            
+            var totalWidth = 0.0
+            var totalHeight = 0.0
+            
+            for i in 0 ... editingAreas.count-1 {
+                let area : CPDFEditArea = editingAreas[i] as! CPDFEditArea
+                zeroRect = zeroRect.union(area.bounds)
+                totalWidth = totalWidth + area.bounds.width
+                totalHeight = totalHeight + area.bounds.height
+                
+                if area.bounds.height > highestRect.height {
+                    highestRect = area.bounds
+                }
+                
+                if area.bounds.width > widthestRect.width {
+                    widthestRect = area.bounds
+                }
+                
+                if leftestRect.minX > area.bounds.minX {
+                    leftestRect = area.bounds
+                    leftestArea = area
+                }
+                
+                if area.bounds.maxX > rightestRect.maxX {
+                    rightestRect = area.bounds
+                    rightestArea = area
+                }
+                
+                if area.bounds.maxY > topestRect.maxY {
+                    topestRect = area.bounds
+                    topestArea = area
+                }
+                
+                if bottomestRect.minY > area.bounds.minY {
+                    bottomestRect = area.bounds
+                    bottomestArea = area
+                }
+            }
+            
+            var resultAreasArray: [Any] = []
+            var newBoundsArray: [String] = []
+            if stype == .Left {
+                for i in 0 ... editingAreas.count-1 {
+                    let areas = editingAreas[i] as! CPDFEditArea
+                    var bounds = areas.bounds
+                    bounds.origin.x = zeroRect.origin.x
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                }
+                resultAreasArray = editingAreas
+            } else if stype == .Right {
+                for i in 0 ... editingAreas.count-1 {
+                    let areas = editingAreas[i] as! CPDFEditArea
+                    var bounds = areas.bounds
+                    bounds.origin.x = zeroRect.maxX - bounds.size.width
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                }
+                resultAreasArray = editingAreas
+            } else if stype == .Top {
+                for i in 0 ... editingAreas.count-1 {
+                    let areas = editingAreas[i] as! CPDFEditArea
+                    var bounds = areas.bounds
+                    bounds.origin.y = zeroRect.maxY - bounds.size.height
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                }
+                resultAreasArray = editingAreas
+            } else if stype == .Bottom {
+                for i in 0 ... editingAreas.count-1 {
+                    let areas = editingAreas[i] as! CPDFEditArea
+                    var bounds = areas.bounds
+                    bounds.origin.y = zeroRect.minY
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                }
+                resultAreasArray = editingAreas
+            } else if stype == .Horizontally {
+                for i in 0 ... editingAreas.count-1 {
+                    let areas = editingAreas[i] as! CPDFEditArea
+                    var bounds = areas.bounds
+                    bounds.origin.y = highestRect.midY - bounds.height/2
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                }
+                resultAreasArray = editingAreas
+            } else if stype == .Vertical {
+                for i in 0 ... editingAreas.count-1 {
+                    let areas = editingAreas[i] as! CPDFEditArea
+                    var bounds = areas.bounds
+                    bounds.origin.x = widthestRect.midX - bounds.width/2
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                }
+                resultAreasArray = editingAreas
+            } else if stype == .DisHorizontally {
+                let middleGap = zeroRect.width - leftestRect.width - rightestRect.width
+                let otherAreasTotalWidth = totalWidth - leftestRect.width - rightestRect.width
+                
+                let gap = (middleGap - otherAreasTotalWidth)/CGFloat(editingAreas.count - 1)
+                var areasCopyArray : [CPDFEditArea] = editingAreas as! [CPDFEditArea]
+                areasCopyArray.sorted(by: { obj1, obj2 in
+                    let area1 = obj1
+                    let area2 = obj2
+                    if area1.bounds.origin.x < area2.bounds.origin.x {
+                        return true
+                    } else {
+                        return false
+                    }
+                })
+                
+                if let index = areasCopyArray.firstIndex(of: leftestArea) {
+                    areasCopyArray.remove(at: index)
+                }
+                
+                if let index = areasCopyArray.firstIndex(of: rightestArea) {
+                    areasCopyArray.remove(at: index)
+                }
+                
+                var leftStartX = leftestRect.maxX + gap
+                for i in 0 ... areasCopyArray.count-1 {
+                    let areas = areasCopyArray[i]
+                    var bounds = areas.bounds
+                    bounds.origin.x = leftStartX
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                    leftStartX = leftStartX + bounds.width + gap
+                }
+                resultAreasArray = areasCopyArray
+            } else if stype == .DisVertical {
+                let middleGap = zeroRect.height - topestRect.height - bottomestRect.height
+                let otherAreasTotalHeight = totalHeight - topestRect.height - bottomestRect.height
+                
+                let gap = (middleGap - otherAreasTotalHeight)/CGFloat(editingAreas.count - 1)
+                var areasCopyArray : [CPDFEditArea] = editingAreas as! [CPDFEditArea]
+                areasCopyArray.sorted(by: { obj1, obj2 in
+                    let area1 = obj1
+                    let area2 = obj2
+                    if area1.bounds.origin.x < area2.bounds.origin.x {
+                        return true
+                    } else {
+                        return false
+                    }
+                })
+                if let index = areasCopyArray.firstIndex(of: topestArea) {
+                    areasCopyArray.remove(at: index)
+                }
+                
+                if let index = areasCopyArray.firstIndex(of: bottomestArea) {
+                    areasCopyArray.remove(at: index)
+                }
+                
+                var bottomStartY = bottomestRect.maxY + gap
+                for i in 0 ... areasCopyArray.count-1 {
+                    let areas = areasCopyArray[i]
+                    var bounds = areas.bounds
+                    bounds.origin.y = bottomStartY
+                    newBoundsArray.append(NSStringFromRect(bounds))
+                    bottomStartY = bottomStartY + bounds.height + gap
+                }
+                resultAreasArray = areasCopyArray
+            }
+            self.didChange?(self, resultAreasArray, newBoundsArray)
+        }
+    }
+}

+ 200 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/View/AlignmentView/KMEditPropertyAlignmentView.xib

@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMEditPropertyAlignmentView" customModule="PDF_Master" customModuleProvider="target">
+            <connections>
+                <outlet property="alignmentLabel" destination="93h-Zp-u0e" id="tXr-BN-b42"/>
+                <outlet property="alignmentLine1" destination="lCR-he-1dp" id="GPI-5y-bM7"/>
+                <outlet property="alignmentLine2" destination="vaB-EX-shv" id="34f-P1-xes"/>
+                <outlet property="botoomAreasBox" destination="5dI-pc-D5F" id="hIW-rt-AxG"/>
+                <outlet property="horizontalCenterAreasBox" destination="54K-Mb-HzH" id="tqk-Hy-eiN"/>
+                <outlet property="horzontalAreasBox" destination="1aE-fX-KCQ" id="r63-qN-tGM"/>
+                <outlet property="leftAreasBox" destination="s1L-B4-HBJ" id="IaR-Pw-87N"/>
+                <outlet property="rightButtonAreasBox" destination="f42-Qo-K3s" id="IHw-Gb-qCe"/>
+                <outlet property="topAreasBox" destination="JMi-Bm-lSz" id="bew-27-gF1"/>
+                <outlet property="verticalAreasBox" destination="wL7-h0-dzD" id="prr-WT-0In"/>
+                <outlet property="verticalCenterAreasBox" destination="WMK-p2-3rr" id="MeP-hy-r3v"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe">
+            <rect key="frame" x="0.0" y="0.0" width="232" height="100"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="h6e-kO-nVY">
+                    <rect key="frame" x="0.0" y="0.0" width="232" height="100"/>
+                    <subviews>
+                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="93h-Zp-u0e">
+                            <rect key="frame" x="-2" y="84" width="35" height="16"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="Align" id="jFd-TA-40c">
+                                <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>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="Z5G-FU-X0F">
+                            <rect key="frame" x="0.0" y="0.0" width="232" height="76"/>
+                            <subviews>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" translatesAutoresizingMaskIntoConstraints="NO" id="s1L-B4-HBJ">
+                                    <rect key="frame" x="0.0" y="44" width="32" height="32"/>
+                                    <view key="contentView" id="02G-bS-why">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="32" id="NgT-rR-h7y"/>
+                                        <constraint firstAttribute="width" constant="32" id="STb-hs-c11"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="WMK-p2-3rr">
+                                    <rect key="frame" x="40" y="44" width="32" height="32"/>
+                                    <view key="contentView" id="sPt-xM-LQO">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="32" id="o77-F7-Dk9"/>
+                                        <constraint firstAttribute="width" constant="32" id="sq9-i9-QNf"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="f42-Qo-K3s">
+                                    <rect key="frame" x="80" y="44" width="32" height="32"/>
+                                    <view key="contentView" id="89B-Tv-dyt">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="32" id="GMh-oY-kUL"/>
+                                        <constraint firstAttribute="height" constant="32" id="JRA-y0-OEb"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="1aE-fX-KCQ">
+                                    <rect key="frame" x="129" y="44" width="32" height="32"/>
+                                    <view key="contentView" id="TYi-3d-o1f">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="32" id="UEU-o9-8Lr"/>
+                                        <constraint firstAttribute="width" constant="32" id="Uz1-hq-Vlo"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="JMi-Bm-lSz">
+                                    <rect key="frame" x="0.0" y="4" width="32" height="32"/>
+                                    <view key="contentView" id="v3j-sY-Q0I">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="32" id="4hc-0i-ekL"/>
+                                        <constraint firstAttribute="height" constant="32" id="hBQ-lX-KZj"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="54K-Mb-HzH">
+                                    <rect key="frame" x="40" y="4" width="32" height="32"/>
+                                    <view key="contentView" id="dNa-37-Rj1">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="32" id="4wU-Q6-712"/>
+                                        <constraint firstAttribute="height" constant="32" id="k90-Ol-R1c"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="5dI-pc-D5F">
+                                    <rect key="frame" x="80" y="4" width="32" height="32"/>
+                                    <view key="contentView" id="bfP-uL-gCG">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="32" id="6wk-hZ-sEW"/>
+                                        <constraint firstAttribute="width" constant="32" id="wPc-kt-g2N"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="lCR-he-1dp">
+                                    <rect key="frame" x="120" y="52" width="1" height="16"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="16" id="mra-vI-PxV"/>
+                                        <constraint firstAttribute="width" constant="1" id="qJN-kQ-8KM"/>
+                                    </constraints>
+                                </customView>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="vaB-EX-shv">
+                                    <rect key="frame" x="120" y="12" width="1" height="16"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="16" id="IaX-re-qvW"/>
+                                        <constraint firstAttribute="width" constant="1" id="fa8-Xr-ndb"/>
+                                    </constraints>
+                                </customView>
+                                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="wL7-h0-dzD">
+                                    <rect key="frame" x="129" y="4" width="32" height="32"/>
+                                    <view key="contentView" id="xqn-Rd-1cg">
+                                        <rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="32" id="Hub-kp-79V"/>
+                                        <constraint firstAttribute="width" constant="32" id="baU-5R-6Ho"/>
+                                    </constraints>
+                                    <color key="fillColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </box>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="f42-Qo-K3s" firstAttribute="top" secondItem="Z5G-FU-X0F" secondAttribute="top" id="0Kg-5N-CdA"/>
+                                <constraint firstItem="WMK-p2-3rr" firstAttribute="top" secondItem="Z5G-FU-X0F" secondAttribute="top" id="18x-tD-H8t"/>
+                                <constraint firstItem="wL7-h0-dzD" firstAttribute="top" secondItem="1aE-fX-KCQ" secondAttribute="bottom" constant="8" id="1By-sk-iHp"/>
+                                <constraint firstItem="f42-Qo-K3s" firstAttribute="top" secondItem="02G-bS-why" secondAttribute="top" id="1vw-Ks-9OA"/>
+                                <constraint firstItem="5dI-pc-D5F" firstAttribute="leading" secondItem="54K-Mb-HzH" secondAttribute="trailing" constant="8" id="9NJ-hU-HX0"/>
+                                <constraint firstItem="wL7-h0-dzD" firstAttribute="leading" secondItem="vaB-EX-shv" secondAttribute="trailing" constant="8" id="Ea1-h5-zPU"/>
+                                <constraint firstItem="1aE-fX-KCQ" firstAttribute="top" secondItem="02G-bS-why" secondAttribute="top" id="GHL-wR-1GJ"/>
+                                <constraint firstItem="1aE-fX-KCQ" firstAttribute="leading" secondItem="lCR-he-1dp" secondAttribute="trailing" constant="8" id="M2b-9O-dfY"/>
+                                <constraint firstItem="JMi-Bm-lSz" firstAttribute="leading" secondItem="Z5G-FU-X0F" secondAttribute="leading" id="O8W-jV-afg"/>
+                                <constraint firstItem="1aE-fX-KCQ" firstAttribute="top" secondItem="Z5G-FU-X0F" secondAttribute="top" id="OdM-ja-FDq"/>
+                                <constraint firstItem="vaB-EX-shv" firstAttribute="top" secondItem="JMi-Bm-lSz" secondAttribute="top" constant="8" id="Olv-9f-qls"/>
+                                <constraint firstItem="lCR-he-1dp" firstAttribute="top" secondItem="Z5G-FU-X0F" secondAttribute="top" constant="8" id="YcE-EL-lRi"/>
+                                <constraint firstItem="lCR-he-1dp" firstAttribute="leading" secondItem="f42-Qo-K3s" secondAttribute="trailing" constant="8" id="eMZ-9S-C55"/>
+                                <constraint firstItem="54K-Mb-HzH" firstAttribute="leading" secondItem="JMi-Bm-lSz" secondAttribute="trailing" constant="8" id="fg5-1c-QGb"/>
+                                <constraint firstItem="s1L-B4-HBJ" firstAttribute="leading" secondItem="Z5G-FU-X0F" secondAttribute="leading" id="hgt-B0-6X4"/>
+                                <constraint firstItem="WMK-p2-3rr" firstAttribute="leading" secondItem="s1L-B4-HBJ" secondAttribute="trailing" constant="8" id="lC0-zF-kEJ"/>
+                                <constraint firstItem="f42-Qo-K3s" firstAttribute="leading" secondItem="WMK-p2-3rr" secondAttribute="trailing" constant="8" id="s7C-vV-ghP"/>
+                                <constraint firstItem="54K-Mb-HzH" firstAttribute="top" secondItem="WMK-p2-3rr" secondAttribute="bottom" constant="8" id="uUS-G2-LHc"/>
+                                <constraint firstItem="s1L-B4-HBJ" firstAttribute="top" secondItem="Z5G-FU-X0F" secondAttribute="top" id="yci-Cv-cO4"/>
+                                <constraint firstItem="JMi-Bm-lSz" firstAttribute="top" secondItem="s1L-B4-HBJ" secondAttribute="bottom" constant="8" id="zXs-Ee-Cy4"/>
+                                <constraint firstItem="vaB-EX-shv" firstAttribute="leading" secondItem="5dI-pc-D5F" secondAttribute="trailing" constant="8" id="za9-cR-2ok"/>
+                                <constraint firstItem="5dI-pc-D5F" firstAttribute="top" secondItem="f42-Qo-K3s" secondAttribute="bottom" constant="8" id="zte-P4-bAC"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="Z5G-FU-X0F" firstAttribute="leading" secondItem="h6e-kO-nVY" secondAttribute="leading" id="63P-zI-KcU"/>
+                        <constraint firstAttribute="bottom" secondItem="Z5G-FU-X0F" secondAttribute="bottom" id="MKS-bH-NH1"/>
+                        <constraint firstAttribute="height" constant="100" id="PYy-X1-hKV"/>
+                        <constraint firstItem="93h-Zp-u0e" firstAttribute="top" secondItem="h6e-kO-nVY" secondAttribute="top" id="gUl-xt-LvF"/>
+                        <constraint firstItem="93h-Zp-u0e" firstAttribute="leading" secondItem="h6e-kO-nVY" secondAttribute="leading" id="nUG-LP-xCS"/>
+                        <constraint firstAttribute="trailing" secondItem="Z5G-FU-X0F" secondAttribute="trailing" id="qYX-Bq-stq"/>
+                        <constraint firstItem="Z5G-FU-X0F" firstAttribute="top" secondItem="93h-Zp-u0e" secondAttribute="bottom" constant="8" id="sKt-rh-6gs"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="h6e-kO-nVY" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="2xs-h8-uHd"/>
+                <constraint firstAttribute="trailing" secondItem="h6e-kO-nVY" secondAttribute="trailing" id="4fB-Pg-9EK"/>
+                <constraint firstAttribute="bottom" secondItem="h6e-kO-nVY" secondAttribute="bottom" id="Nqk-vX-66j"/>
+                <constraint firstItem="h6e-kO-nVY" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="V9J-OL-bXk"/>
+            </constraints>
+            <point key="canvasLocation" x="15" y="154"/>
+        </customView>
+    </objects>
+</document>

+ 3 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -171,6 +171,9 @@ extension KMMainViewController: KMToolbarControllerDelegate {
                 self.rightSideViewController.subViewType = .EditPDFAddText
                 self.listView.setShouAddEdit(.text)
             } else if self.listView.annotationType == .addImage {
+                self.rightSideViewController.isHidden = false
+                self.openRightPane()
+                
                 self.rightSideViewController.subViewType = .EditPDFAddImage
                 self.listView.setShouAddEdit(.image)
             }