Explorar el Código

参数兼容 - 支持未来 Rect 和 Size 参数

zhudongyong hace 1 año
padre
commit
ae0d9396cc

+ 20 - 4
KdanAutoTest/KdanAuto.xcodeproj/project.pbxproj

@@ -58,6 +58,10 @@
 		24848DC329ED2E4B002A7ED5 /* ASBOOLPropertyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24848DC129ED2E4B002A7ED5 /* ASBOOLPropertyCell.xib */; };
 		24848DC629ED2FE4002A7ED5 /* ASFloatPropertyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24848DC429ED2FE4002A7ED5 /* ASFloatPropertyCell.xib */; };
 		24848DC729ED2FE4002A7ED5 /* ASFloatPropertyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24848DC529ED2FE4002A7ED5 /* ASFloatPropertyCell.swift */; };
+		24848DD529EEB9E2002A7ED5 /* ASRectPropertyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24848DD329EEB9E1002A7ED5 /* ASRectPropertyCell.xib */; };
+		24848DD629EEB9E2002A7ED5 /* ASRectPropertyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24848DD429EEB9E2002A7ED5 /* ASRectPropertyCell.swift */; };
+		24848DD929EEBCBC002A7ED5 /* ASSizePropertyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24848DD729EEBCBB002A7ED5 /* ASSizePropertyCell.xib */; };
+		24848DDA29EEBCBC002A7ED5 /* ASSizePropertyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24848DD829EEBCBB002A7ED5 /* ASSizePropertyCell.swift */; };
 		24A6FF49293091E000B34F2E /* AutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF48293091E000B34F2E /* AutoTest.swift */; };
 		24A6FF4B2930939D00B34F2E /* TextColorAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF4A2930939D00B34F2E /* TextColorAutoTest.swift */; };
 		24A6FF4F2930A1E100B34F2E /* FontAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF4E2930A1E100B34F2E /* FontAutoTest.swift */; };
@@ -206,6 +210,10 @@
 		24848DC129ED2E4B002A7ED5 /* ASBOOLPropertyCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ASBOOLPropertyCell.xib; sourceTree = "<group>"; };
 		24848DC429ED2FE4002A7ED5 /* ASFloatPropertyCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ASFloatPropertyCell.xib; sourceTree = "<group>"; };
 		24848DC529ED2FE4002A7ED5 /* ASFloatPropertyCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASFloatPropertyCell.swift; sourceTree = "<group>"; };
+		24848DD329EEB9E1002A7ED5 /* ASRectPropertyCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ASRectPropertyCell.xib; sourceTree = "<group>"; };
+		24848DD429EEB9E2002A7ED5 /* ASRectPropertyCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASRectPropertyCell.swift; sourceTree = "<group>"; };
+		24848DD729EEBCBB002A7ED5 /* ASSizePropertyCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ASSizePropertyCell.xib; sourceTree = "<group>"; };
+		24848DD829EEBCBB002A7ED5 /* ASSizePropertyCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASSizePropertyCell.swift; sourceTree = "<group>"; };
 		24A6FF48293091E000B34F2E /* AutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoTest.swift; sourceTree = "<group>"; };
 		24A6FF4A2930939D00B34F2E /* TextColorAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextColorAutoTest.swift; sourceTree = "<group>"; };
 		24A6FF4E2930A1E100B34F2E /* FontAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontAutoTest.swift; sourceTree = "<group>"; };
@@ -454,6 +462,10 @@
 				24848DC129ED2E4B002A7ED5 /* ASBOOLPropertyCell.xib */,
 				24848DC529ED2FE4002A7ED5 /* ASFloatPropertyCell.swift */,
 				24848DC429ED2FE4002A7ED5 /* ASFloatPropertyCell.xib */,
+				24848DD429EEB9E2002A7ED5 /* ASRectPropertyCell.swift */,
+				24848DD329EEB9E1002A7ED5 /* ASRectPropertyCell.xib */,
+				24848DD829EEBCBB002A7ED5 /* ASSizePropertyCell.swift */,
+				24848DD729EEBCBB002A7ED5 /* ASSizePropertyCell.xib */,
 			);
 			path = PropertyCell;
 			sourceTree = "<group>";
@@ -839,6 +851,7 @@
 				24848DC629ED2FE4002A7ED5 /* ASFloatPropertyCell.xib in Resources */,
 				24848DB929ED2821002A7ED5 /* ASPropertyCell.xib in Resources */,
 				242F966F298BAE2200CFF56C /* Toggle_half.png in Resources */,
+				24848DD529EEB9E2002A7ED5 /* ASRectPropertyCell.xib in Resources */,
 				24D70000292B6FD100DAB5EE /* SettingViewController.xib in Resources */,
 				24D7FFA229261A6600DAB5EE /* Main.storyboard in Resources */,
 				24848DBB29ED2852002A7ED5 /* ASIntPropertyCell.xib in Resources */,
