Explorar o código

1.修改Esign Template增加数值显示和设置。

Pen Li %!s(int64=8) %!d(string=hai) anos
pai
achega
e04ae7e5b7

BIN=BIN
Ants Contract/AntsContract.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 48 - 8
Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard

@@ -1243,56 +1243,56 @@
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
                                 <subviews>
                                     <stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100000" id="861-cb-EzK">
-                                        <rect key="frame" x="147" y="56" width="94" height="29"/>
+                                        <rect key="frame" x="187" y="57" width="94" height="29"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <connections>
                                             <action selector="xStepperClick:" destination="IrJ-nO-Jqx" eventType="valueChanged" id="29M-XX-8zW"/>
                                         </connections>
                                     </stepper>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="X:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="36D-hz-mdm">
-                                        <rect key="frame" x="85" y="60" width="42" height="21"/>
+                                        <rect key="frame" x="79" y="60" width="42" height="21"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                         <nil key="textColor"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100000" id="kVq-yL-saL">
-                                        <rect key="frame" x="147" y="140" width="94" height="29"/>
+                                        <rect key="frame" x="187" y="140" width="94" height="29"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <connections>
                                             <action selector="wStepperClick:" destination="IrJ-nO-Jqx" eventType="valueChanged" id="yie-ft-cnp"/>
                                         </connections>
                                     </stepper>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="W:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1lA-wP-7Wy">
-                                        <rect key="frame" x="85" y="148" width="42" height="21"/>
+                                        <rect key="frame" x="79" y="148" width="42" height="21"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                         <nil key="textColor"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100000" id="iko-Xx-Khd">
-                                        <rect key="frame" x="500" y="56" width="94" height="29"/>
+                                        <rect key="frame" x="543" y="55" width="94" height="29"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <connections>
                                             <action selector="yStepperClick:" destination="IrJ-nO-Jqx" eventType="valueChanged" id="PLY-KM-dBk"/>
                                         </connections>
                                     </stepper>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Y:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2bv-uD-Gfj">
-                                        <rect key="frame" x="442" y="60" width="42" height="21"/>
+                                        <rect key="frame" x="429" y="60" width="42" height="21"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                         <nil key="textColor"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100000" id="DTJ-6C-VP7">
-                                        <rect key="frame" x="500" y="144" width="94" height="29"/>
+                                        <rect key="frame" x="543" y="139" width="94" height="29"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <connections>
                                             <action selector="hStepperClick:" destination="IrJ-nO-Jqx" eventType="valueChanged" id="CAt-mf-dob"/>
                                         </connections>
                                     </stepper>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="H:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="eK8-TQ-bhT">
-                                        <rect key="frame" x="450" y="148" width="42" height="21"/>
+                                        <rect key="frame" x="429" y="148" width="42" height="21"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                         <nil key="textColor"/>
@@ -1314,6 +1314,42 @@
                                             <action selector="bottomBtnClick:" destination="IrJ-nO-Jqx" eventType="touchUpInside" id="NWZ-LQ-YIg"/>
                                         </connections>
                                     </button>
+                                    <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" id="tGg-qJ-1DB">
+                                        <rect key="frame" x="113" y="57" width="72" height="30"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                        <nil key="textColor"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
+                                    </textField>
+                                    <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" id="KEu-MW-Ik7">
+                                        <rect key="frame" x="113" y="140" width="72" height="30"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                        <nil key="textColor"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
+                                    </textField>
+                                    <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" id="PFg-fR-Jk8">
+                                        <rect key="frame" x="468" y="54" width="72" height="30"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                        <nil key="textColor"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
+                                    </textField>
+                                    <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="clc-xQ-3KH">
+                                        <rect key="frame" x="591" y="245" width="46" height="30"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
+                                        <state key="normal" title="OK"/>
+                                        <connections>
+                                            <action selector="okBtnClick:" destination="IrJ-nO-Jqx" eventType="touchUpInside" id="PSG-BJ-fVB"/>
+                                        </connections>
+                                    </button>
+                                    <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" id="M9N-a4-XH5">
+                                        <rect key="frame" x="468" y="139" width="72" height="30"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                        <nil key="textColor"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
+                                    </textField>
                                 </subviews>
                                 <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
                             </view>
