summaryrefslogtreecommitdiffstats
path: root/web-gui/calculator/source
diff options
context:
space:
mode:
Diffstat (limited to 'web-gui/calculator/source')
-rw-r--r--web-gui/calculator/source/class/calculator/Application.js75
-rw-r--r--web-gui/calculator/source/class/calculator/test/DemoTest.js55
-rw-r--r--web-gui/calculator/source/class/calculator/theme/Appearance.js18
-rw-r--r--web-gui/calculator/source/class/calculator/theme/Color.js18
-rw-r--r--web-gui/calculator/source/class/calculator/theme/Decoration.js18
-rw-r--r--web-gui/calculator/source/class/calculator/theme/Font.js18
-rw-r--r--web-gui/calculator/source/class/calculator/theme/Theme.js21
-rw-r--r--web-gui/calculator/source/index.html9
-rw-r--r--web-gui/calculator/source/resource/calculator/test.pngbin0 -> 2478 bytes
-rw-r--r--web-gui/calculator/source/script/calculator.js20
-rw-r--r--web-gui/calculator/source/translation/readme.txt3
11 files changed, 255 insertions, 0 deletions
diff --git a/web-gui/calculator/source/class/calculator/Application.js b/web-gui/calculator/source/class/calculator/Application.js
new file mode 100644
index 0000000..b0dfb02
--- /dev/null
+++ b/web-gui/calculator/source/class/calculator/Application.js
@@ -0,0 +1,75 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#asset(calculator/*)
+
+************************************************************************ */
+
+/**
+ * This is the main application class of your custom application "calculator"
+ */
+qx.Class.define("calculator.Application",
+{
+ extend : qx.application.Standalone,
+
+
+
+ /*
+ *****************************************************************************
+ MEMBERS
+ *****************************************************************************
+ */
+
+ members :
+ {
+ /**
+ * This method contains the initial application code and gets called
+ * during startup of the application
+ *
+ * @lint ignoreDeprecated(alert)
+ */
+ main : function()
+ {
+ // Call super class
+ this.base(arguments);
+
+ // Enable logging in debug variant
+ if (qx.core.Variant.isSet("qx.debug", "on"))
+ {
+ // support native logging capabilities, e.g. Firebug for Firefox
+ qx.log.appender.Native;
+ // support additional cross-browser console. Press F7 to toggle visibility
+ qx.log.appender.Console;
+ }
+
+ /*
+ -------------------------------------------------------------------------
+ Below is your actual application code...
+ -------------------------------------------------------------------------
+ */
+
+ // Create a button
+ var button1 = new qx.ui.form.Button("First Button", "calculator/test.png");
+
+ // Document is the application root
+ var doc = this.getRoot();
+
+ // Add button to document at fixed coordinates
+ doc.add(button1, {left: 100, top: 50});
+
+ // Add an event listener
+ button1.addListener("execute", function(e) {
+ alert("Hello World!");
+ });
+ }
+ }
+});
diff --git a/web-gui/calculator/source/class/calculator/test/DemoTest.js b/web-gui/calculator/source/class/calculator/test/DemoTest.js
new file mode 100644
index 0000000..ac0b7c4
--- /dev/null
+++ b/web-gui/calculator/source/class/calculator/test/DemoTest.js
@@ -0,0 +1,55 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/**
+ * This class demonstrates how to define unit tests for your application.
+ *
+ * Execute <code>generate.py test</code> to generate a testrunner application
+ * and open it from <tt>test/index.html</tt>
+ *
+ * The methods that contain the tests are instance methods with a
+ * <code>test</code> prefix. You can create an arbitrary number of test
+ * classes like this one. They can be organized in a regular class hierarchy,
+ * i.e. using deeper namespaces and a corresponding file structure within the
+ * <tt>test</tt> folder.
+ */
+qx.Class.define("calculator.test.DemoTest",
+{
+ extend : qx.dev.unit.TestCase,
+
+ members :
+ {
+ /*
+ ---------------------------------------------------------------------------
+ TESTS
+ ---------------------------------------------------------------------------
+ */
+
+ /**
+ * Here are some simple tests
+ */
+ testSimple : function()
+ {
+ this.assertEquals(4, 3+1, "This should never fail!");
+ this.assertFalse(false, "Can false be true?!");
+ },
+
+ /**
+ * Here are some more advanced tests
+ */
+ testAdvanced: function ()
+ {
+ var a = 3;
+ var b = a;
+ this.assertIdentical(a, b, "A rose by any other name is still a rose");
+ this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!");
+ }
+ }
+});
diff --git a/web-gui/calculator/source/class/calculator/theme/Appearance.js b/web-gui/calculator/source/class/calculator/theme/Appearance.js
new file mode 100644
index 0000000..5f56b24
--- /dev/null
+++ b/web-gui/calculator/source/class/calculator/theme/Appearance.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("calculator.theme.Appearance",
+{
+ extend : qx.theme.modern.Appearance,
+
+ appearances :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/calculator/source/class/calculator/theme/Color.js b/web-gui/calculator/source/class/calculator/theme/Color.js
new file mode 100644
index 0000000..8636762
--- /dev/null
+++ b/web-gui/calculator/source/class/calculator/theme/Color.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("calculator.theme.Color",
+{
+ extend : qx.theme.modern.Color,
+
+ colors :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/calculator/source/class/calculator/theme/Decoration.js b/web-gui/calculator/source/class/calculator/theme/Decoration.js
new file mode 100644
index 0000000..cfa2c0f
--- /dev/null
+++ b/web-gui/calculator/source/class/calculator/theme/Decoration.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("calculator.theme.Decoration",
+{
+ extend : qx.theme.modern.Decoration,
+
+ decorations :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/calculator/source/class/calculator/theme/Font.js b/web-gui/calculator/source/class/calculator/theme/Font.js
new file mode 100644
index 0000000..24356ca
--- /dev/null
+++ b/web-gui/calculator/source/class/calculator/theme/Font.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("calculator.theme.Font",
+{
+ extend : qx.theme.modern.Font,
+
+ fonts :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/calculator/source/class/calculator/theme/Theme.js b/web-gui/calculator/source/class/calculator/theme/Theme.js
new file mode 100644
index 0000000..aa59d7d
--- /dev/null
+++ b/web-gui/calculator/source/class/calculator/theme/Theme.js
@@ -0,0 +1,21 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("calculator.theme.Theme",
+{
+ meta :
+ {
+ color : calculator.theme.Color,
+ decoration : calculator.theme.Decoration,
+ font : calculator.theme.Font,
+ icon : qx.theme.icon.Tango,
+ appearance : calculator.theme.Appearance
+ }
+}); \ No newline at end of file
diff --git a/web-gui/calculator/source/index.html b/web-gui/calculator/source/index.html
new file mode 100644
index 0000000..71568a9
--- /dev/null
+++ b/web-gui/calculator/source/index.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>calculator</title>
+ <script type="text/javascript" src="script/calculator.js"></script>
+</head>
+<body></body>
+</html>
diff --git a/web-gui/calculator/source/resource/calculator/test.png b/web-gui/calculator/source/resource/calculator/test.png
new file mode 100644
index 0000000..ef360cd
--- /dev/null
+++ b/web-gui/calculator/source/resource/calculator/test.png
Binary files differ
diff --git a/web-gui/calculator/source/script/calculator.js b/web-gui/calculator/source/script/calculator.js
new file mode 100644
index 0000000..999122f
--- /dev/null
+++ b/web-gui/calculator/source/script/calculator.js
@@ -0,0 +1,20 @@
+/*
+ * This is mock content and will be overwritten with the first 'generate.py source'.
+ */
+function inform(){
+ var message =
+ "<div style='font-family: Verdana'>" +
+ "<h2>Application not yet ready!</h2>" +
+ "<div>Please use the generator to build this application, i.e. run <i>'generate.py source'</i> in an OS shell; then reload this page.</div>" +
+ "</div>";
+
+ window.setTimeout(function() {
+ document.body.innerHTML = message;
+ }, 0);
+}
+
+if (window.attachEvent) {
+ window.attachEvent("onload", inform);
+} else {
+ window.addEventListener("load", inform, false);
+}
diff --git a/web-gui/calculator/source/translation/readme.txt b/web-gui/calculator/source/translation/readme.txt
new file mode 100644
index 0000000..66975e6
--- /dev/null
+++ b/web-gui/calculator/source/translation/readme.txt
@@ -0,0 +1,3 @@
+This directory will contain translation (.po) files once you run the
+'translation' job in your project.
+