-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'CPStepper-nib2cib' of https://github.com/cacaodev/cappu…
…ccino into stepper-nib2cib
- Loading branch information
Showing
12 changed files
with
1,304 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* AppController.j | ||
* CPStepperNibTest | ||
* | ||
* Created by cacaodev on February 7, 2012. | ||
* Copyright 2012, Your Company All rights reserved. | ||
*/ | ||
|
||
@import <Foundation/CPObject.j> | ||
|
||
|
||
@implementation AppController : CPObject | ||
{ | ||
CPWindow theWindow; //this "outlet" is connected automatically by the Cib | ||
@outlet CPStepper stepper; | ||
} | ||
|
||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | ||
{ | ||
// This is called when the application is done loading. | ||
} | ||
|
||
- (void)awakeFromCib | ||
{ | ||
// This is called when the cib is done loading. | ||
// You can implement this method on any object instantiated from a Cib. | ||
// It's a useful hook for setting up current UI values, and other things. | ||
|
||
// In this case, we want the window from Cib to become our full browser window | ||
var contentView = [theWindow contentView]; | ||
|
||
[[contentView viewWithTag:1000] setIntValue:[stepper increment]]; | ||
[[contentView viewWithTag:1001] setIntValue:[stepper minValue]]; | ||
[[contentView viewWithTag:1002] setIntValue:[stepper maxValue]]; | ||
[[contentView viewWithTag:1003] setState:[stepper valueWraps] ? CPOnState : CPOffState]; | ||
[[contentView viewWithTag:1005] setState:[stepper autorepeat] ? CPOnState : CPOffState]; | ||
[[contentView viewWithTag:1004] setIntValue:[stepper objectValue]]; | ||
|
||
[theWindow setFullPlatformWindow:YES]; | ||
} | ||
|
||
- (IBAction)setWraps:(id)sender | ||
{ | ||
[stepper setValueWraps:[sender state]]; | ||
} | ||
|
||
- (IBAction)setMin:(id)sender | ||
{ | ||
[stepper setMinValue:[sender intValue]]; | ||
} | ||
|
||
- (IBAction)setMax:(id)sender | ||
{ | ||
[stepper setMaxValue:[sender intValue]]; | ||
} | ||
|
||
- (IBAction)setIncrement:(id)sender | ||
{ | ||
[stepper setIncrement:[sender intValue]]; | ||
} | ||
|
||
- (IBAction)setAutorepeat:(id)sender | ||
{ | ||
[stepper setAutorepeat:[sender state]]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Main cib file base name</key> | ||
<string>MainMenu.cib</string> | ||
<key>CPBundleName</key> | ||
<string>CPStepperNibTest</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* Jakefile | ||
* CPStepperNibTest | ||
* | ||
* Created by You on February 7, 2012. | ||
* Copyright 2012, Your Company All rights reserved. | ||
*/ | ||
|
||
var ENV = require("system").env, | ||
FILE = require("file"), | ||
JAKE = require("jake"), | ||
task = JAKE.task, | ||
FileList = JAKE.FileList, | ||
app = require("cappuccino/jake").app, | ||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug", | ||
OS = require("os"); | ||
|
||
app ("CPStepperNibTest", function(task) | ||
{ | ||
task.setBuildIntermediatesPath(FILE.join("Build", "CPStepperNibTest.build", configuration)); | ||
task.setBuildPath(FILE.join("Build", configuration)); | ||
|
||
task.setProductName("CPStepperNibTest"); | ||
task.setIdentifier("com.yourcompany.CPStepperNibTest"); | ||
task.setVersion("1.0"); | ||
task.setAuthor("Your Company"); | ||
task.setEmail("feedback @nospam@ yourcompany.com"); | ||
task.setSummary("CPStepperNibTest"); | ||
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**"))); | ||
task.setResources(new FileList("Resources/**")); | ||
task.setIndexFilePath("index.html"); | ||
task.setInfoPlistPath("Info.plist"); | ||
task.setNib2CibFlags("-R Resources/"); | ||
|
||
if (configuration === "Debug") | ||
task.setCompilerFlags("-DDEBUG -g"); | ||
else | ||
task.setCompilerFlags("-O"); | ||
}); | ||
|
||
task ("default", ["CPStepperNibTest"], function() | ||
{ | ||
printResults(configuration); | ||
}); | ||
|
||
task ("build", ["default"]); | ||
|
||
task ("debug", function() | ||
{ | ||
ENV["CONFIGURATION"] = "Debug"; | ||
JAKE.subjake(["."], "build", ENV); | ||
}); | ||
|
||
task ("release", function() | ||
{ | ||
ENV["CONFIGURATION"] = "Release"; | ||
JAKE.subjake(["."], "build", ENV); | ||
}); | ||
|
||
task ("run", ["debug"], function() | ||
{ | ||
OS.system(["open", FILE.join("Build", "Debug", "CPStepperNibTest", "index.html")]); | ||
}); | ||
|
||
task ("run-release", ["release"], function() | ||
{ | ||
OS.system(["open", FILE.join("Build", "Release", "CPStepperNibTest", "index.html")]); | ||
}); | ||
|
||
task ("deploy", ["release"], function() | ||
{ | ||
FILE.mkdirs(FILE.join("Build", "Deployment", "CPStepperNibTest")); | ||
OS.system(["press", "-f", FILE.join("Build", "Release", "CPStepperNibTest"), FILE.join("Build", "Deployment", "CPStepperNibTest")]); | ||
printResults("Deployment") | ||
}); | ||
|
||
task ("desktop", ["release"], function() | ||
{ | ||
FILE.mkdirs(FILE.join("Build", "Desktop", "CPStepperNibTest")); | ||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPStepperNibTest"), FILE.join("Build", "Desktop", "CPStepperNibTest", "CPStepperNibTest.app")); | ||
printResults("Desktop") | ||
}); | ||
|
||
task ("run-desktop", ["desktop"], function() | ||
{ | ||
OS.system([FILE.join("Build", "Desktop", "CPStepperNibTest", "CPStepperNibTest.app", "Contents", "MacOS", "NativeHost"), "-i"]); | ||
}); | ||
|
||
function printResults(configuration) | ||
{ | ||
print("----------------------------"); | ||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPStepperNibTest")); | ||
print("----------------------------"); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.