> Hey but your qooxdoo classes in Pascal will have behavior, method to  
> code the listeners, what to do on OK button, do things, isn't it ?

Sure.

> I would suggest a visitor pattern instead so the generator will be  
> kept independent of the Pascal instances graph that define the GUI.

There will be 2 generators:

1. qx2pascal program which will converts all qooxdoo packages (taken  
from apidata.json) into pascal units and all qooxdoo's js classes into  
pascal classes, including all class properties and the possible  
events. This program is executed before any pascal application that  
about to uses qooxdoo pascal clasess is written.

2. qxPascal class as the root of the qooxdoo pascal classes which will  
generates js code upon qooxdoo pascal classes during runtime,  
including class initialization, event handler, and class finalization.  
This is why I need qooxdoo framework supplied as a single js file  
because the runtime generated js code can't refer to any external js  
files.

> Would you resume the project goal as "no behavior qooxdoo classes  
> defined Pascal -> no behavior qooxdoo  classed in js ?????

No.

> I hope no, because otherwise, sorry to be direct, I don't see any  
> interest !

qxPascal could also provide and handle any qooxdoo widget events. So,  
yes there will behavior of qooxdoo classes in pascal as well.

> There would not be any added value (I'm doing it in Java instead of  
> Pascal to illustrate my question) to use :

Let me illustrate it in Pascal (taken from qooxdoo's Hello World  
example):

--- begin of pascal code ---

uses
   qxPascal, // use qxPascal runtime js code generator
   qxApplication, // use qx's Application package (qx.application)
   qxUIForm; // use qx's Form package (qx.ui.form)

var
   Button1: TqxFormButton; // taken from qxUIForm units

procedure Button1.OnClick;
begin
   BrowserAlert('Hello world');
end;

procedure Button1.OnCreate;
begin
   // setup button properties
   Button1.Label := 'First Button';
   Button1.Icon := 'icon/22/apps/internet-web-browser.png';

   // setup button onclick evert
   Button1.OnClick := @OnClick;

   // attach button to container
   Application.getRoot.add(button1, [100, 50]);
end;

--- end of pascal code ---

will generate this JS code (estimated):

--- begin of js code ---

// generated by BrowserAlert function
function browserAlert(strText) {
  alert(strText);
}

// create a button
var button1 = new qx.ui.form.Button();

// setup button properties
button1.setLabel("First Button");
button1.setIcon("icon/22/apps/internet-web-browser.png");

// setup button event handler
button1.addListener("click", browserAlert("Hello world!"));

// attach button to container at fixed coordinate
this.getRoot().add(button1,
{
   left : 100,
   top : 50
});

--- end of js code ---

I'm not sure whether that is the correct construct (I'm still  
learning), but you should get the idea.

-- 

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to