|
|
@@ -493,13 +493,10 @@
|
|
|
|
|
|
// save contro json
|
|
|
|
|
|
- if (self.currentPageViewController) {
|
|
|
-
|
|
|
- TemplateViewController *vc = self.currentPageViewController;
|
|
|
- NSDictionary *page = [vc updatePageControl];
|
|
|
- self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)vc.pageIndex]] = page;
|
|
|
- }
|
|
|
-
|
|
|
+ NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
|
|
|
+ path = [path stringByAppendingPathComponent:@"template"];
|
|
|
+
|
|
|
+ [self.controlTemplate writeToFile:path atomically:NO];
|
|
|
|
|
|
return;
|
|
|
|
|
|
@@ -1275,7 +1272,6 @@
|
|
|
self.positionControlBackground.frame = frame;
|
|
|
self.positionControlBackground.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth;
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- (IBAction)bottomBtnClick:(UIButton *)sender {
|
|
|
@@ -1288,27 +1284,47 @@
|
|
|
}
|
|
|
|
|
|
- (IBAction)xStepperClick:(UIStepper *)sender {
|
|
|
+ if (!self.focusView) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
CGRect frame = self.focusView.frame;
|
|
|
frame.origin.x = sender.value;
|
|
|
self.focusView.frame = frame;
|
|
|
+
|
|
|
+ [self savePageControl];
|
|
|
}
|
|
|
|
|
|
- (IBAction)yStepperClick:(UIStepper *)sender {
|
|
|
+ if (!self.focusView) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
CGRect frame = self.focusView.frame;
|
|
|
frame.origin.y = sender.value;
|
|
|
self.focusView.frame = frame;
|
|
|
+
|
|
|
+ [self savePageControl];
|
|
|
}
|
|
|
|
|
|
- (IBAction)wStepperClick:(UIStepper *)sender {
|
|
|
+ if (!self.focusView) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
CGRect frame = self.focusView.frame;
|
|
|
frame.size.width = sender.value;
|
|
|
self.focusView.frame = frame;
|
|
|
+
|
|
|
+ [self savePageControl];
|
|
|
}
|
|
|
|
|
|
- (IBAction)hStepperClick:(UIStepper *)sender {
|
|
|
+ if (!self.focusView) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
CGRect frame = self.focusView.frame;
|
|
|
frame.size.height = sender.value;
|
|
|
self.focusView.frame = frame;
|
|
|
+
|
|
|
+ [self savePageControl];
|
|
|
}
|
|
|
|
|
|
- (IBAction)okBtnClick:(UIButton *)sender {
|
|
|
@@ -1323,6 +1339,18 @@
|
|
|
CGRect frame = CGRectMake(x, y, w, h);
|
|
|
if (self.focusView) {
|
|
|
self.focusView.frame = frame;
|
|
|
+
|
|
|
+ [self savePageControl];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+- (void)savePageControl {
|
|
|
+ if (self.currentPageViewController) {
|
|
|
+
|
|
|
+ TemplateViewController *vc = self.currentPageViewController;
|
|
|
+ NSDictionary *page = [vc updatePageControl];
|
|
|
+ self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)vc.pageIndex]] = page;
|
|
|
}
|
|
|
}
|
|
|
|