|
@@ -165,7 +165,7 @@ typedef enum {
|
|
|
|
|
|
|
|
// pdf
|
|
// pdf
|
|
|
[self updateView:self.pdfPageView];
|
|
[self updateView:self.pdfPageView];
|
|
|
- // NSLog(@"pdf page frame %@",[NSValue valueWithCGRect:self.pdfPageView.frame]);
|
|
|
|
|
|
|
+ // DebugLog(@"pdf page frame %@",[NSValue valueWithCGRect:self.pdfPageView.frame]);
|
|
|
[self.pdfPageView setNeedsDisplay];
|
|
[self.pdfPageView setNeedsDisplay];
|
|
|
|
|
|
|
|
// edit
|
|
// edit
|
|
@@ -409,44 +409,64 @@ typedef enum {
|
|
|
{
|
|
{
|
|
|
[[self view] endEditing:YES];
|
|
[[self view] endEditing:YES];
|
|
|
}
|
|
}
|
|
|
--(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
|
|
|
|
|
-{
|
|
|
|
|
|
|
+//-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
|
|
|
|
|
+//{
|
|
|
|
|
+// if (self.presentedViewController) {
|
|
|
|
|
+// [self.presentedViewController dismissViewControllerAnimated:NO completion:nil];
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+//}
|
|
|
|
|
+//
|
|
|
|
|
+//- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
|
|
|
|
+// [self rotateView];// 在此重新布局使视图在旋转过程中减少卡顿,更自然。
|
|
|
|
|
+//}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
|
|
|
|
|
+
|
|
|
if (self.presentedViewController) {
|
|
if (self.presentedViewController) {
|
|
|
[self.presentedViewController dismissViewControllerAnimated:NO completion:nil];
|
|
[self.presentedViewController dismissViewControllerAnimated:NO completion:nil];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context)
|
|
|
|
|
+ {
|
|
|
|
|
|
|
|
-- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
|
|
|
|
- [self rotateView];// 在此重新布局使视图在旋转过程中减少卡顿,更自然。
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ [self rotateView];// 在此重新布局使视图在旋转过程中减少卡顿,更自然。
|
|
|
|
|
+ } completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
|
|
|
|
|
+ {
|
|
|
|
|
|
|
|
--(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
|
|
|
|
-{
|
|
|
|
|
-
|
|
|
|
|
- // [self rotateView];
|
|
|
|
|
-
|
|
|
|
|
- // [self initControl];
|
|
|
|
|
- //// [self.pdfPageView setNeedsLayout];
|
|
|
|
|
- // [self.pdfPageView setNeedsDisplay];
|
|
|
|
|
- //// UIDeviceOrientation dev_ori = [[UIDevice currentDevice]orientation];
|
|
|
|
|
- //
|
|
|
|
|
- //// UIApplication * app = [UIApplication sharedApplication];
|
|
|
|
|
- //// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
- //// [appDelegate didRotated];
|
|
|
|
|
- //
|
|
|
|
|
- // // UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
|
|
|
|
|
- // // if (UIInterfaceOrientationIsLandscape(orientation)|| UIInterfaceOrientationIsPortrait(orientation))
|
|
|
|
|
- // // {
|
|
|
|
|
- // // self.orientation = orientation;
|
|
|
|
|
- // // [self.collectionview.collectionViewLayout invalidateLayout];
|
|
|
|
|
- // // DebugLog(@"routed");
|
|
|
|
|
- // // }
|
|
|
|
|
- //
|
|
|
|
|
-
|
|
|
|
|
|
|
+ }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
|
|
|
}
|
|
}
|
|
|
|
|
+//
|
|
|
|
|
+//-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
|
|
|
|
+//{
|
|
|
|
|
+//
|
|
|
|
|
+// // [self rotateView];
|
|
|
|
|
+//
|
|
|
|
|
+// // [self initControl];
|
|
|
|
|
+// //// [self.pdfPageView setNeedsLayout];
|
|
|
|
|
+// // [self.pdfPageView setNeedsDisplay];
|
|
|
|
|
+// //// UIDeviceOrientation dev_ori = [[UIDevice currentDevice]orientation];
|
|
|
|
|
+// //
|
|
|
|
|
+// //// UIApplication * app = [UIApplication sharedApplication];
|
|
|
|
|
+// //// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
+// //// [appDelegate didRotated];
|
|
|
|
|
+// //
|
|
|
|
|
+// // // UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
|
|
|
|
|
+// // // if (UIInterfaceOrientationIsLandscape(orientation)|| UIInterfaceOrientationIsPortrait(orientation))
|
|
|
|
|
+// // // {
|
|
|
|
|
+// // // self.orientation = orientation;
|
|
|
|
|
+// // // [self.collectionview.collectionViewLayout invalidateLayout];
|
|
|
|
|
+// // // DebugLog(@"routed");
|
|
|
|
|
+// // // }
|
|
|
|
|
+// //
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//}
|
|
|
|
|
|
|
|
#pragma mark add controls
|
|
#pragma mark add controls
|
|
|
-(bool) checkActionCondition:(NSString*) condition
|
|
-(bool) checkActionCondition:(NSString*) condition
|
|
@@ -584,7 +604,7 @@ if (!update) {
|
|
|
if(self.currentAppOrientation==ScreenOrientationLand)
|
|
if(self.currentAppOrientation==ScreenOrientationLand)
|
|
|
fontsize=fontsize*0.8; // 缩小字体否则textview显示不下。
|
|
fontsize=fontsize*0.8; // 缩小字体否则textview显示不下。
|
|
|
[tv setFont:[UIFont systemFontOfSize:fontsize]];
|
|
[tv setFont:[UIFont systemFontOfSize:fontsize]];
|
|
|
- bool isdisable = [template[@"disable"] boolValue];
|
|
|
|
|
|
|
+// bool isdisable = [template[@"disable"] boolValue];
|
|
|
|
|
|
|
|
// tv.editable = !isdisable;
|
|
// tv.editable = !isdisable;
|
|
|
tv.editable = true; // for update frame
|
|
tv.editable = true; // for update frame
|
|
@@ -953,7 +973,7 @@ if (!update) {
|
|
|
{
|
|
{
|
|
|
if([template[@"disable"] boolValue]&& [template[@"required"] boolValue])
|
|
if([template[@"disable"] boolValue]&& [template[@"required"] boolValue])
|
|
|
{
|
|
{
|
|
|
- AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
|
+// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
UIImage* img = [UIImage imageNamed:@"na"];
|
|
UIImage* img = [UIImage imageNamed:@"na"];
|
|
|
btn.image = img;
|
|
btn.image = img;
|
|
|
// template[@"value"]=appDelegate.na_path;
|
|
// template[@"value"]=appDelegate.na_path;
|
|
@@ -1035,7 +1055,7 @@ if (!update) {
|
|
|
CGPoint contentOffsetPoint = self.pdfScrollView.contentOffset;
|
|
CGPoint contentOffsetPoint = self.pdfScrollView.contentOffset;
|
|
|
CGSize contentSize =self.pdfScrollView.contentSize;//frame.size;
|
|
CGSize contentSize =self.pdfScrollView.contentSize;//frame.size;
|
|
|
// CGSize size1 = self.pdfScrollView.bounds.size;
|
|
// CGSize size1 = self.pdfScrollView.bounds.size;
|
|
|
- // NSLog(@"frame:%@ bound:%@", NSStringFromCGSize(contentSize),NSStringFromCGSize(size1) );
|
|
|
|
|
|
|
+ // DebugLog(@"frame:%@ bound:%@", NSStringFromCGSize(contentSize),NSStringFromCGSize(size1) );
|
|
|
contentSize.height+=self.keyboard_h;
|
|
contentSize.height+=self.keyboard_h;
|
|
|
contentOffsetPoint.y+=self.keyboard_h;
|
|
contentOffsetPoint.y+=self.keyboard_h;
|
|
|
|
|
|
|
@@ -1117,7 +1137,7 @@ if (!update) {
|
|
|
|
|
|
|
|
// DebugLog(@"cart sort button clicked");
|
|
// DebugLog(@"cart sort button clicked");
|
|
|
|
|
|
|
|
- NSLog(@"button clicked;");
|
|
|
|
|
|
|
+ DebugLog(@"button clicked;");
|
|
|
// [self.view addSubview:self.sortItemController.view];
|
|
// [self.view addSubview:self.sortItemController.view];
|
|
|
}
|
|
}
|
|
|
- (void)CheckButtonClicked:(UIButton *)sender {
|
|
- (void)CheckButtonClicked:(UIButton *)sender {
|
|
@@ -1128,7 +1148,7 @@ if (!update) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSLog(@"check clicked;");
|
|
|
|
|
|
|
+ DebugLog(@"check clicked;");
|
|
|
|
|
|
|
|
long index = sender.tag - CONTROL_BASE;
|
|
long index = sender.tag - CONTROL_BASE;
|
|
|
|
|
|
|
@@ -1230,7 +1250,7 @@ if (!update) {
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
- formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
+ formatter.numberStyle =NSNumberFormatterCurrencyStyle;
|
|
|
NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
|
if(prefix_str.length==0)
|
|
if(prefix_str.length==0)
|
|
|
prefix_str = @"";
|
|
prefix_str = @"";
|
|
@@ -1248,7 +1268,7 @@ if (!update) {
|
|
|
{
|
|
{
|
|
|
// float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
|
|
// float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
|
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
- formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
+ formatter.numberStyle =NSNumberFormatterCurrencyStyle;
|
|
|
NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
|
if(prefix_str.length==0)
|
|
if(prefix_str.length==0)
|
|
|
prefix_str = @"";
|
|
prefix_str = @"";
|
|
@@ -1526,7 +1546,7 @@ if (!update) {
|
|
|
|
|
|
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
|
|
|
|
|
- formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
+ formatter.numberStyle =NSNumberFormatterCurrencyStyle;
|
|
|
NSNumber* number= [formatter numberFromString:text];
|
|
NSNumber* number= [formatter numberFromString:text];
|
|
|
if(number!=nil)
|
|
if(number!=nil)
|
|
|
textView.text = [NSString stringWithFormat:@"%.2f",[number doubleValue]];
|
|
textView.text = [NSString stringWithFormat:@"%.2f",[number doubleValue]];
|
|
@@ -1551,7 +1571,7 @@ if (!update) {
|
|
|
[self.controlUpdateDelegate focusControlView:textView frame:[self getViewFrame:textView]];
|
|
[self.controlUpdateDelegate focusControlView:textView frame:[self getViewFrame:textView]];
|
|
|
return NO;
|
|
return NO;
|
|
|
}
|
|
}
|
|
|
- NSLog(@"textViewShouldBeginEditing");
|
|
|
|
|
|
|
+ DebugLog(@"textViewShouldBeginEditing");
|
|
|
|
|
|
|
|
|
|
|
|
|
// long index = textView.tag - CONTROL_BASE;
|
|
// long index = textView.tag - CONTROL_BASE;
|
|
@@ -1606,7 +1626,7 @@ if (!update) {
|
|
|
|
|
|
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
|
|
|
|
|
- formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
+ formatter.numberStyle =NSNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
|
|
|
|
|
|
NSNumber * nprice =[NSNumber numberWithDouble: [text doubleValue]];
|
|
NSNumber * nprice =[NSNumber numberWithDouble: [text doubleValue]];
|
|
@@ -1646,7 +1666,7 @@ if (!update) {
|
|
|
{
|
|
{
|
|
|
// double f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] doubleValue]*0.1;
|
|
// double f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] doubleValue]*0.1;
|
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
- formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
+ formatter.numberStyle =NSNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
|
NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
|
|
NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
|
|
|
if(prefix_str.length==0)
|
|
if(prefix_str.length==0)
|
|
@@ -1682,7 +1702,7 @@ if (!update) {
|
|
|
{
|
|
{
|
|
|
// double f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] doubleValue]*0.9;
|
|
// double f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] doubleValue]*0.9;
|
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
- formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
+ formatter.numberStyle =NSNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
|
NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
|
|
NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
|
|
|
if(prefix_str.length==0)
|
|
if(prefix_str.length==0)
|
|
@@ -1715,7 +1735,7 @@ if (!update) {
|
|
|
|
|
|
|
|
|
|
|
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
- formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
+ formatter.numberStyle =NSNumberFormatterCurrencyStyle;
|
|
|
|
|
|
|
|
NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
|
|
NSString* prefix_str= self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"];
|
|
|
if(prefix_str.length==0)
|
|
if(prefix_str.length==0)
|
|
@@ -1916,7 +1936,7 @@ if (!update) {
|
|
|
|
|
|
|
|
if(touchImageView.image!=nil)
|
|
if(touchImageView.image!=nil)
|
|
|
{
|
|
{
|
|
|
- NSLog(@"long press");
|
|
|
|
|
|
|
+ DebugLog(@"long press");
|
|
|
|
|
|
|
|
|
|
|
|
|
[self becomeFirstResponder];
|
|
[self becomeFirstResponder];
|
|
@@ -1970,7 +1990,7 @@ if (!update) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- NSLog(@"signature button clicked;");
|
|
|
|
|
|
|
+ DebugLog(@"signature button clicked;");
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// __weak __typeof(self)weakSelf = self;
|
|
// __weak __typeof(self)weakSelf = self;
|
|
@@ -2156,10 +2176,10 @@ if (!update) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)keyboardWillChangeFrame:(NSNotification *)notification {
|
|
- (void)keyboardWillChangeFrame:(NSNotification *)notification {
|
|
|
- NSLog(@"keyboardWillChangeFrame");
|
|
|
|
|
|
|
+ DebugLog(@"keyboardWillChangeFrame");
|
|
|
}
|
|
}
|
|
|
- (void)keyboardWillShow:(NSNotification *)notification {
|
|
- (void)keyboardWillShow:(NSNotification *)notification {
|
|
|
- NSLog(@"keyboardWillShow");
|
|
|
|
|
|
|
+ DebugLog(@"keyboardWillShow");
|
|
|
|
|
|
|
|
if(self.keyboard_show)
|
|
if(self.keyboard_show)
|
|
|
return;
|
|
return;
|
|
@@ -2174,7 +2194,7 @@ if (!update) {
|
|
|
|
|
|
|
|
NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
|
|
NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
|
|
|
CGSize keyboardSize = [aValue CGRectValue].size;
|
|
CGSize keyboardSize = [aValue CGRectValue].size;
|
|
|
- NSLog(@"keyboard height:%f",keyboardSize.height);
|
|
|
|
|
|
|
+ DebugLog(@"keyboard height:%f",keyboardSize.height);
|
|
|
|
|
|
|
|
|
|
|
|
|
CGRect cellrect_screen = [self relativeFrameForScreenWithView:self.hotTextView];
|
|
CGRect cellrect_screen = [self relativeFrameForScreenWithView:self.hotTextView];
|
|
@@ -2188,7 +2208,7 @@ if (!update) {
|
|
|
CGPoint contentOffsetPoint = self.pdfScrollView.contentOffset;
|
|
CGPoint contentOffsetPoint = self.pdfScrollView.contentOffset;
|
|
|
CGSize contentSize =self.pdfScrollView.contentSize;//frame.size;
|
|
CGSize contentSize =self.pdfScrollView.contentSize;//frame.size;
|
|
|
CGSize size1 = self.pdfScrollView.bounds.size;
|
|
CGSize size1 = self.pdfScrollView.bounds.size;
|
|
|
- NSLog(@"frame:%@ bound:%@", NSStringFromCGSize(contentSize),NSStringFromCGSize(size1) );
|
|
|
|
|
|
|
+ DebugLog(@"frame:%@ bound:%@", NSStringFromCGSize(contentSize),NSStringFromCGSize(size1) );
|
|
|
contentSize.height+=self.keyboard_h;
|
|
contentSize.height+=self.keyboard_h;
|
|
|
contentOffsetPoint.y+=self.keyboard_h;
|
|
contentOffsetPoint.y+=self.keyboard_h;
|
|
|
|
|
|
|
@@ -2210,7 +2230,7 @@ if (!update) {
|
|
|
// [self moveInputBarWithKeyboardHeight:keyboardRect.size.height withDuration:animationDuration];
|
|
// [self moveInputBarWithKeyboardHeight:keyboardRect.size.height withDuration:animationDuration];
|
|
|
}
|
|
}
|
|
|
- (void)keyboardWillHide:(NSNotification *)notification {
|
|
- (void)keyboardWillHide:(NSNotification *)notification {
|
|
|
- NSLog(@"keyboardWillHide");
|
|
|
|
|
|
|
+ DebugLog(@"keyboardWillHide");
|
|
|
|
|
|
|
|
self.keyboard_show=false;
|
|
self.keyboard_show=false;
|
|
|
// NSDictionary* userInfo = [notification userInfo];
|
|
// NSDictionary* userInfo = [notification userInfo];
|
|
@@ -2239,7 +2259,7 @@ if (!update) {
|
|
|
// self.pdfScrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
|
|
// self.pdfScrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
|
|
|
|
|
|
|
|
self.keyboard_h= 0;
|
|
self.keyboard_h= 0;
|
|
|
- // NSLog(@"before refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
|
|
|
|
|
|
|
+ // DebugLog(@"before refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
|
|
|
|
|
|
|
|
|
|
|
|
|
// if(self.resize)
|
|
// if(self.resize)
|