diff --git a/Classes/ShowOffPadAppDelegate.m b/Classes/ShowOffPadAppDelegate.m index 209508a..9fd649f 100644 --- a/Classes/ShowOffPadAppDelegate.m +++ b/Classes/ShowOffPadAppDelegate.m @@ -23,15 +23,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( presentController = [[ShowOffPadPresentController alloc] initWithNibName:@"ShowOffPadPresentController" bundle:nil]; - viewController.extDisplay = presentController.mainView; + viewController.extDisplay = presentController; if([[UIScreen screens]count] > 1) //if there are more than 1 screens connected to the device { UIScreenMode *bestScreenMode; + BOOL screenChoosen = FALSE; for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++) { UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i]; - if((current.size.width == 1024) && (current.size.height == 768)) { + if (!screenChoosen) { + bestScreenMode = current; + } + if (current.size.width == 1024.0) { bestScreenMode = current; } } @@ -52,6 +56,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [window addSubview:viewController.view]; [window makeKeyAndVisible]; + return YES; } diff --git a/Classes/ShowOffPadPresentController.h b/Classes/ShowOffPadPresentController.h index 5012318..07561b9 100644 --- a/Classes/ShowOffPadPresentController.h +++ b/Classes/ShowOffPadPresentController.h @@ -13,6 +13,6 @@ IBOutlet UIWebView *mainView; } -@property(nonatomic,retain) UIWebView *mainView; +@property(assign, readwrite) UIWebView *mainView; @end diff --git a/Classes/ShowOffPadViewController.h b/Classes/ShowOffPadViewController.h index c5b845a..c11b5b5 100644 --- a/Classes/ShowOffPadViewController.h +++ b/Classes/ShowOffPadViewController.h @@ -8,9 +8,11 @@ #import +@class ShowOffPadPresentController; + @interface ShowOffPadViewController : UIViewController { IBOutlet UIWebView *webDisplayiPad; - IBOutlet UIWebView *extDisplay; + ShowOffPadPresentController *extDisplay; UIButton *nextButton; UIButton *prevButton; UIButton *footerButton; @@ -26,7 +28,7 @@ } @property(nonatomic,retain) UIWebView *webDisplayiPad; -@property(nonatomic,retain) UIWebView *extDisplay; +@property(nonatomic,retain) ShowOffPadPresentController *extDisplay; @property (nonatomic, retain) IBOutlet UIButton *nextButton; @property (nonatomic, retain) IBOutlet UIButton *prevButton; @@ -44,6 +46,9 @@ - (IBAction)doFooterButton; - (IBAction)doResetTimer; +- (void)setScreenStatus; +- (NSString *) sendJs:(NSString *)command; + - (void) updateProgress; - (void)updateCounter:(NSTimer *)theTimer; diff --git a/Classes/ShowOffPadViewController.m b/Classes/ShowOffPadViewController.m index ddd3b3a..7e8efe5 100644 --- a/Classes/ShowOffPadViewController.m +++ b/Classes/ShowOffPadViewController.m @@ -7,6 +7,7 @@ // #import "ShowOffPadViewController.h" +#import "ShowOffPadPresentController.h" @implementation ShowOffPadViewController @@ -25,7 +26,7 @@ - (void)viewDidLoad { //Load the request in the UIWebView. [webDisplayiPad loadRequest:requestObj]; - [extDisplay loadRequest:requestObj]; + [extDisplay.mainView loadRequest:requestObj]; counter = 0; basetime = 0; @@ -35,9 +36,29 @@ - (void)viewDidLoad { selector:@selector(updateCounter:) userInfo:nil repeats:YES]; + [self setScreenStatus]; + [super viewDidLoad]; } +- (void)setScreenStatus { + NSString *screenStatus = @""; + if([[UIScreen screens]count] > 1) //if there are more than 1 screens connected to the device + { + for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++) + { + UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i]; + if (current.size.width == 1024.0) { + screenStatus = [screenStatus stringByAppendingFormat:@"* %5.0f,%5.0f\n", current.size.width, current.size.height]; + } else { + screenStatus = [screenStatus stringByAppendingFormat:@" %5.0f,%5.0f\n", current.size.width, current.size.height]; + } + } + } + + padStatus.text = screenStatus; +} + - (void)updateCounter:(NSTimer *)theTimer { counter += 1; float elapsed = (float)(counter - basetime); @@ -50,15 +71,20 @@ - (void)updateCounter:(NSTimer *)theTimer { } - (IBAction) doNextButton { - NSString *output = [webDisplayiPad stringByEvaluatingJavaScriptFromString:@"nextStep()"]; + NSString *output = [self sendJs:@"nextStep()"]; if (output && ![output isEqualToString:@""]) { notesArea.text = output; } [self updateProgress]; } +- (NSString *) sendJs:(NSString *)command { + [extDisplay.mainView stringByEvaluatingJavaScriptFromString:command]; + return [webDisplayiPad stringByEvaluatingJavaScriptFromString:command]; +} + - (IBAction) doPrevButton { - NSString *output = [webDisplayiPad stringByEvaluatingJavaScriptFromString:@"prevStep()"]; + NSString *output = [self sendJs:@"prevStep()"]; if (![output isEqualToString:@""]) { notesArea.text = output; } diff --git a/ShowOffPad.xcodeproj/schacon.mode1v3 b/ShowOffPad.xcodeproj/schacon.mode1v3 index 4596c2e..d879945 100644 --- a/ShowOffPad.xcodeproj/schacon.mode1v3 +++ b/ShowOffPad.xcodeproj/schacon.mode1v3 @@ -278,6 +278,7 @@ PBXSmartGroupTreeModuleOutlineStateSelectionKey + 4 1 0 @@ -320,7 +321,7 @@ PBXProjectModuleGUID 1CE0B20306471E060097A5F4 PBXProjectModuleLabel - ShowOffPadViewController.m + ShowOffPadViewController.h PBXSplitModuleInNavigatorKey Split0 @@ -328,21 +329,21 @@ PBXProjectModuleGUID 1CE0B20406471E060097A5F4 PBXProjectModuleLabel - ShowOffPadViewController.m + ShowOffPadViewController.h _historyCapacity 0 bookmark - 31CE751111988BE7006C68D9 + 31CE75841198A1DF006C68D9 history 31CE72A811986D07006C68D9 31CE73BE11987F7F006C68D9 - 31CE74D6119884F4006C68D9 - 31CE750D11988BE7006C68D9 - 31CE750E11988BE7006C68D9 - 31CE750F11988BE7006C68D9 - 31CE751011988BE7006C68D9 - 31CE74D5119884F4006C68D9 + 31CE75761198A138006C68D9 + 31CE75771198A138006C68D9 + 31CE75781198A138006C68D9 + 31CE75791198A138006C68D9 + 31CE757F1198A1D4006C68D9 + 31CE75801198A1D4006C68D9 SplitCount @@ -544,8 +545,8 @@ 31CE721A1198648C006C68D9 1CD10A99069EF8BA00B06720 311D6F7211922E4400C21AED - 1C78EAAD065D492600B07095 1C530D57069F1CE1000CFCEE + 1C78EAAD065D492600B07095 /Users/schacon/Documents/ShowOffPad/ShowOffPad.xcodeproj WindowString @@ -572,7 +573,7 @@ PBXProjectModuleGUID 1CD0528F0623707200166675 PBXProjectModuleLabel - ShowOffPadAppDelegate.m + ShowOffPadViewController.h StatusBarVisibility diff --git a/ShowOffPadPresentController.xib b/ShowOffPadPresentController.xib index 9c66cf7..9af53af 100644 --- a/ShowOffPadPresentController.xib +++ b/ShowOffPadPresentController.xib @@ -42,9 +42,9 @@ 274 YES - + - 292 + 274 {{9, 0}, {1000, 740}} @@ -55,6 +55,187 @@ 1 YES + + + -2147483356 + {{20, 20}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + Helvetica-Bold + 15 + 16 + + 1 + topL + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + + + -2147483356 + {{932, 20}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + topR + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + -2147483356 + {{473, 20}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + topM + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + -2147483356 + {{20, 691}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + botL + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + -2147483356 + {{20, 351}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + midL + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + -2147483356 + {{932, 339}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + midR + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + -2147483356 + {{473, 351}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + mid + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + -2147483356 + {{932, 691}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + botR + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + -2147483356 + {{473, 691}, {72, 37}} + + NO + IBIPadFramework + 0 + 0 + + 1 + botM + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + {1024, 748} @@ -89,7 +270,7 @@ mainView - + 9 @@ -108,7 +289,16 @@ YES - + + + + + + + + + + @@ -125,7 +315,52 @@ 8 - + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 18 + + + + + 17 + + + + + 11 + + + + + 12 + + + + + 10 + @@ -138,6 +373,15 @@ -2.CustomClassName 1.IBEditorWindowLastContentRect 1.IBPluginDependency + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency 8.IBPluginDependency @@ -147,6 +391,15 @@ {{540, 223}, {1024, 768}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -165,7 +418,7 @@ - 9 + 18 @@ -299,15 +552,31 @@ NSObject - + IBFrameworkSource UIKit.framework/Headers/UIResponder.h + + UIButton + UIControl + + IBFrameworkSource + UIKit.framework/Headers/UIButton.h + + + + UIControl + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIControl.h + + UIResponder NSObject - + UISearchBar diff --git a/ShowOffPadViewController.xib b/ShowOffPadViewController.xib index 089ce36..92ca861 100644 --- a/ShowOffPadViewController.xib +++ b/ShowOffPadViewController.xib @@ -45,7 +45,7 @@ 274 - {{-1, 0}, {802, 600}} + {802, 600} 1 @@ -208,23 +208,6 @@ - - - -2147483383 - {{831, 123}, {160, 329}} - - - YES - 5 - IBIPadFramework - NO - 1 - 0 - YES - 44 - 22 - 22 - 292 @@ -309,25 +292,26 @@ IBCocoaTouchFramework - + 292 - {{835, 579}, {147, 28}} + {{814, 130}, {194, 315}} NO YES 7 NO IBIPadFramework - + Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status Status 1 MSAxIDEAA - 1 + 0 10 + 0 {1024, 748} @@ -473,9 +457,9 @@ padStatus - + - 58 + 60 @@ -506,7 +490,6 @@ - @@ -514,10 +497,10 @@ - - + + @@ -556,11 +539,6 @@ - - 35 - - - 36 @@ -592,8 +570,8 @@ - 57 - + 59 + @@ -613,14 +591,13 @@ 2.IBPluginDependency 20.IBPluginDependency 21.IBPluginDependency - 35.IBPluginDependency 36.IBPluginDependency 39.IBPluginDependency 40.IBPluginDependency 41.IBPluginDependency 47.IBPluginDependency 55.IBPluginDependency - 57.IBPluginDependency + 59.IBPluginDependency YES @@ -631,8 +608,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{473, 358}, {1024, 768}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{499, 262}, {1024, 768}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -661,7 +637,7 @@ - 58 + 60 @@ -883,14 +859,6 @@ NSObject - - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - UISearchBar UIView @@ -915,14 +883,6 @@ UIKit.framework/Headers/UISwitch.h - - UITableView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITableView.h - - UITextField UIControl