@@ -1335,13 +1371,17 @@
                     <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
                     <connections>
                         <outlet property="hStepper" destination="DTJ-6C-VP7" id="G8b-ar-HWN"/>
+                        <outlet property="hTextField" destination="M9N-a4-XH5" id="8b0-Jh-9rs"/>
                         <outlet property="ibSave" destination="lAX-gb-VMT" id="KOn-7l-p52"/>
                         <outlet property="left_button" destination="YRy-cf-b04" id="3xH-Ve-tNp"/>
                         <outlet property="positionControlBackground" destination="w7G-eF-IRC" id="ttu-7I-E79"/>
                         <outlet property="right_button" destination="tuM-sI-7IN" id="sVX-vn-m7h"/>
                         <outlet property="wStepper" destination="kVq-yL-saL" id="46E-go-Kzf"/>
+                        <outlet property="wTextField" destination="KEu-MW-Ik7" id="Sdu-wn-GdP"/>
                         <outlet property="xStepper" destination="861-cb-EzK" id="CUx-Ci-i5R"/>
+                        <outlet property="xTextField" destination="tGg-qJ-1DB" id="xbq-kq-QDV"/>
                         <outlet property="yStepper" destination="iko-Xx-Khd" id="suz-B6-D4P"/>
+                        <outlet property="yTextField" destination="PFg-fR-Jk8" id="fJq-kU-J8Z"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="83E-Gv-ZLo" userLabel="First Responder" sceneMemberID="firstResponder"/>

+ 32 - 4
Ants Contract/Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m

@@ -38,6 +38,11 @@
 @property (strong, nonatomic) IBOutlet UIStepper *wStepper;
 @property (strong, nonatomic) IBOutlet UIStepper *hStepper;
 
+@property (strong, nonatomic) IBOutlet UITextField *xTextField;
+@property (strong, nonatomic) IBOutlet UITextField *yTextField;
+@property (strong, nonatomic) IBOutlet UITextField *wTextField;
+@property (strong, nonatomic) IBOutlet UITextField *hTextField;
+
 
 @property (nonatomic,weak) UIView *focusView;
 @property (nonatomic,strong) UIColor *focusViewNormalColor;
@@ -1306,10 +1311,36 @@
     self.focusView.frame = frame;
 }
 
+- (IBAction)okBtnClick:(UIButton *)sender {
+    
+    float x = [self.xTextField.text floatValue];
+    float y = [self.yTextField.text floatValue];
+    float w = [self.wTextField.text floatValue];
+    float h = [self.hTextField.text floatValue];
+    
+    [self setX:x Y:y W:w H:h];
+    
+    CGRect frame = CGRectMake(x, y, w, h);
+    if (self.focusView) {
+        self.focusView.frame = frame;
+    }
+}
 
 
 #pragma mark - Control Update Delegate
 
+- (void) setX:(CGFloat) x Y:(CGFloat)y W:(CGFloat)w H:(CGFloat)h {
+    self.xStepper.value = x;
+    self.yStepper.value = y;
+    self.wStepper.value = w;
+    self.hStepper.value = h;
+    
+    self.xTextField.text = [NSString stringWithFormat:@"%.2f",x];
+    self.yTextField.text = [NSString stringWithFormat:@"%.2f",y];
+    self.wTextField.text = [NSString stringWithFormat:@"%.2f",w];
+    self.hTextField.text = [NSString stringWithFormat:@"%.2f",h];
+}
+
 - (void)focusControlView:(UIView *)view {
     
     [self recoveryFocusView];
@@ -1319,10 +1350,7 @@
         
         CGRect frame = self.focusView.frame;
         
-        self.xStepper.value = frame.origin.x;
-        self.yStepper.value = frame.origin.y;
-        self.wStepper.value = frame.size.width;
-        self.hStepper.value = frame.size.height;
+        [self setX:frame.origin.x Y:frame.origin.y W:frame.size.width H:frame.size.height];
         
         self.focusViewNormalColor = self.focusView.backgroundColor;
         self.focusView.backgroundColor = [UIColor redColor];