@@ -846,6 +859,7 @@
 				242F966D298BAE2200CFF56C /* Toggle_off.png in Resources */,
 				24848DBF29ED2B3F002A7ED5 /* ASSelectPropertyCell.xib in Resources */,
 				24848DB029ED0E2A002A7ED5 /* AdvanceSettingViewController.xib in Resources */,
+				24848DD929EEBCBC002A7ED5 /* ASSizePropertyCell.xib in Resources */,
 				24DCE8B0295047D8004EBA35 /* TestFileCellView.xib in Resources */,
 				24DCE8AC295046E7004EBA35 /* TestFileTypeCellView.xib in Resources */,
 			);
@@ -912,10 +926,12 @@
 				246FE591299DCFC400706586 /* PDFCompareTest.swift in Sources */,
 				24D7FFFE292B509000DAB5EE /* DataModel.swift in Sources */,
 				24CA2337298FD6BE00038E10 /* ImageCompareCellView.swift in Sources */,
+				24848DDA29EEBCBC002A7ED5 /* ASSizePropertyCell.swift in Sources */,
 				24D7FF9B29261A6400DAB5EE /* AppDelegate.swift in Sources */,
 				243DACD32940C6E8008A8AA6 /* ActivityView.swift in Sources */,
 				24848DC729ED2FE4002A7ED5 /* ASFloatPropertyCell.swift in Sources */,
 				24AE7B4D298BD98300462BD3 /* CompareViewController.swift in Sources */,
+				24848DD629EEB9E2002A7ED5 /* ASRectPropertyCell.swift in Sources */,
 				240934B42992735200839CC8 /* FileConverter.swift in Sources */,
 				246FE5A4299E0FCD00706586 /* ioapi.c in Sources */,
 				24D7000B292D16BB00DAB5EE /* StringAutoTest.swift in Sources */,
@@ -1146,7 +1162,7 @@
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
 				CODE_SIGN_STYLE = Manual;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 20230404;
+				CURRENT_PROJECT_VERSION = 20230418;
 				DEVELOPMENT_TEAM = "";
 				ENABLE_HARDENED_RUNTIME = YES;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -1168,7 +1184,7 @@
 					"$(PROJECT_DIR)/KdanAuto/Third\\ Part\\ Library/otherlib",
 				);
 				MACOSX_DEPLOYMENT_TARGET = 10.15;
-				MARKETING_VERSION = 1.0;
+				MARKETING_VERSION = 1.1;
 				PRODUCT_BUNDLE_IDENTIFIER = com.brother.kdanauto.mac;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1186,7 +1202,7 @@
 				CODE_SIGN_ENTITLEMENTS = KdanAuto/KdanAuto.entitlements;
 				CODE_SIGN_STYLE = Manual;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 20230404;
+				CURRENT_PROJECT_VERSION = 20230418;
 				ENABLE_HARDENED_RUNTIME = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -1207,7 +1223,7 @@
 					"$(PROJECT_DIR)/KdanAuto/Third\\ Part\\ Library/otherlib",
 				);
 				MACOSX_DEPLOYMENT_TARGET = 10.15;
-				MARKETING_VERSION = 1.0;
+				MARKETING_VERSION = 1.1;
 				PRODUCT_BUNDLE_IDENTIFIER = com.brother.kdanauto.mac;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;

BIN
KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/UserInterfaceState.xcuserstate


+ 10 - 2
KdanAutoTest/KdanAuto/Class/AdvanceSettingViewController/PropertyCell/ASPropertyCell.swift

