Skip to content

Commit

Permalink
changed bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
JBaron committed Jul 5, 2014
1 parent 3fabe26 commit f5c9838
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 16 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ How to get started

All you really need to do is implement a function with the following signature:

qooxdooMain(app: qx.application.Standolone): void
someFunctionName(app: qx.application.Standolone): void

and then register it:

qx.registry.registerMainMethod(someFunctionName);

Within this function you can use all the Qooxdoo widgets you like and it is behaves
just like a normal Qooxdoo application. The benefit is that because of TypeScript and
CATS you get all kind of benefits like codecompletion, type checking and easy navigation.

Use the provided test application as an example to see how to create some simple widgets.
You can use the provided test application (application.ts) as an example to see how to
create some simple widgets.


Background
Expand Down
27 changes: 23 additions & 4 deletions application.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
/**
* Create a button
*/
Expand Down Expand Up @@ -142,6 +148,19 @@ function createTree() {
return tree;
}

/**
* Simple class extension example
*/
var MyPage = (function (_super) {
__extends(MyPage, _super);
function MyPage(name) {
_super.call(this, name);
this.setLayout(new qx.ui.layout.Flow());
this.setShowCloseButton(true);
}
return MyPage;
})(qx.ui.tabview.Page);

/**
* This is the main function that will be called from the Qooxdoo application
* to start everything.
Expand All @@ -156,12 +175,12 @@ function qooxdooMain(app) {
var t = new qx.ui.tabview.TabView();

for (var x = 0; x < demo.length; x++) {
var p = new qx.ui.tabview.Page(demo[x].name);
p.setLayout(new qx.ui.layout.Flow());
p.setShowCloseButton(true);
var p = new MyPage(demo[x].name);
p.add(demo[x]());
t.add(p);
}

doc.add(t);
doc.add(t, { edge: 0 });
}

qx.registry.registerMainMethod(qooxdooMain);
20 changes: 15 additions & 5 deletions application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ function createTree(): qx.ui.core.Widget {
}


/**
* Simple class extension example
*/
class MyPage extends qx.ui.tabview.Page {
constructor(name) {
super(name);
this.setLayout(new qx.ui.layout.Flow());
this.setShowCloseButton(true);
}

}

/**
* This is the main function that will be called from the Qooxdoo application
* to start everything.
Expand All @@ -157,15 +169,13 @@ function qooxdooMain(app: qx.application.Standalone) {

//And now lets add some tabs
for (var x = 0; x < demo.length; x++) {
var p = new qx.ui.tabview.Page((<any>demo[x]).name);
p.setLayout(new qx.ui.layout.Flow());
p.setShowCloseButton(true);
var p = new MyPage((<any>demo[x]).name);
p.add(demo[x]());
t.add(p);
}

doc.add(t);
doc.add(t,{ edge: 0});

}


qx.registry.registerMainMethod(qooxdooMain);
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title></title>
<script type="text/javascript" src="./application.js"></script>

<!-- Make sure the base script is included before your own application files -->
<script type="text/javascript" src="script/base.js"></script>

<!-- Now include your own application code -->
<script type="text/javascript" src="./application.js"></script>

</head>
<body></body>
</html>
8 changes: 6 additions & 2 deletions qooxdoo.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
interface IMap { [key: string]: any; }
declare class ErrorImpl implements Error { name: string; message: string }
declare module qx {
var registry: any;
}

declare module qx.ui.basic {
class Atom extends qx.ui.core.Widget {
constructor(label: string, icon?: string);
Expand Down Expand Up @@ -6489,7 +6493,7 @@ declare module qx.ui.tabview {
}
declare module qx.ui.toolbar {
class Button extends qx.ui.form.Button {
constructor(label: any, icon: any, command: any);
constructor(label: any, icon?: any, command?: any);
}
}
declare module qx.ui.toolbar {
Expand Down Expand Up @@ -8361,7 +8365,7 @@ declare module qx.core {
_disposeMap(field: string): void;
_disposeObjects(varargs: any): void;
_disposeSingletonObjects(varargs: any): void;
base(args: any, varargs: any): any;
base(args: any, varargs?: any): any;
clone(): qx.core.Object;
dispose(): void;
getUserData(key: string): any;
Expand Down
Loading

0 comments on commit f5c9838

Please sign in to comment.