Skip to content

Commit

Permalink
added a close button for getting back to the main screen
Browse files Browse the repository at this point in the history
  • Loading branch information
schlu committed Dec 31, 2010
1 parent 5cb2b04 commit 58857aa
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Classes/ShowOffPadAppDelegate.h
Expand Up @@ -24,7 +24,8 @@
-(void)setupExternalScreen; -(void)setupExternalScreen;
-(void)screenDidConnect:(NSNotification *)notification; -(void)screenDidConnect:(NSNotification *)notification;
-(void)screenDidDisconnect:(NSNotification *)notification; -(void)screenDidDisconnect:(NSNotification *)notification;
- (void) showPresentation; - (void)showPresentation;
- (void)dismisPresentation;


@property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UIWindow *extWindow; @property (nonatomic, retain) UIWindow *extWindow;
Expand Down
6 changes: 5 additions & 1 deletion Classes/ShowOffPadAppDelegate.m
Expand Up @@ -65,7 +65,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES; return YES;
} }


- (void) showPresentation { - (void)showPresentation {


CGRect contentRect = CGRectMake(0, 0, 1024, 748); CGRect contentRect = CGRectMake(0, 0, 1024, 748);
viewController.view.frame = contentRect; viewController.view.frame = contentRect;
Expand All @@ -74,6 +74,10 @@ - (void) showPresentation {
[self.splitViewController.view bringSubviewToFront:viewController.view]; [self.splitViewController.view bringSubviewToFront:viewController.view];
} }


- (void)dismisPresentation {
[self.viewController.view removeFromSuperview];
}

- (NSString *) ensurePresoPath { - (NSString *) ensurePresoPath {
NSArray *paths; NSArray *paths;
NSString *presoPath = @""; NSString *presoPath = @"";
Expand Down
1 change: 1 addition & 0 deletions Classes/ShowOffPadViewController.h
Expand Up @@ -69,6 +69,7 @@
- (IBAction)doNextButton; - (IBAction)doNextButton;
- (IBAction)doPrevButton; - (IBAction)doPrevButton;
- (IBAction)doFooterButton; - (IBAction)doFooterButton;
- (IBAction)closeAction;
- (IBAction)doResetTimer; - (IBAction)doResetTimer;
- (IBAction)doToggleMadden:(id) sender; - (IBAction)doToggleMadden:(id) sender;


Expand Down
6 changes: 6 additions & 0 deletions Classes/ShowOffPadViewController.m
Expand Up @@ -10,6 +10,7 @@
#import "ShowOffPadPresentController.h" #import "ShowOffPadPresentController.h"
#import "UITouchyView.h" #import "UITouchyView.h"
#import <QuartzCore/QuartzCore.h> #import <QuartzCore/QuartzCore.h>
#import "ShowOffPadAppDelegate.h"


@implementation ShowOffPadViewController @implementation ShowOffPadViewController


Expand Down Expand Up @@ -139,6 +140,11 @@ - (IBAction) doFooterButton {
[self sendJs:@"toggleFooter()"]; [self sendJs:@"toggleFooter()"];
} }


- (IBAction)closeAction {
ShowOffPadAppDelegate *delegate = (ShowOffPadAppDelegate*)[[UIApplication sharedApplication] delegate];
[delegate dismisPresentation];
}

- (IBAction) doResetTimer { - (IBAction) doResetTimer {
basetime = counter; basetime = counter;
timeElapsed.text = @"0"; timeElapsed.text = @"0";
Expand Down
84 changes: 72 additions & 12 deletions ShowOffPadViewController.xib
Expand Up @@ -12,7 +12,7 @@
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="67"/> <integer value="2"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -59,7 +59,7 @@
<object class="IBUISwitch" id="161113133"> <object class="IBUISwitch" id="161113133">
<reference key="NSNextResponder" ref="766721923"/> <reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{885, 74}, {94, 27}}</string> <string key="NSFrame">{{885, 45}, {94, 27}}</string>
<reference key="NSSuperview" ref="766721923"/> <reference key="NSSuperview" ref="766721923"/>
<bool key="IBUIOpaque">NO</bool> <bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string> <string key="targetRuntimeIdentifier">IBIPadFramework</string>
Expand All @@ -69,7 +69,7 @@
<object class="IBUILabel" id="398357682"> <object class="IBUILabel" id="398357682">
<reference key="NSNextResponder" ref="766721923"/> <reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{813, 77}, {77, 21}}</string> <string key="NSFrame">{{813, 48}, {77, 21}}</string>
<reference key="NSSuperview" ref="766721923"/> <reference key="NSSuperview" ref="766721923"/>
<bool key="IBUIOpaque">NO</bool> <bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool> <bool key="IBUIClipsSubviews">YES</bool>
Expand Down Expand Up @@ -158,15 +158,15 @@
<object class="IBUIButton" id="340155670"> <object class="IBUIButton" id="340155670">
<reference key="NSNextResponder" ref="766721923"/> <reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{829, 0}, {152, 37}}</string> <string key="NSFrame">{{909, 0}, {72, 37}}</string>
<reference key="NSSuperview" ref="766721923"/> <reference key="NSSuperview" ref="766721923"/>
<bool key="IBUIOpaque">NO</bool> <bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string> <string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int> <int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int> <int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="821524020"/> <reference key="IBUIFont" ref="821524020"/>
<int key="IBUIButtonType">1</int> <int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Footer</string> <string key="IBUINormalTitle">Close</string>
<reference key="IBUIHighlightedTitleColor" ref="328041047"/> <reference key="IBUIHighlightedTitleColor" ref="328041047"/>
<object class="NSColor" key="IBUINormalTitleColor"> <object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int> <int key="NSColorSpace">1</int>
Expand Down Expand Up @@ -261,7 +261,7 @@
<object class="IBUILabel" id="979254175"> <object class="IBUILabel" id="979254175">
<reference key="NSNextResponder" ref="766721923"/> <reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{822, 258}, {194, 187}}</string> <string key="NSFrame">{{822, 219}, {194, 226}}</string>
<reference key="NSSuperview" ref="766721923"/> <reference key="NSSuperview" ref="766721923"/>
<bool key="IBUIOpaque">NO</bool> <bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool> <bool key="IBUIClipsSubviews">YES</bool>
Expand Down Expand Up @@ -347,7 +347,7 @@
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews"> <object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIView" id="858844455"> <object class="IBUIView" id="279974065">
<reference key="NSNextResponder" ref="905393972"/> <reference key="NSNextResponder" ref="905393972"/>
<int key="NSvFlags">292</int> <int key="NSvFlags">292</int>
<string key="NSFrame">{{4, 4}, {44, 44}}</string> <string key="NSFrame">{{4, 4}, {44, 44}}</string>
Expand Down Expand Up @@ -431,7 +431,7 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string> <string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object> </object>
</object> </object>
<string key="NSFrame">{{816, 115}, {179, 125}}</string> <string key="NSFrame">{{816, 86}, {179, 125}}</string>
<reference key="NSSuperview" ref="766721923"/> <reference key="NSSuperview" ref="766721923"/>
<object class="NSColor" key="IBUIBackgroundColor"> <object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int> <int key="NSColorSpace">3</int>
Expand All @@ -440,6 +440,25 @@
</object> </object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string> <string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object> </object>
<object class="IBUIButton" id="1032857001">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{829, 0}, {72, 37}}</string>
<reference key="NSSuperview" ref="766721923"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<reference key="IBUIFont" ref="821524020"/>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Footer</string>
<reference key="IBUIHighlightedTitleColor" ref="328041047"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="459034855"/>
</object>
</object> </object>
<string key="NSFrameSize">{1024, 748}</string> <string key="NSFrameSize">{1024, 748}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
Expand Down Expand Up @@ -694,10 +713,28 @@
<object class="IBCocoaTouchOutletConnection" key="connection"> <object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">swatchSelectorInside</string> <string key="label">swatchSelectorInside</string>
<reference key="source" ref="841351856"/> <reference key="source" ref="841351856"/>
<reference key="destination" ref="858844455"/> <reference key="destination" ref="279974065"/>
</object> </object>
<int key="connectionID">88</int> <int key="connectionID">88</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">doFooterButton</string>
<reference key="source" ref="1032857001"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">90</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">closeAction</string>
<reference key="source" ref="340155670"/>
<reference key="destination" ref="841351856"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">91</int>
</object>
</object> </object>
<object class="IBMutableOrderedSet" key="objectRecords"> <object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects"> <object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -740,6 +777,7 @@
<reference ref="398357682"/> <reference ref="398357682"/>
<reference ref="893074654"/> <reference ref="893074654"/>
<reference ref="717564609"/> <reference ref="717564609"/>
<reference ref="1032857001"/>
</object> </object>
<reference key="parent" ref="0"/> <reference key="parent" ref="0"/>
</object> </object>
Expand Down Expand Up @@ -852,7 +890,7 @@
<reference key="object" ref="905393972"/> <reference key="object" ref="905393972"/>
<object class="NSMutableArray" key="children"> <object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="858844455"/> <reference ref="279974065"/>
</object> </object>
<reference key="parent" ref="717564609"/> <reference key="parent" ref="717564609"/>
</object> </object>
Expand Down Expand Up @@ -883,9 +921,14 @@
</object> </object>
<object class="IBObjectRecord"> <object class="IBObjectRecord">
<int key="objectID">87</int> <int key="objectID">87</int>
<reference key="object" ref="858844455"/> <reference key="object" ref="279974065"/>
<reference key="parent" ref="905393972"/> <reference key="parent" ref="905393972"/>
</object> </object>
<object class="IBObjectRecord">
<int key="objectID">89</int>
<reference key="object" ref="1032857001"/>
<reference key="parent" ref="766721923"/>
</object>
</object> </object>
</object> </object>
<object class="NSMutableDictionary" key="flattenedProperties"> <object class="NSMutableDictionary" key="flattenedProperties">
Expand All @@ -905,6 +948,7 @@
<string>20.IBPluginDependency</string> <string>20.IBPluginDependency</string>
<string>21.IBPluginDependency</string> <string>21.IBPluginDependency</string>
<string>36.IBPluginDependency</string> <string>36.IBPluginDependency</string>
<string>36.IBViewBoundsToFrameTransform</string>
<string>39.IBPluginDependency</string> <string>39.IBPluginDependency</string>
<string>40.IBPluginDependency</string> <string>40.IBPluginDependency</string>
<string>41.IBPluginDependency</string> <string>41.IBPluginDependency</string>
Expand All @@ -931,6 +975,8 @@
<string>77.IBPluginDependency</string> <string>77.IBPluginDependency</string>
<string>77.IBViewBoundsToFrameTransform</string> <string>77.IBViewBoundsToFrameTransform</string>
<string>87.IBPluginDependency</string> <string>87.IBPluginDependency</string>
<string>89.IBPluginDependency</string>
<string>89.IBViewBoundsToFrameTransform</string>
</object> </object>
<object class="NSMutableArray" key="dict.values"> <object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -949,6 +995,9 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AURPQAAAAAAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
Expand Down Expand Up @@ -991,6 +1040,10 @@
<bytes key="NSTransformStruct">AUMBAABBcAAAA</bytes> <bytes key="NSTransformStruct">AUMBAABBcAAAA</bytes>
</object> </object>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AURPQAAAAAAAA</bytes>
</object>
</object> </object>
</object> </object>
<object class="NSMutableDictionary" key="unlocalizedProperties"> <object class="NSMutableDictionary" key="unlocalizedProperties">
Expand All @@ -1009,7 +1062,7 @@
</object> </object>
</object> </object>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">88</int> <int key="maxID">91</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"> <object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions"> <object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand All @@ -1021,6 +1074,7 @@
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys"> <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>closeAction</string>
<string>doFooterButton</string> <string>doFooterButton</string>
<string>doNextButton</string> <string>doNextButton</string>
<string>doPrevButton</string> <string>doPrevButton</string>
Expand All @@ -1034,12 +1088,14 @@
<string>id</string> <string>id</string>
<string>id</string> <string>id</string>
<string>id</string> <string>id</string>
<string>id</string>
</object> </object>
</object> </object>
<object class="NSMutableDictionary" key="actionInfosByName"> <object class="NSMutableDictionary" key="actionInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys"> <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>closeAction</string>
<string>doFooterButton</string> <string>doFooterButton</string>
<string>doNextButton</string> <string>doNextButton</string>
<string>doPrevButton</string> <string>doPrevButton</string>
Expand All @@ -1048,6 +1104,10 @@
</object> </object>
<object class="NSMutableArray" key="dict.values"> <object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">closeAction</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo"> <object class="IBActionInfo">
<string key="name">doFooterButton</string> <string key="name">doFooterButton</string>
<string key="candidateClassName">id</string> <string key="candidateClassName">id</string>
Expand Down

0 comments on commit 58857aa

Please sign in to comment.