@@ -47,9 +47,17 @@ class ASPropertyCell: NSView {
                 object = ASSelectPropertyCell.shared()
             }
         }else if (NSArray(array: ["CGSize", "NSSize"]).contains(valueType)) {
-            
+            if (info.value(forKey: "Values") == nil){
+                object = ASSizePropertyCell.shared()
+            }else {
+                object = ASSelectPropertyCell.shared()
+            }
         }else if (NSArray(array: ["CGRect", "NSRect"]).contains(valueType)) {
-            
+            if (info.value(forKey: "Values") == nil){
+                object = ASRectPropertyCell.shared()
+            }else {
+                object = ASSelectPropertyCell.shared()
+            }
         }
         
         if (object != nil) {

+ 73 - 0
KdanAutoTest/KdanAuto/Class/AdvanceSettingViewController/PropertyCell/ASRectPropertyCell.swift

@@ -0,0 +1,73 @@
+//
+//  ASIntPropertyCell.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2023/4/17.
+//
+
+import Cocoa
+
+class ASRectPropertyCell: ASPropertyCell, NSTextFieldDelegate {
+    @IBOutlet var m_titleLbl:NSTextField!
+    @IBOutlet var m_xTF:NSTextField!
+    @IBOutlet var m_yTF:NSTextField!
+    @IBOutlet var m_wTF:NSTextField!
+    @IBOutlet var m_hTF:NSTextField!
+
+    override class func shared() -> ASPropertyCell? {
+        var objects : NSArray!
+        
+        Bundle.main.loadNibNamed("ASRectPropertyCell", owner: nil, topLevelObjects: &objects)
+        
+        for tView in objects {
+            if let tv = tView as? ASRectPropertyCell {
+                return tv
+            }
+        }
+        
+        return nil
+    }
+    
+    
+    /// Setter
+    override func setPropertyInfo(_ info:NSDictionary) {
+        super.setPropertyInfo(info)
+        
+        self.m_titleLbl.stringValue = "\(info.value(forKey: "Name") ?? ""):"
+        setValue((info.value(forKey: "DefaultValue") ?? "0") as AnyObject)
+    }
+    
+    override func setValue(_ value:AnyObject) {
+        super.setValue(value)
+        
+        if (value as? String) != nil {
+            let rectString = value as! String
+            let rect = NSRectFromString(rectString);
+            
+            self.m_xTF.stringValue = "\(rect.origin.x)";
+            self.m_yTF.stringValue = "\(rect.origin.y)";
+            self.m_wTF.stringValue = "\(rect.size.width)";
+            self.m_hTF.stringValue = "\(rect.size.height)";
+        }
+    }
+    
+    override func value() -> AnyObject {
+        let rect = CGRectMake(CGFloat(NSString(string: self.m_xTF.stringValue).floatValue),
+                              CGFloat(NSString(string: self.m_yTF.stringValue).floatValue),
+                              CGFloat(NSString(string: self.m_wTF.stringValue).floatValue),
+                              CGFloat(NSString(string: self.m_hTF.stringValue).floatValue))
+        return NSStringFromRect(rect) as AnyObject
+    }
+    
+    
+    override func setEnabled(_ enabled:Bool) {
+        super.setEnabled(enabled)
+        
+        self.alphaValue = enabled ? 1 : 0.6
+        self.m_xTF.isEnabled = enabled;
+        self.m_yTF.isEnabled = enabled;
+        self.m_wTF.isEnabled = enabled;
+        self.m_hTF.isEnabled = enabled;
+    }
+    
+}

+ 81 - 0
KdanAutoTest/KdanAuto/Class/AdvanceSettingViewController/PropertyCell/ASRectPropertyCell.xib

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="ASRectPropertyCell" customModule="KdanAuto" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="537" height="35"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+            <subviews>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="6Ly-h0-iEb">
+                    <rect key="frame" x="10" y="10" width="150" height="16"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="OCR Language:" id="WSS-P2-qfE">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="GUM-Lb-3mG">
+                    <rect key="frame" x="164" y="10" width="306" height="16"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="left" title="X=             Y=              W=             H=              " id="RZU-Ov-kKB">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" id="bvQ-r4-93y">
+                    <rect key="frame" x="179" y="8" width="45" height="21"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" title="100" bezelStyle="round" id="b1f-P0-XSh">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" id="gQj-be-3dy">
+                    <rect key="frame" x="246" y="8" width="45" height="21"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" title="100" bezelStyle="round" id="2Ow-L2-Fha">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" id="6GN-yo-Nfx">
+                    <rect key="frame" x="312" y="8" width="45" height="21"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" title="100" bezelStyle="round" id="V5E-qL-tvb">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" id="pwb-Gt-dan">
+                    <rect key="frame" x="375" y="7" width="45" height="21"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" title="100" bezelStyle="round" id="6DR-WX-pWM">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+            </subviews>
+            <connections>
+                <outlet property="m_hTF" destination="pwb-Gt-dan" id="gvn-xk-bAZ"/>
+                <outlet property="m_titleLbl" destination="6Ly-h0-iEb" id="0h9-zk-dHQ"/>
+                <outlet property="m_wTF" destination="6GN-yo-Nfx" id="Gvs-fr-4dW"/>
+                <outlet property="m_xTF" destination="bvQ-r4-93y" id="V2l-gm-oVx"/>
+                <outlet property="m_yTF" destination="gQj-be-3dy" id="v8b-FN-wcM"/>
+            </connections>
+            <point key="canvasLocation" x="142.5" y="31.5"/>
+        </customView>
+    </objects>
+</document>

+ 67 - 0
KdanAutoTest/KdanAuto/Class/AdvanceSettingViewController/PropertyCell/ASSizePropertyCell.swift

@@ -0,0 +1,67 @@
+//
+//  ASIntPropertyCell.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2023/4/17.
+//
+
+import Cocoa
+
+class ASSizePropertyCell: ASPropertyCell, NSTextFieldDelegate {
+    @IBOutlet var m_titleLbl:NSTextField!
+    @IBOutlet var m_wTF:NSTextField!
+    @IBOutlet var m_hTF:NSTextField!
+
+    override class func shared() -> ASPropertyCell? {
+        var objects : NSArray!
+        
+        Bundle.main.loadNibNamed("ASSizePropertyCell", owner: nil, topLevelObjects: &objects)
+        
+        for tView in objects {
+            if let tv = tView as? ASSizePropertyCell {
+                return tv
+            }
+        }
+        
+        return nil
+    }
+    
+    
+    /// Setter
+    override func setPropertyInfo(_ info:NSDictionary) {
+        super.setPropertyInfo(info)
+        
+        self.m_titleLbl.stringValue = "\(info.value(forKey: "Name") ?? ""):"
+        setValue((info.value(forKey: "DefaultValue") ?? "0") as AnyObject)
+    }
+    
+    override func setValue(_ value:AnyObject) {
+        super.setValue(value)
+        
+        if (value as? String) != nil {
+            let sizeString = value as! String
+            let size = NSSizeFromString(sizeString);
+            
+            self.m_wTF.stringValue = "\(rect.size.width)";
+            self.m_hTF.stringValue = "\(rect.size.height)";
+        }
+    }
+    
+    override func value() -> AnyObject {
+        let size = CGSizeMake(CGFloat(NSString(string: self.m_wTF.stringValue).floatValue),
+                              CGFloat(NSString(string: self.m_hTF.stringValue).floatValue))
+        return NSStringFromSize(size) as AnyObject
+    }
+    
+    
+    override func setEnabled(_ enabled:Bool) {
+        super.setEnabled(enabled)
+        
+        self.alphaValue = enabled ? 1 : 0.6
+        self.m_xTF.isEnabled = enabled;
+        self.m_yTF.isEnabled = enabled;
+        self.m_wTF.isEnabled = enabled;
+        self.m_hTF.isEnabled = enabled;
+    }
+    
+}

+ 61 - 0
KdanAutoTest/KdanAuto/Class/AdvanceSettingViewController/PropertyCell/ASSizePropertyCell.xib

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="ASSizePropertyCell" customModule="KdanAuto" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="537" height="35"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+            <subviews>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="6Ly-h0-iEb">
+                    <rect key="frame" x="10" y="10" width="150" height="16"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="OCR Language:" id="WSS-P2-qfE">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="GUM-Lb-3mG">
+                    <rect key="frame" x="164" y="10" width="306" height="16"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" alignment="left" title="W=             H=              " id="RZU-Ov-kKB">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" id="bvQ-r4-93y">
+                    <rect key="frame" x="184" y="8" width="45" height="21"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" title="100" bezelStyle="round" id="b1f-P0-XSh">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField verticalHuggingPriority="750" id="gQj-be-3dy">
+                    <rect key="frame" x="250" y="8" width="45" height="21"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" title="100" bezelStyle="round" id="2Ow-L2-Fha">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+            </subviews>
+            <connections>
+                <outlet property="m_hTF" destination="gQj-be-3dy" id="8YL-aA-H7A"/>
+                <outlet property="m_titleLbl" destination="6Ly-h0-iEb" id="0h9-zk-dHQ"/>
+                <outlet property="m_wTF" destination="bvQ-r4-93y" id="qDR-Qb-DBj"/>
+            </connections>
+            <point key="canvasLocation" x="142.5" y="31.5"/>
+        </customView>
+    </objects>
+</document>

+ 7 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTest.swift

@@ -1036,6 +1036,13 @@ extension AutoTest {
         let key = self.fileType() as String
         var ID = self.m_id as? String
         
+        self.clearCacheFiles()
+        self.clearOriginFiles()
+        self.clearCompareFiles()
+        
+        let directory = NSString(string: self.originFileDirectory()).deletingLastPathComponent
+        try? FileManager.default.removeItem(atPath: directory)
+        
         if nil != ID && cacheObjects.value(forKey: key) != nil {
             let objectInfo = cacheObjects.value(forKey: key) as! NSMutableDictionary
             

+ 4 - 1
KdanAutoTest/KdanAuto/Class/Norrmal/Cell/TestCaseCellView.swift

@@ -93,7 +93,10 @@ class TestCaseCellView : NSTableCellView, NSMenuDelegate {
             if (nil != self.window?.contentView) {
                 point = self.window!.contentView!.convert(point, to: self)
                 
-                if (event.type == .rightMouseUp && CGRectContainsPoint(self.bounds, point)) {
+                if (event.type == .rightMouseUp &&
+                    CGRectContainsPoint(self.bounds, point) &&
+                    (self.autoTestObj()?.status() == .Normal ||
+                     self.autoTestObj()?.status() == .Finished)) {
                     NSMenu.popUpContextMenu(self.menu!, with: event, for: self)
                     return nil;
                 }