Skip to content

Commit

Permalink
Test app to verify CPProgressIndicator rendering, nib2cib and coding.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljungberg committed May 3, 2012
1 parent bdcc153 commit 6bc26eb
Show file tree
Hide file tree
Showing 9 changed files with 973 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Tests/Manual/CPProgressIndicator/AppController.j
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
10 changes: 10 additions & 0 deletions Tests/Manual/CPProgressIndicator/Info.plist
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>
94 changes: 94 additions & 0 deletions Tests/Manual/CPProgressIndicator/Jakefile
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("----------------------------");
}
1 change: 1 addition & 0 deletions Tests/Manual/CPProgressIndicator/Resources/MainMenu.cib

Large diffs are not rendered by default.

0 comments on commit 6bc26eb

Please sign in to comment.