Skip to content

Commit

Permalink
refactored button name from stopButton to pauseButton
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhgupta committed Feb 7, 2014
1 parent a49ba34 commit 20d9014
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 84 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion StopWatch/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@property (strong, nonatomic) NSTimer *timer;
@property (weak) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSTextField *labelField;
@property (weak) IBOutlet NSButton *stopButton;
@property (weak) IBOutlet NSButton *pauseButton;
@property (weak) IBOutlet NSButton *startButton;

- (IBAction)start:(id)sender;
Expand Down
8 changes: 4 additions & 4 deletions StopWatch/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// on app start, we want to show the stop button as disabled.
[self.stopButton setEnabled:NO];
[self.pauseButton setEnabled:NO];
}

- (IBAction)start:(id)sender {
Expand All @@ -25,11 +25,11 @@ - (IBAction)start:(id)sender {
[self.startButton setTitle:@"Restart"];

// and, enable the pause/resume button.
[self.stopButton setEnabled:YES];
[self.pauseButton setEnabled:YES];

// and, make sure that that button says 'Pause'
[self.stopButton setNextState];
[self.stopButton setKeyEquivalent:@"\r"];
[self.pauseButton setNextState];
[self.pauseButton setKeyEquivalent:@"\r"];
// space bar should not fire any button
[self.window makeFirstResponder:nil];
}
Expand Down
95 changes: 16 additions & 79 deletions StopWatch/en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 49}, {246, 77}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="798352336"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
Expand Down Expand Up @@ -326,7 +325,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{106, 13}, {70, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="185602977"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
Expand Down Expand Up @@ -355,7 +353,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{176, 13}, {90, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1062390660">
Expand All @@ -378,7 +375,6 @@
</array>
<string key="NSFrameSize">{280, 146}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="4328423"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
Expand Down Expand Up @@ -514,6 +510,14 @@
</object>
<int key="connectionID">683</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">pauseButton</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="185602977"/>
</object>
<int key="connectionID">685</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
Expand Down Expand Up @@ -755,7 +759,7 @@
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="996147501">
<object class="IBNSLayoutConstraint" id="166409469">
<reference key="firstItem" ref="439893737"/>
<int key="firstAttribute">4</int>
<int key="relation">0</int>
Expand Down Expand Up @@ -803,7 +807,7 @@
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="961362344">
<object class="IBNSLayoutConstraint" id="491937852">
<reference key="firstItem" ref="439893737"/>
<int key="firstAttribute">6</int>
<int key="relation">0</int>
Expand Down Expand Up @@ -888,7 +892,7 @@
</object>
<object class="IBObjectRecord">
<int key="objectID">649</int>
<reference key="object" ref="961362344"/>
<reference key="object" ref="491937852"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
Expand All @@ -913,7 +917,7 @@
</object>
<object class="IBObjectRecord">
<int key="objectID">681</int>
<reference key="object" ref="996147501"/>
<reference key="object" ref="166409469"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
Expand Down Expand Up @@ -948,10 +952,10 @@
<string key="371.IBWindowTemplateEditedContentRect">{{380, 496}, {480, 360}}</string>
<integer value="1" key="371.NSWindowTemplate.visibleAtLaunch"/>
<array class="NSMutableArray" key="372.IBNSViewMetadataConstraints">
<reference ref="961362344"/>
<reference ref="491937852"/>
<reference ref="930020361"/>
<reference ref="440470530"/>
<reference ref="996147501"/>
<reference ref="166409469"/>
<reference ref="301461393"/>
<reference ref="153067597"/>
<reference ref="225315202"/>
Expand Down Expand Up @@ -988,76 +992,9 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">684</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">AppDelegate</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="pauseOrResume:">id</string>
<string key="performZoom:">id</string>
<string key="start:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="pauseOrResume:">
<string key="name">pauseOrResume:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="performZoom:">
<string key="name">performZoom:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="start:">
<string key="name">start:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="labelField">NSTextField</string>
<string key="mainView">NSView</string>
<string key="startButton">NSButton</string>
<string key="stopButton">NSButton</string>
<string key="window">NSWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="labelField">
<string key="name">labelField</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo" key="mainView">
<string key="name">mainView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="startButton">
<string key="name">startButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="stopButton">
<string key="name">stopButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="window">
<string key="name">window</string>
<string key="candidateClassName">NSWindow</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/AppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSLayoutConstraint</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSLayoutConstraint.h</string>
</object>
</object>
</array>
<int key="maxID">685</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
Expand Down

0 comments on commit 20d9014

Please sign in to comment.