-
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.
Test app to verify CPProgressIndicator rendering, nib2cib and coding.
- Loading branch information
1 parent
bdcc153
commit 6bc26eb
Showing
9 changed files
with
973 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* AppController.j | ||
* CPProgressIndicator | ||
* | ||
* Created by Alexander Ljungberg on May 3, 2012. | ||
* Copyright 2012, SlevenBits Ltd. All rights reserved. | ||
*/ | ||
|
||
@import <Foundation/CPObject.j> | ||
|
||
|
||
@implementation AppController : CPObject | ||
{ | ||
CPWindow theWindow; //this "outlet" is connected automatically by the Cib | ||
@outlet CPProgressIndicator fiftyPercentBar @accessors; | ||
@outlet CPProgressIndicator hundredPercentBar @accessors; | ||
} | ||
|
||
- (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. | ||
|
||
// Interface Builder does not encode the current progress. | ||
[fiftyPercentBar setDoubleValue:50]; | ||
[hundredPercentBar setDoubleValue:100]; | ||
|
||
[theWindow center]; | ||
} | ||
|
||
@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>CPProgressIndicator</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 | ||
* CPProgressIndicator | ||
* | ||
* Created by Alexander Ljungberg on May 3, 2012. | ||
* Copyright 2012, SlevenBits Ltd. 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 ("CPProgressIndicator", function(task) | ||
{ | ||
task.setBuildIntermediatesPath(FILE.join("Build", "CPProgressIndicator.build", configuration)); | ||
task.setBuildPath(FILE.join("Build", configuration)); | ||
|
||
task.setProductName("CPProgressIndicator"); | ||
task.setIdentifier("com.yourcompany.CPProgressIndicator"); | ||
task.setVersion("1.0"); | ||
task.setAuthor("SlevenBits Ltd"); | ||
task.setEmail("feedback @nospam@ yourcompany.com"); | ||
task.setSummary("CPProgressIndicator"); | ||
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", ["CPProgressIndicator"], 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", "CPProgressIndicator", "index.html")]); | ||
}); | ||
|
||
task ("run-release", ["release"], function() | ||
{ | ||
OS.system(["open", FILE.join("Build", "Release", "CPProgressIndicator", "index.html")]); | ||
}); | ||
|
||
task ("deploy", ["release"], function() | ||
{ | ||
FILE.mkdirs(FILE.join("Build", "Deployment", "CPProgressIndicator")); | ||
OS.system(["press", "-f", FILE.join("Build", "Release", "CPProgressIndicator"), FILE.join("Build", "Deployment", "CPProgressIndicator")]); | ||
printResults("Deployment") | ||
}); | ||
|
||
task ("desktop", ["release"], function() | ||
{ | ||
FILE.mkdirs(FILE.join("Build", "Desktop", "CPProgressIndicator")); | ||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPProgressIndicator"), FILE.join("Build", "Desktop", "CPProgressIndicator", "CPProgressIndicator.app")); | ||
printResults("Desktop") | ||
}); | ||
|
||
task ("run-desktop", ["desktop"], function() | ||
{ | ||
OS.system([FILE.join("Build", "Desktop", "CPProgressIndicator", "CPProgressIndicator.app", "Contents", "MacOS", "NativeHost"), "-i"]); | ||
}); | ||
|
||
function printResults(configuration) | ||
{ | ||
print("----------------------------"); | ||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPProgressIndicator")); | ||
print("----------------------------"); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.