Lazarus

Announcements => Third party => Topic started by: Phil on December 07, 2009, 01:49:26 am

Title: Status of toolkit for ExtPascal
Post by: Phil on December 07, 2009, 01:49:26 am
I've added grid design controls for the ExtP Toolkit add-on for ExtPascal, which is a complete Ajax framework for developing GUI Web apps. Here are some screenshots:

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPascal_Grid_in_IDE.jpg

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPascal_Grid_at_Runtime.jpg


A couple of other screenshots show the MultiSelect (list box) control in action both in the Lazarus IDE and in the browser at runtime:

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPascal_MultiSelect_in_IDE.jpg

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPascal_MultiSelect_at_Runtime.jpg


Complete documentation for the toolkit is here:

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPToolkitStatus.html


Source code is available in a .zip file from here:

http://web.fastermac.net/~MacPgmr/ExtPascal/

Or you can checkout the source along with the complete ExtPascal source from Wanderlan's SVN repository:

http://code.google.com/p/extpascal/

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: LazaruX on December 10, 2009, 10:31:15 am
Well, now you can really do anything using Lazarus.
Visual Studio has short life now ;-)
Title: Re: Status of toolkit for ExtPascal
Post by: ik on December 13, 2009, 12:57:04 pm
Only if it will be marketed properly imho.
Most places and people does not care if they work really hard to do things, if they think it's the best way.
Many people ignore FPC/Delphi just because it is "Pascal" not because any real reason. But these people think that unicorn and mermaids also exits :)
Title: Re: Status of toolkit for ExtPascal // One error
Post by: osvaldo-tcf on December 14, 2009, 04:58:01 pm
- Erro ExtPascal
========
    function Un(EventName : string; Fn : TExtFunction; Scope : TExtObject) : TExtFunction;
========
    Un('DOMActivate', Ajax('DOMActivate', ['E', '%0.nm','T', '%1.nm','O', '%2.nm'], true));
========

"Compiling package Orpheus 0.2.2" completed
"Compiling package ExtP_Grid 0.1.2" completed
"Compiling package ExtP_Ctrls 0.1.2" completed
Converted by FmToExtP: C:\d_e\componentes\ExtP Toolkit\grid_example\mygrid1.lpr
"Executing command before" completed
C:\d_e\extpascal\Ext.pas(43,27) Hint: Type "TExtDirectTransaction" redefinition
C:\d_e\extpascal\Ext.pas(4013,91) Error: Wrong number of parameters specified for call to "Un"
C:\d_e\extpascal\Ext.pas(452,14) Hint: Found declaration: TExtElement.Un(AnsiString,TExtFunction,TExtObject):TExtFunction;
C:\d_e\extpascal\Ext.pas(4021,99) Error: Wrong number of parameters specified for call to "Un"
C:\d_e\extpascal\Ext.pas(452,14) Hint: Found declaration: TExtElement.Un(AnsiString,TExtFunction,TExtObject):TExtFunction;
C:\d_e\extpascal\Ext.pas(4029,117) Error: Wrong number of parameters specified for call to "Un"
...
Title: Re: Status of toolkit for ExtPascal // One error
Post by: Phil on December 14, 2009, 05:09:32 pm
- Erro ExtPascal
========
    function Un(EventName : string; Fn : TExtFunction; Scope : TExtObject) : TExtFunction;
========
    Un('DOMActivate', Ajax('DOMActivate', ['E', '%0.nm','T', '%1.nm','O', '%2.nm'], true));
========

The declaration of Un in my Ext.pas looks like this:

    function Un(EventName : string; Fn : TExtFunction; Scope : TExtObject = nil) : TExtFunction;

What version of ExtPascal are you using?

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: theo on December 14, 2009, 05:15:34 pm
@Phil: What is you opinion on Ext licensing?
I've stopped using it for web apps because I don't understand the licensing.
See also:
http://pablotron.org/?cid=1556
http://fabrizioballiano.net/2008/03/18/confirmation-of-my-doubts-about-extjs-licensing/
etc..
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on December 14, 2009, 06:10:04 pm
@Phil: What is you opinion on Ext licensing?
I've stopped using it for web apps because I don't understand the licensing.
See also:
http://pablotron.org/?cid=1556
http://fabrizioballiano.net/2008/03/18/confirmation-of-my-doubts-about-extjs-licensing/
etc..

Those links look kind of old. Why don't you look at the licenses posted on the Ext JS site? They looked pretty clear to me.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal // One error
Post by: osvaldo-tcf on December 14, 2009, 06:31:20 pm
- Erro ExtPascal
========
    function Un(EventName : string; Fn : TExtFunction; Scope : TExtObject) : TExtFunction;
========
    Un('DOMActivate', Ajax('DOMActivate', ['E', '%0.nm','T', '%1.nm','O', '%2.nm'], true));
========

The declaration of Un in my Ext.pas looks like this:

    function Un(EventName : string; Fn : TExtFunction; Scope : TExtObject = nil) : TExtFunction;

What version of ExtPascal are you using?

Thanks.

-Phil


Extpascal and toolkit from subversion
ExtJS from download page:
3.0.3

Ext JS 3.0.3 Public Release
Ext JS 3.0.3

Includes full source code, build, HTML documentation and samples.
Released on July 6th, 2009.
Title: Re: Status of toolkit for ExtPascal
Post by: osvaldo-tcf on December 14, 2009, 07:24:23 pm
http://i-sold.org/ext-3.0.0.zip
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 10:08:20 am
Maybe I'm just being silly, but I can't get this running.

As recommended I use Lazarus 0.9.28.2 Beta (with fpc 2.2.4 on Suse 11.1).

I unzipped the ExtPascal files into ~/ExtPascal so that there is a folder
/home/mschnell/ExtPascal/extp_tk_20091206/

When I try to create an ExtPascal application, I get a

uses ... FCGIApp ....

in the source code of the "program". "FCGIApp" does not seem to exist anywhere, so I get an appropriate error message.

Wildly guessing, I changed this to be "CGIApp".

Now I get an error message "Can't find unit "Extpascal used by APPThread".

In the project's compiler options there is a "Other Unit Files" setting
$PKGDIR(ExtP_Ctrls)/../

I don't understand what that means and what the macro $PKGDIR(ExtP_Ctrls) is extracted to, but it does not seem to work.

So I added
;/home/mschnell/ExtPascal/ExtPascal-0.9.7.1/
(ignoring the "unusual Characters" warning). Making the path to be
$PKGDIR(ExtP_Ctrls)/../;/home/mschnell/ExtPascal/ExtPascal-0.9.7.1/

Now in the unit ExtPascal I get lots of error messages resulting from the fact the the class Type TFCIThread is not found.

Guessing and making this to be "TCGIThread" does not help.

What am I doing wrong ?

(P.S.: edit: I just found that you already this year posted a new ExtPascal version so I  upgraded from extp_tk_20091206 to extp_tk_20100103.zip: Same results :( .  Any help ??? )


-Michael

Title: Re: Status of toolkit for ExtPascal
Post by: osvaldo-tcf on January 05, 2010, 02:53:16 pm
Go to http://groups.google.com.br/group/extpascal
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 05, 2010, 03:14:29 pm

In the project's compiler options there is a "Other Unit Files" setting
$PKGDIR(ExtP_Ctrls)/../

I don't understand what that means and what the macro $PKGDIR(ExtP_Ctrls) is extracted to, but it does not seem to work.


I think you almost have it - with the current release, Other Unit Files should be set to "$PKGDIR(ExtP_Ctrls)/../../". Try creating a new ExtPascal Application and see if that's okay.

This is the assumed path to the ExtPascal units, i.e., two levels up from where the ExtP_Ctrls package is. You unzipped in the usual place, so you're okay. Otherwise, just change the path. That's what the popup message is all about when you create a new ExtPascal app.

Let me know if that doesn't help.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 03:25:39 pm
In fact I am using the newest version (see "P.S.") and yes it does set the path to "$PKGDIR(ExtP_Ctrls)/../../".

But this does not seem to help as I think i did overcome the unit path problem by adding the path to include the /home/mschnell/ExtPascal/ExtPascal-0.9.7.1/  directory.

But by first adding the unit path and then not mindlessly changing FCGIAPP to CGIAPP I seem to get somewhat further,

I now get

"Can't find unit Ext used by ExtPascal."

I see this in ExtPascal.pas:

uses
  SysUtils, StrUtils, Math, Ext, ExtUtil, ExtGrid;   

But I can't see either file of  of Ext.*, ExtUtil.* and ExtGrid.* anywhere



-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 03:30:34 pm
Go to http://groups.google.com.br/group/extpascal
Have been there. What am I supposed to find ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 05, 2010, 03:35:41 pm
If you installed this package:

/home/mschnell/ExtPascal/extp_tk_20091206/extp_ctrls/extp_ctrls.lpk

Then $PKGDIR(ExtP_Ctrls)/../../ will point to /home/mschnell/ExtPascal where the ExtPascal .pas files, including FCGIApp.pas, are located.

Check to see if all of that is correct.

Thanks.

-Phil


In fact I am using the newest version (see "P.S.") and yes it does set the path to "$PKGDIR(ExtP_Ctrls)/../../".

But this does not seem to change anything, as I think i did overcome the unit path problem by adding the path to include the /home/mschnell/ExtPascal/ExtPascal-0.9.7.1/  directory.

But the first problem is introduced by the "uses FCGIApp" line. What is this supposed to mean ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 04:05:51 pm
By first adding the unit path and then not mindlessly changing FCGIAPP to CGIAPP I seem to get somewhat further,

I now get

"Can't find unit Ext used by ExtPascal."

I see this in ExtPascal.pas:

uses
  SysUtils, StrUtils, Math, Ext, ExtUtil, ExtGrid;   

But I can't see either file of  of Ext.*, ExtUtil.* and ExtGrid.* anywhere



-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 05, 2010, 04:07:14 pm
You did follow the instructions on the ExtPascal site and generate the Ext.pas, etc. source files, didn't you?

Thanks.

-Phil


By first adding the unit path and then not mindlessly changing FCGIAPP to CGIAPP I seem to get somewhat further,

I now get

"Can't find unit Ext used by ExtPascal."

I see this in ExtPascal.pas:

uses
  SysUtils, StrUtils, Math, Ext, ExtUtil, ExtGrid;   

But I can't see either file of  of Ext.*, ExtUtil.* and ExtGrid.* anywhere



-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 04:10:23 pm
If you installed this package:

/home/mschnell/ExtPascal/extp_tk_20091206/extp_ctrls/extp_ctrls.lpk

Then $PKGDIR(ExtP_Ctrls)/../../ will point to /home/mschnell/ExtPascal where the ExtPascal .pas files, including FCGIApp.pas, are located.

Check to see if all of that is correct.
Sorry, but I have no idea how I should check what $PKGDIR(ExtP_Ctrls) is extracted to,

I suppose here we are hit by some upper-case problem or similar. I'll try uninstall the two extPascal packages (which is rather difficult ans Lazarus mostly refuses to show the right-click menu for them), move the sources to some other folder and reinstall....

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 05, 2010, 04:14:01 pm
I think you're starting to drift away from a solution into the weeds.

Did you or did you not compile and run ExtToPascal.dpr? If not, then do it.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 04:26:11 pm
Check to see if all of that is correct.
I had just unzipping both Zip files into the same directory placed the extpascal.pas files et al into a subdirectory ExrtPascal-0.9.7.1. So they can't be found. Moving them up one level did help.

(now I directly get to the "unit ext not found" level :) )

Thanks
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 04:34:40 pm
Did you or did you not compile and run ExtToPascal.dpr? If not, then do it
Of course I did. (with my tests I found that I get an appropriate error message just when creating an ExtPascal Application when the executable is not found)

(Back to the "ext not found" problem, ...
As I now can compile the hello project provided, I suppose I just missed some point in my own new Application.)
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 05, 2010, 04:58:34 pm
Did you or did you not compile and run ExtToPascal.dpr? If not, then do it
Of course I did. (with my tests I found that I get an appropriate error message just when creating an ExtPascal Application when the executable is not found)

(Back to the "ext not found" problem, ...
As I now can compile the hello project provided, I suppose I just missed some point in my own new Application.)
-Michael

Sounds good. The new app wizard doesn't know where the ExtPascal source files is, so it makes an assumption (two levels up from extp_ctrls folder) and sets the units path accordingly. This is also the SVN structure.

If this is not the case, just change the path.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 05:23:10 pm
Hmm.

I just rechecked and loaded the "Hello" example project.

Now it as well fails with not finding the ext unit :( .

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 06:39:34 pm
Hi Phil,

As the building has been closed for the night, I needed to leave the office and can't do any test any more today. But I can post some comments that occurred to me while riding my bicycle home through the snow.

1) It would be really nice to have a description of the suggested folder structure in the docs, so that the unzipping process can be done appropriately.

2) up to now I failed to find any instructions regarding the "ext" unit, that seems to be required additionally as well by my own project as by the "hello" example.

As I can't test anything before I even get anything compiled, I needs to ask these  questions:

3) I hoped that the visual ExtPascal components come in a "dual use" way. (a) similar to the appropriate LCL  comonent and (b) as html based remote controls, while (a) is used when designing and when debugging the user code locally (b) is used when publishing the executable as a cgi by a web server.

I understand that the .cfg file with the appropriate "-d" define does something like this, but I did not find how to do the switch whether a local debugging executable or a cgi is to be compiled.

4) Am I correct assuming that the LCL's "CGIApplication" uses "CGI" while ExtPascal uses "FastCGI" ? What exactly is FastCGI ? Does any WebServer (e.g. the very small "boa") and any browser support FastCGI ?

5) Obviously ExtPascal implements a message-event system, that does not depend on any GUI. Does same only support the "visual" ExtPascal components or can we use other "events" as well, such as TTimer and Thread Synchronization messages.

6) Would it not be good to include ExtPascal in the Lazarus distribution to be installed by default ? There I did find CGI-Application, but same seems to be a very small brother to ExtPascal.

7) Do you have any idea how ExtPascal compares to MSEifi ?

Thanks a lot for providing this package !
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 06:49:29 pm
If this is not the case, just change the path.
IMHO: better change the folder structure !
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 05, 2010, 07:50:47 pm
Hi Phil,

As the building has been closed for the night, I needed to leave the office and can't do any test any more today. But I can post some comments that occurred to me while riding my bicycle home through the snow.

1) It would be really nice to have a description of the suggested folder structure in the docs, so that the unzipping process can be done appropriately.

Browse the SVN structure.

Quote
2) up to now I failed to find any instructions regarding the "ext" unit, that seems to be required additionally as well by my own project as by the "hello" example.

Ext.pas is created by ExtToPascal.dpr from Ext JS HTML docs. This is a one-time thing that you do.

Quote
As I can't test anything before I even get anything compiled, I needs to ask these  questions:

3) I hoped that the visual ExtPascal components come in a "dual use" way. (a) similar to the appropriate LCL  comonent and (b) as html based remote controls, while (a) is used when designing and when debugging the user code locally (b) is used when publishing the executable as a cgi by a web server.

I understand that the .cfg file with the appropriate "-d" define does something like this, but I did not find how to do the switch whether a local debugging executable or a cgi is to be compiled.

ExtP Toolkit supplies design controls that allow you to place and design controls visually in the Lazarus IDE. At compile time, as long as you have UseRuntime defined (done for you automatically in extpascal.cfg file), the compiler will compile against the ExtPascal units (Ext.pas, etc.) - that way there's no dependency on LCL, etc.

Did you read this (also included with Toolkit)?

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPToolkitStatus.html

I tried to give an overview of the whole process.

Quote
4) Am I correct assuming that the LCL's "CGIApplication" uses "CGI" while ExtPascal uses "FastCGI" ? What exactly is FastCGI ? Does any WebServer (e.g. the very small "boa") and any browser support FastCGI ?

I'm not familiar with CGIApplication. I believe there's a discussion of CGI/FCGI on the ExtPascal site. You don't need FCGI if you use the CGIGateway - see docs.

Quote
5) Obviously ExtPascal implements a message-event system, that does not depend on any GUI. Does same only support the "visual" ExtPascal components or can we use other "events" as well, such as TTimer and Thread Synchronization messages.

Maybe ask on ExtPascal form.

Quote
6) Would it not be good to include ExtPascal in the Lazarus distribution to be installed by default ? There I did find CGI-Application, but same seems to be a very small brother to ExtPascal.

ExtPascal is a separate project, as is ExtP Toolkit. There are dozens of separate projects like this - probably not feasible to include much more with Lazarus. Anyway, that's not our doing - ask the Lazarus developers if you need a more definitive answer.

Quote
7) Do you have any idea how ExtPascal compares to MSEifi ?

No idea.

Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 05, 2010, 10:00:43 pm
Ext.pas is created by ExtToPascal.dpr from Ext JS HTML docs. This is a one-time thing that you do.
Ooops. Silly me confused this with the converter fmtoextp.dpr. So I really missed a major step that is described in ExtPToolkitStatus.html (which I in fact was trying to follow  %) ).

I'll do this tomorrow.....

At compile time, as long as you have UseRuntime defined...

Does this mean that when I comment out the UseRuntime lin in extpascal.cfg, I'll get a running LCL application, that I can debug with standard means ? (I'll try this ASAP.)

Many thanks for your patience !

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 05, 2010, 10:24:19 pm
Ext.pas is created by ExtToPascal.dpr from Ext JS HTML docs. This is a one-time thing that you do.
Ooops. Silly me confused this with the converter fmtoextp.dpr. So I really missed a major step that is described in ExtPToolkitStatus.html (which I in fact was trying to follow  %) ).

I'll do this tomorrow.....

At compile time, as long as you have UseRuntime defined...

Does this mean that when I comment out the UseRuntime lin in extpascal.cfg, I'll get a running LCL application, that I can debug with standard means ? (I'll try this ASAP.)

Many thanks for your patience !

-Michael

No, don't mess with extpascal.cfg - you'll end up with nothing. You can debug the running app in Lazarus - see the tutorial.

Think client-server - the FPC app is running on the server and serving up things to the browser, where the JavaScript executes. LCL in this context makes no sense.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 06, 2010, 09:19:19 am
Think client-server - the FPC app is running on the server and serving up things to the browser, where the JavaScript executes.,
Hmmmm, "Normal" CGI applications are started by the webserver and the webserver only sends back an HTML page to the client's browser when the application stops. So debugging seems quite difficult.

I do hope that with Extpascal the application keeps running (Wikipedia revield that this seems to be FCGI) which would fit my needs (here my questiond about TTimer etc. comes up) and would allow for standard debugging. This is why I asked if any web server can handle FCGI.
LCL in this context makes no sense.
Of course the CGI-application would avoid any binding to visual LCL components. But having a simple switch that - using supposedly very similar {$ifdefs as are distinguishing between design and compile state right now  - allows for either creating a CGI executable or a LCL enabled stand alone application would be really nice to have and seems to be doable (I'll take a look once I got the package running completely).

Thanks agian,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: bee on January 06, 2010, 09:55:08 am
Hmmmm, "Normal" CGI applications are started by the webserver and the webserver only sends back an HTML page to the client's browser when the application stops. So debugging seems quite difficult.

Yes. You have to use log mechanism for debugging CGI. CGI application is executed by web server, it serves the request, then dies. The process is repeated for each request, over and over.

I do hope that with Extpascal the application keeps running (Wikipedia revield that this seems to be FCGI) which would fit my needs (here my questiond about TTimer etc. comes up) and would allow for standard debugging. This is why I asked if any web server can handle FCGI.

Yes. Unlike CGI, FCGI application isn't started by the web server. Instead, web server will "communicate" with the FCGI application through an FCGI protocol. So, the FCGI application must be running separated/independenly from the web server. Most web servers support FCGI.

In addition to that, ExtPascal provide CGI gateway mechanism. This gateway is a lightweight CGI application that acts as the loader/router of the FCGI application. This way, FCGI application doesn't need to run all the time (to save resources, etc). ExtPascal FCGI application is able to shutdown itself after some period time of idle.

You don't need to question more about TTimer or interactive debugging using ExtPascal's FCGI. It already does that using multithreading approach.

For more detail information, please read ExtPascal's wiki. :)
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 06, 2010, 01:22:08 pm
In addition to that, ExtPascal provide CGI gateway mechanism. This gateway is a lightweight CGI application that acts as the loader/router of the FCGI application. This way, FCGI application doesn't need to run all the time (to save resources, etc). ExtPascal FCGI application is able to shutdown itself after some period time of idle.
That is very interesting to me !!! It seems like the web server I use (boa) does not support FastCGI. As this is not a "high traffic" application, but FCGI is needed just to allow for a permanently running background application, I suppose this really is doable and the way to go. Thanks a lot for that helpful hint !
You don't need to question more about TTimer or interactive debugging using ExtPascal's FCGI. It already does that using multithreading approach.
For more detail information, please read ExtPascal's wiki. :)
On my way.... :) I've still some doubts about the TTimer stuff, as I assume the LCL TTimer implementation uses some GUI binding for creating an event. I'll test this ASAP....

Thanks again-
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 06, 2010, 04:22:32 pm
Of course the CGI-application would avoid any binding to visual LCL components. But having a simple switch that - using supposedly very similar {$ifdefs as are distinguishing between design and compile state right now  - allows for either creating a CGI executable or a LCL enabled stand alone application would be really nice to have and seems to be doable (I'll take a look once I got the package running completely).

No, that makes no sense. The best you can do is create a "standalone" app that has an embedded Web server - see the ExtPascal site for doing this. This might have some application although I think it's fairly limited since you would still need to distribute the entire Ext JS package of JS controls with your app and the app would still need to be run in a browser.

VCL/LCL are too different from Ext JS and so I explicitly decided to avoid any runtime dependency on or compatibility with LCL. Here's a simple example of the problem you would have trying to "map" LCL to ExtPascal. The TExtFormLabel can probably be thought of as analogous to the VCL/LCL TLabel, but only in a crude way. TExtFormLabel has an Html property that has no analog in TLabel. You can set the Html property not only to use an HTML fragment for rich text (bolding, etc.), but also to display an image (<img src="mypic.jpg" />). How would you reproduce this with TLabel? You probably wouldn't and instead you would just lose this property altogether. With VCL/LCL you would use a TImage, which encodes the image in the .lfm file and streams it in at runtime - with HTML you need to have the image in an external file, either created in advance or created on the fly.

That's probably one of the biggest problems with the VCL/LCL/CLX approach - you end up deracinating the native widgetset, eliminating much of what is interesting and novel about it.

Note that you could develop both a desktop app and Web app that share quite a bit of code if you seperate the UI from everything else. You would then design two different UI's, one with VCL/LCL, one with ExtPascal. My toolkit's converter can even help with this if you have an existing VCL/LCL app and you want to start with the same form layout in the Web app. Of course, this raises the question of whether a Web app should look and behave like a desktop app. In some case, it might make sense but for other types of Web apps that probably wouldn't work out very well. But that's a different topic.

Also, if you look at the Gecko SDK port for Lazarus, it's possible you could create an embedded-server ExtPascal app that also eliminates the need to run the app in a browser, per se. Instead, you would run it in a TGeckoBrowser control, which fully supports JS, etc. This might provide more control over the app and could include some desktop functionality along with the "Web" app.

http://wiki.lazarus.freepascal.org/GeckoPort

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 06, 2010, 04:47:25 pm
No, that makes no sense.
Sorry, I did not seem to have been able to make myself clear here. What I want to do is to create an application that does "something" and has a user-interface. Same is an "embedded" thingy and the user interface is accessed only rarely, while usually the application does it's work "in the background" (using Network, serial interfaces etc.) This can be run and debugged in the normal way using Lazarus.

Now I want to make this "server based" (in fact not because I need it that way, but because with some instances of usage, the CPU the program is running on is an embedded device that does not has any user interface hardware and I want to access it in an as "standard" way as possible, thus with a browser.

To do this, I'd like to set an optional switch when creating the executable and now can install same as a cgi.

Of course I do know that for allowing this, the user interface only can define "controls" that exist (in a compatible way) as well as standard (LCL) components as as web-controls (via Extp, ExtPascal, and ExtJS).

Regarding how to do this, I'm reading your post. I might try to "ifdef" all calls to extp somehow. But at first I need to have a running extPascal example at all....

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 06, 2010, 04:58:37 pm
Did you or did you not compile and run ExtToPascal.dpr?
I was able to compile ExtToPascal.dpr (and with a slight modification) CGIHateway, too).

I ran ExtToPascal on Extjs 3.1.0, which is the "current" download. it created 13 units (rather than 19 as described in the docs for 3.0.0).

Now I tried to compile the extp "hello" example and got the error:
Identifyer not found TExtHistory" in ext.pas.

Now I'm trying to find Extjs 3.0.0, to see if same works....

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 06, 2010, 05:02:35 pm
You can use Ext JS 3.1.0 if you use the pre-generated Ext.pas, etc. units from SVN. The next release of ExtPascal (0.9.8) will include these so you don't have to build them anymore - in fact, you can't build all of them anymore because Ext JS has dropped docs for some of them for some reason.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 06, 2010, 05:40:58 pm
Hi Phil,
I got the Hello example it compiled using extjs 3.0.0 :) :) :)

If you think it makes sense to use 3.1.0, please do upload the files somewhere, as I don't want to install svn for that purpose (firewall/proxy problems etc.  But maybe the svn has a browser interface to d/l files ? )

So lets see where I can get to.
(First trying to find/use the built-in web server then trying to use the CGIGateway with the boa webserver.....)

Thanks a lot for the packet and for all help you provided up til now. :)
-Michael

Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 06, 2010, 06:20:52 pm
http://extpascal.googlecode.com/svn/trunk/

Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 07, 2010, 12:20:25 pm
First trying to find/use the built-in web server ....
Ooops !

I easily found how to enable this by setting -dWebServer, but now it needs IdCustomHTTPServer.

So I seem to need to install Indy. :o

Is this possible with Lazarus/Linux ? How ? Which version do I need (I found they are quite different) ?

Thanks,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 07, 2010, 02:46:31 pm
http://code.google.com/p/extpascal/wiki/WebServer_Embedded
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 07, 2010, 04:22:05 pm
Thanks,
I did see this, but as the Lazarus docs say that with Indy 9 hardly anything is working in Linux while with Indy 10 nothing works in Linux, I'd like to ask if you did try this.

Thanks again,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 07, 2010, 04:33:52 pm
I don't use Linux so I don't know if I can help you much there.

I have used Indy 10.1.1 successfully on OS X with both ExtPascal and the Web Service Toolkit, though.

Have _you_ actually tried to use Indy with ExtPascal? The Laz docs are often out of date.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 07, 2010, 05:01:34 pm
I found an indi port for Lazarus/linux here:

http://www.indyproject.org/Sockets/fpc/index.en.html

I installed the files and in fact I can compile and run the program with webserver enabled.

If I use a bowser to connect to the port, I in fact get a result from the program: the browser shopws an empty page with this html-code:


Code: [Select]
<?xml version=1.0?><!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN">
<html xmlns=http://www.w3org/1999/xthml>
<head>
<title>MyApp</title>
<meta http-equiv="content-type" content="charset=utf-8">
<link rel=stylesheet href="/ext/resources/css/ext-all.css" />
<script src="/ext/adapter/ext/ext-base.js"></script>
<script src="/ext/ext-all.js"></script>
</head>
<script>
Ext.onReady(function(){Ext.BLANK_IMAGE_URL="/ext/resources/images/default/s.gif";TextMetrics=Ext.util.TextMetrics.createInstance("body");function AjaxError(m){Ext.Msg.show({title:"Ajax Error",msg:m,icon:Ext.Msg.ERROR,buttons:Ext.Msg.OK});};function AjaxSuccess(response){try{eval(response.responseText);}catch(err){AjaxError(err.message+"<br/>Use DebugJS define to enhance debugging<br/>"+response.responseText);}};function AjaxFailure(){AjaxError("Server unavailable, try later.");};Download=Ext.DomHelper.append(document.body,{tag:"iframe",cls:"x-hidden"}); OE=new Ext.Button({id:"ExtButton1",tooltipType:"title",x:152,height:38,y:192,width:101,text:"Click Me"}); O0=new Ext.Window({id:"MainWindow",layout:"absolute",height:334,width:408,onEsc:function(){},title:"Hello",items:[OE]});O0.nm="O0";OE.nm="OE";OE.on("click",function(){return Ext.Ajax.request({url:"/MainWindow_ExtButton1Click",params:"Ajax=1&",success:AjaxSuccess,failure:AjaxFailure});});O0.show("");});
</script>
<body><div id=body></div><noscript>This web application requires JavaScript enabled</noscript></body>
</html>

So the HTTP server seems to work, but something in the application goes wrong.

In the Browser's error console I see some errors. e,g,;

Error: The stylesheet http://127.0.0.1:8088/ext/resources/css/ext-all.css was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://127.0.0.1:8088/
Line: 0

Error: missing ; before statement
Source File: http://127.0.0.1:8088/ext/ext-all.js
Line: 1, Column: 21
Source Code:
<?xml version=1.0?><!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN">

Error: Ext is not defined
Source File: http://127.0.0.1:8088/
Line: 11

Supposedly the internal http server does not find the folders /ext and /text.

Any more ideas ?

Moreover:

I can start the application from the command line, but I can't seem to start it from the Lazarus IDE to debug it.

I can do ine step with F7 and get to "begin" in myproject.lpr. But 'the next F7 does not do anything. If I try to run it with F9 after setting some Breakpoint, same is not reached. And I don't seem to be able to access it with the browser, even though the IDE claims that the program is still running, and pushing the red stop button produces "execution stopped".

What did I do wrong ?

Thanks,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 07, 2010, 05:09:32 pm
Try following the wiki steps and get it working that way first.

Check your browser's error console for JS errors.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 07, 2010, 05:22:43 pm
Check your browser's error console for JS errors.
Already did this. You were too fast :) ! I was editing my previous message at the same time you responded. Please take a look above.

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 07, 2010, 05:29:04 pm
Did you follow the wiki instructions and copy the Ext JS folder below your executable's folder?

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 07, 2010, 05:30:55 pm
I found that I did not correctly create a symlink to extjs with the nam "ext".

After doing so I get the same empty page, but different Browser errors:

Error: The stylesheet http://127.0.0.1:8088/ext/resources/css/ext-all.css was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://127.0.0.1:8088/Home
Line: 0

Error: missing ; before statement
Source File: http://127.0.0.1:8088/ext/ext-all.js
Line: 1, Column: 21
Source Code:
<?xml version=1.0?><!doctype html public "-//W3C//DTD XHTML 1.0 Strict//EN">

Error: Ext is not defined
Source File: http://127.0.0.1:8088/Home
Line: 11

(It's really bad that it can't run in the IDE. I do hope it will run in the IDE with the Webserver disabled.)

Thanks,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 07, 2010, 11:02:10 pm
Error: Ext is not defined

here

http://www.extjs.com/forum/showthread.php?t=23680

They suggest the problem might only occur with Firefox.

I suppose it because of the first error, as Firefox does some additional type checking.

Any idea how to overcome this (on the server site) ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 08, 2010, 11:33:25 am
It works !!!!!!

Silly me again produced an erroneous "ext" symlink besides the application  :'( .

Now I can see the primary page and click the button to create the about box, and drag the windows on the screen.

GREAT !!!!!!!!  :) :) :)  Many Thanks for your help.

Nonetheless the Firefox error console shows lots of Java Script warnings in ext-all.css..... Lets see how to overcome these.

But first I'm going to try to run it as an FastCGI application via the CGI Gaetway provided and the boa web server.

-Michael

Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 08, 2010, 12:42:53 pm
Funny:

Now it does work with Firefox (Windows and Linux) but not with MS Internet Explorer

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 08, 2010, 03:17:17 pm
Hi Phil,

I was able to create my first ExtP application from scratch :).

Here I found that the "ExtPascal" visual Controls have public properties that can be used when designing, but that are not able to be compiled (such as "Caption" of TExtButton, which seemingly is replaced by the "Text" property). Is there a list of the properties that do compile for all "ExtPascal" Controls provided by the Extp package ?

P.S.: Why with the button, is "Caption" replaced by "text" ? If this is really wanted, why does Caption still exist as a public and is offered and understood by the IDE ?

Thanks,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 09, 2010, 08:09:26 pm
The TExtButton design control is based on TCustomButton. It's not possible to hide or remove properties from TCustomButton. Compiling will catch errors in code, for example referencing TExtButton.Caption, which is okay as far as the IDE is concerned.

See ExtPascal source for list of properties. You can also work with the Ext JS API docs on-line, as long as you keep in mind that these are JS oriented. For example, in a few cases where the property can be two different types, ExtPascal has two different properties instead of just one (because of Pascal typing rules). So the ComboBox Store can be either an object or an array - in ExtPascal, there is both Store (for the object) and StoreArray (for the array). StoreArray is what I've exposed in the IDE, which is just a different name for the TComboBox Items property.

Since ExtPascal is Pascal and not JS and the Lazarus design controls used are really intended for LCL, these are two places where you have to keep in mind the differences.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 11, 2010, 10:44:45 am
Hi Phil,

Now I tried to add a Timer to the example project I created.

When I "use" the unit ExtCtrls that defines the TTimer class, when compiling, I get the error message

"Error: Error while linking"

(with no further explanation).

Any Idea what exactly that means ?

Do you suggest that TTimer should work. I in fact did not expect it to work and thus I try to create an alternative TTimer (say "TExtTimer") by using a thread that inserts a message in the TFCGIApplication Message queue.

To from a Thread  create an application Message that performs an Event in the Main Application, the RTL for TThread provides the "Synchronize" method. I tried to use that, but even if nothing is done in the synchronized mainthread-method it does not work: The synchronized method is not called and the thread hangs in "Synchronize()".

In fact I'm not really sure, what exactly we want TThread.Synchronize (and also TTimer) to do. As TFCGIApplication does not seem to use a dedicated Mainthread, but multiple threads, one for each incoming connection, which thread is supposed to act as a Mainthread that get the Queued events and is supposed to  handle the events thrown by TTimer.OnTimer and TThread.Synchronize. Maybe an additional thread is needed for this (I klnow that MSEGUI provides a "NONGUIApplication" (or similar) that does something like this (a message queue in an Application that is not integrated ion a GUI framework). Does TFCGIApplication provide something similar or would it need to be enhanced to allow for things like *Timer and *Thread.Synchronize ?

I'd appreciate any comment on that....

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 11, 2010, 11:27:29 am
Hi Phil,

I found that TExtFormCheckbox always returns the same value for "Checked" independent of the visible toggle state in the browser.

I  always get "true" as I on show do initialize it to be checked.

I suppose that ExtFormCheckbox1 should be assigned to CurrentThread (as is MainWindow_ExtFormCheckbox1Check ) but I don't find such a reference.

What am I doing wrong ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 11, 2010, 11:44:13 am
Hi Phil,

I'm trying to use TExtFormCheckbox without success.

I Fail to find what replaces the property ItemIndex of the predecessor non-Ext Class.

When designing I get a Box with the items vertically aligned and the text right of the bullets. On the Browser I get a box with the bullets horizontally aligned with the text below them but only the op half of the text is visible even though the text height would complety fit into the box.

Any help on that ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 11, 2010, 02:11:51 pm
The TExtButton design control is based on TCustomButton. It's not possible to hide or remove properties from TCustomButton. Compiling will catch errors in code, for example referencing TExtButton.Caption, which is okay as far as the IDE is concerned.
Regarding the IDE, I suppose the Caption property needs to stay, otherwise the visual placement would not work
But I was very easily able to allow for using TButton.Caption in runtime as well, by just copying the "property Text ..." line to a new line:     

property Caption: String read FText write SetFtext;

This works as expected.

So I don't see any reason why any of the useful standard LCL / VCL properties should not be reintroduced for runtime use,

Can we have the maintainers of ExtPascal accept an appropriate patch ? (Maybe the newer version is improved on that behalf, anyway)

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 11, 2010, 02:38:02 pm
I read that ExtPascal uses Ajax for passing the informations between client and server. Now with FastCGI and Ajax, it should be possible to display changes that are generated by the "process" (E.g. as some other client clicks a button) in the browser-Window of the connected client(s).

How to  do that ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 11, 2010, 04:55:34 pm
Hi Phil,

Now I tried to add a Timer to the example project I created.

When I "use" the unit ExtCtrls that defines the TTimer class, when compiling, I get the error message

"Error: Error while linking"

(with no further explanation).

Any Idea what exactly that means ?


Since TTimer is part of the LCL, you'll need to add the LCL to the list of required packages in Project Inspector. Note that using ExtCtrls will likely pull in a huge amount of LCL code - most LCL stuff is visual and makes no sense in a server app. You could also try starting with TCustomTimer - that might pull in a lot less code. Also, you might need to select a widgetset - look at the code and see how TTimer is implemented (i.e., whether in LCL or underlying widgetset).

In general, I try to avoid using any LCL in a Web app, but in this case you may not have much choice.

I can't help you with the thread questions. Please address them to the ExtPascal forum.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 11, 2010, 05:03:24 pm
Hi Phil,

I'm trying to use TExtFormCheckbox without success.

I Fail to find what replaces the property ItemIndex of the predecessor non-Ext Class.

When designing I get a Box with the items vertically aligned and the text right of the bullets. On the Browser I get a box with the bullets horizontally aligned with the text below them but only the op half of the text is visible even though the text height would complety fit into the box.

Any help on that ?

-Michael

VCL/LCL TCheckBox does not have an ItemIndex property so I'm not sure what you're referring to.

You'll need to work out the alignment problem on your own.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 11, 2010, 05:04:14 pm
Hi Phil,

I found that TExtFormCheckbox always returns the same value for "Checked" independent of the visible toggle state in the browser.

I  always get "true" as I on show do initialize it to be checked.

I suppose that ExtFormCheckbox1 should be assigned to CurrentThread (as is MainWindow_ExtFormCheckbox1Check ) but I don't find such a reference.

What am I doing wrong ?

-Michael

Checking or unchecking a JavaScript check box does not automatically change the server side state.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 11, 2010, 05:04:59 pm
The TExtButton design control is based on TCustomButton. It's not possible to hide or remove properties from TCustomButton. Compiling will catch errors in code, for example referencing TExtButton.Caption, which is okay as far as the IDE is concerned.
Regarding the IDE, I suppose the Caption property needs to stay, otherwise the visual placement would not work
But I was very easily able to allow for using TButton.Caption in runtime as well, by just copying the "property Text ..." line to a new line:     

property Caption: String read FText write SetFtext;

This works as expected.

So I don't see any reason why any of the useful standard LCL / VCL properties should not be reintroduced for runtime use,

Can we have the maintainers of ExtPascal accept an appropriate patch ? (Maybe the newer version is improved on that behalf, anyway)

-Michael

This is Ext JS, not VCL/LCL. Use the appropriate properties.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 12, 2010, 09:25:49 am
In general, I try to avoid using any LCL in a Web app, but in this case you may not have much choice.
I absolutely agree with you that avoiding any LCL should be the goal here. I would rather create some  completely new timer code than needing to use the LCL just for that purpose.

But the underlying problem is not the timer itself, but the event programming paradigm, the timer and much other stuff needs and which in fact is the basis of ObjectPascal programming, Event driven programming and doing free running application (with "asynchronous" actions) needs some stuff I did not yet find to be already done with the ExtP, ExtPascal, ExtJS trio:

 - a "Main Thread" for handling asynchronous events (supposedly easy to do by using the process main thread or by adding an additional thread)

 - an event queue for scheduling these events (The LCL does this by it's binding to the GUI framework. An example how this can be done with pure FPC code can be found in the open source MESGUI: "NonGUIApplication". The ExtPascal Web page talks about ExtPascal offering "Optional Delphi/Lazarus event handler. Did I somehow miss to enable/use this "option" ?)

 - a way to display asynchronous changes in the client's browser. I know that this is done with AJAX applications by having the JavaScript code poll the CGI-Application for (a notification of) changes, and to avoid too much traffic, the CGI application leaves such polling request "hanging" for a period shorter than the normal HTTP timeout, unless a change in fact is detected. (I don't know if something like this even is provided by ExtJS.In that case I'm out of the game here, being a Java illiterate).

The extPascal "online Samles" ( http://extpascal.call.inf.br/cgi-bin/extpascalsamples.cgi/MessageBoxes ) demonstrate a "Progress Dialog". Provided this is not just a fakel, asynchronous changes Server->Browser seem to have been implemented.

What do you think ?
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 12, 2010, 09:40:42 am
VCL/LCL TCheckBox does not have an ItemIndex property so I'm not sure what you're referring to.
Sorry, I was typing faster than thinking.

I was trying to report two differnt problems:

(1) TExtCheckbox: here I get an event when the state is toggled by the client, but the "Checked" property always stays the same

(2) TExtFormRadioGroup: here I don't find a propty like "ItemIndex" that would report the state the user selected to the application. When I decide to digg deeper into this kind of "HTML-GUI" framework, I will see if I can do anything about the display problem with TExtFormRadioGroup, but if same is on the Java site, I will not be able to improve it.

Thanks,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 12, 2010, 09:47:48 am
This is Ext JS, not VCL/LCL. Use the appropriate properties.
Of course. But seemingly the goal of EXTP is to maked ExtPascal (and thus ExtJS) more usable for educated Delphi/Lazarus/VCL/LCL users, by allowing them to use their beloved IDE to design a "Browser-GUI". So providing as much the same properties as possible would be nice. This said: supposedly modifying ext.pas might be not a good idea, but I see that as an application created with ExtP directly uses ext.pas, it would need for not-trivial enhancements for ExtP to offer this additional comfort (by automatically modifying ext.pas or by providing an interface unit that is to be used in the unit's "uses" instead of extp (and maybe more ExtPascal-units).

After some coding.....
This has been a lot less difficult than I thought:

I created a unit Extp:
Code: [Select]
unit extp;
{$mode objfpc}{$H+}
interface
uses
  Ext;
type
  TExtPanel  = class(Ext.TExtPanel);
  TExtWindow = class(Ext.TExtWindow);

  { TExtButton }
  TExtButton = class(Ext.TExtButton)
   private
     function GetCaption: String;
     procedure SetCaption(const AValue: String);
   public
    property Caption: String read GetCaption write SetCaption;
  end;

implementation
{ TExtButton }
function TExtButton.GetCaption: String;
begin
  Result := inherited Text;
end;

procedure TExtButton.SetCaption(const AValue: String);
begin
  inherited Text := AValue;
end;

end.

Now in the "GUI" unit of the application, in the "UseRuntime" part of the use clause, I replaxed "Ext," with "Ext, ExtP,".  

With that we can use the "Caption" property of the "TExtButton" instances in the same way as we are accustomed to do with VCL/LCL GUI programming. :)

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 12, 2010, 01:16:07 pm
Doing more test with the "visual" "TExt..." components. It looks like no state transfer from the Browser to the Application works:

 - TExtFormCheckbox: I always get the same Value for "Checked", even in the event procedure assigned to the CheckBox
 - TExtFormRadioGroup: I can't find a "runtime" property that would give the radiobutton that is pushed (ItemIndex only exist at design time)
 - TExtFormTextField: When reading the field e.g. in an event procedure of some Button, the property "Value" always gives the text initially assigned, instead of what I typed into the field with the Browser, .

Any further tip ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 12, 2010, 04:01:16 pm
Doing more test with the "visual" "TExt..." components. It looks like no state transfer from the Browser to the Application works:

 - TExtFormCheckbox: I always get the same Value for "Checked", even in the event procedure assigned to the CheckBox
 - TExtFormRadioGroup: I can't find a "runtime" property that would give the radiobutton that is pushed (ItemIndex only exist at design time)
 - TExtFormTextField: When reading the field e.g. in an event procedure of some Button, the property "Value" always gives the text initially assigned, instead of what I typed into the field with the Browser, .

The ExtPascal FAQ page seems to suggest something like this:

Handler := Ajax(Server.Method, TExtFormBasicForm(AForm.getForm).getValues);

But with an ExtP application I don't see what I should do here. It does not know the identifiers "Server", "AForm" (, and Handler).

Any further tip ?

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 12, 2010, 04:01:50 pm
- a way to display asynchronous changes in the client's browser. I know that this is done with AJAX applications by having the JavaScript code poll the CGI-Application for (a notification of) changes, and to avoid too much traffic, the CGI application leaves such polling request "hanging" for a period shorter than the normal HTTP timeout, unless a change in fact is detected. (I don't know if something like this even is provided by ExtJS.In that case I'm out of the game here, being a Java illiterate).

What do you think ?
-Michael

Please ask questions like this on the ExtPascal forum, not here.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 12, 2010, 04:04:10 pm
This is Ext JS, not VCL/LCL. Use the appropriate properties.
Of course. But seemingly the goal of EXTP is to maked ExtPascal (and thus ExtJS) more usable for educated Delphi/Lazarus/VCL/LCL users, by allowing them to use their beloved IDE to design a "Browser-GUI".

That's not the goal of ExtPascal. And one goal of the ExtP Toolkit is to use the ExtPascal properties as much as possible.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 12, 2010, 04:08:13 pm
Doing more test with the "visual" "TExt..." components. It looks like no state transfer from the Browser to the Application works:

 - TExtFormCheckbox: I always get the same Value for "Checked", even in the event procedure assigned to the CheckBox
 - TExtFormRadioGroup: I can't find a "runtime" property that would give the radiobutton that is pushed (ItemIndex only exist at design time)
 - TExtFormTextField: When reading the field e.g. in an event procedure of some Button, the property "Value" always gives the text initially assigned, instead of what I typed into the field with the Browser, .

The ExtPascal FAQ page seems to suggest something like this:

Handler := Ajax(Server.Method, TExtFormBasicForm(AForm.getForm).getValues);

But with an ExtP application I don't see what I should do here. It does not know the identifiers "Server", "AForm" (, and Handler).

Any further tip ?

-Michael

Have you looked at the multiselect_example?

Thanks.

-Phil


Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 13, 2010, 12:04:40 pm
Re-uniting the several discussion threads...

Hi Phil,
Sorry for me being confused ;) .

My long-time goal is doing embedded applications with Lazarus/Linux for processor boards without any GUI-hardware/GUI-framework, and porting existing Delphi applications to that target.

For these, I'd like to provide a Web-interface in a way as similar to the GUI of Delphi-applications as possible. Here I of course need a “free running” application, that can use Timers, TCP/IP, serial connections, etc ”in the background”, while no Browser is accessing the “Web-GUI”. Moreover, if a Browser is “connected” (i.e. showing a page of the “Web-GUI”), state changes introduced by the background tasks or by other Browser sessions, need to be reflected on the “Web-GUI” by updating the appropriate controls.

When I found ExtP, I was happy to see that there are tools that might be able to help me with that. The examples I found (on the ExtPascal Website), especially the “Progress-Bar” looked encouraging, as it seems to show the state of a running background process in realtime on the “Web-GUI”.

Now I looked into the source-code of the Progress-Bar example and found that it in fact is a fake: the continuous state changes are done by a Java script thingy running in the browser and not by a background processes on the server displaying it's state in realtime.

I never tried ExtPascal without ExtP. In fact in the beginning I thought that ExtPascal is just a part of ExtP and not decently usable without it. (That is why I had not choice but pestering you with my silly questions.)

I understand that I need to try to create an application with ExtPascal without using ExtP to understand what is happening there (e.g. if/how it's possible to communicate application states in realtime towards the browser without user interaction.)

Regarding the “Background work” in the FastCGI-application, I (fooled by the “Progress-Bar” example that I erroneously thought would be have been done with ExtP and erroneously thought would not be a fake) hoped that ExtP (which I found does not need the VCL/LCL binding) would implement a MainThread and a message queue in it's TApplication workalike. Now I know that it does not, but uses the TFCGIApplication (in FCGIapp.pas) or the TIdExtApplication (in IdExtHTTPServer) provided by ExtPascal, that both seemingly can't do that.

Do you know if/how ExtPascal can be used with a project based on the normal TApplication provided by the Delphi-VCL / Lazarus-LCL so that I can test what happens when a “Mainthread” is working in the background ? If that in fact does work and transferring application states into the browser GUI (see above) is possible, I might be inclined/able to rework TFCGIApplication and/or TIdExtApplication in a way according to the MSEGUI's “TNonGUIApplication” to enable event driven background MainThread programming with an ExtPascal WebGUI without VCL/LCL-binding.

So while seemingly not yet being the solution for the problems I face, maybe ExtP and ExtPascal are an excellent base to built this on (and feed back these option that additionally could be enabled into open source)....

This is Ext JS, not VCL/LCL. Use the appropriate properties.
Of course. But seemingly the goal of EXTP is to make ExtPascal (and thus ExtJS) more usable for educated Delphi/Lazarus/VCL/LCL users, by allowing them to use their beloved IDE to design a "Browser-GUI".
That's not the goal of ExtPascal. And one goal of the ExtP Toolkit is to use the ExtPascal properties as much as possible.
Yep, and this is GREAT and seems to work for the cases is meant for. But nonetheless IMHO it would be even greater it ExtP would preserve the functions of the well known VCL/LCL properties within the re-created work-alike classes as far as possible (such as Tbutton.Caption). This seemingly is not really hard to do (as I proved in my previous mail), but maybe it colud be a lot of work, regarding all the properties that we might want to handle.


Have you looked at the multiselect_example?
It does not compile with "WebServer" enabled ("Error: identifier idents no member Queries" in line 75, seemingly "CurrentThread.Queries"). It does compile without WebServer, but I can't test this yet, as I did not yet install a FastCGI enabled web server.

I commented out line 75 and now it compiles and it does work, :)
(Only after each Button click it additionally displays an error message "you must select an item. That seems to be caused by commenting out the offending line.)

(Some minutes later: I easily could add the property Queries to TIdExtHTTPServer. :) )

Nonetheless: I don't see why the Checkbox.Checked should not be able to be made work in a "normal" way by doing the "query" thingy in the appropriate class with a GetChecked function.

... But I can't find out what string to use in "Query" to get the checked state....
Seemingly in the multiselect example this is done by ExtUxFormMultiSelect1, but if I try to follow the example with my project, creating the appropriate "on" event, I get an error message "Access violation", when I load the form iin the browser. IMHO, no wonder as ExtUxFormMultiSelect1 never is created, But I don't find such a create in the multiselect example, either.

Thanks a lot for your work and your patience !!!
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 13, 2010, 06:07:36 pm
Michael,

Sounds like your ExtPascal is out of date if you don't have Queries in IdExtHTTPServer since I added Queries months ago. Upgrade to SVN.

There's also an easier way of getting data in the Ajax handler than using Query, but it depends on a fix that Wanderlan made this week. So upgrade to SVN.

Your threading questions should be directed to the ExtPascal forum so more knowledgeable people can see them.

The ExtP Toolkit design controls serve two main purposes, of which VCL/LCL property naming is not one of them:

- Visual design of Web pages. This is of middling importance but is useful to have.
- Generate Pascal code from the visual design. This is the real value, as figuring out how to do certain things in ExtPascal can be confusing. As I add support for more Ext JS properties, this value will only increase.

Thanks.

-Phil


Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 13, 2010, 07:34:17 pm
There's also an easier way of getting data in the Ajax handler than using Query, but it depends on a fix that Wanderlan made this week. So upgrade to SVN.
Right now I'm using the older Version of ExtJS, as you suggested. Should/need I upgrade to the newer version to use with the current version of ExtPascal ?

I first need to find out if/how events from the server application can be pushed towards the browser via Ajax using the Java scripts that come with ExtJS. I can't work on the Java stuff, but I do know that I will be able to create add-ons for ExtPascal and for ExtP, that do not need major changes to the existing code but just a few lines included in {$ifdefs and some additional unit's I'd provide.

With that both my favorite enhancements could be done:

(1) (less important) many properties of the VCL/LCL workalike classes that are normally used in the user-code with VCL/LCL application can be used at runtime with EXTP (e.g. TExtButton.Caption can be written to and TExtFormChekbox.Checked can be read from)

(2) (more important) a Mainthread with Event-driven programming possibilities (e.g. TThread.Synchronize) is enabled without using any GUI binding. To make this useful I suppose we would need to create some additional components such as "TExtTimer").

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 13, 2010, 07:53:26 pm
The SVN version of ExtPascal works with both ExtJS 3.0.0 and 3.1.0.

Note that with SVN you don't have to generate Ext.pas, etc. yourself anymore, as they are included now. However, keep in mind that they were generated from the 3.1.0 docs - but they still work with 3.0.0 as long as you don't use properties that were introduced with 3.1.0 since these properties won't be in the 3.0.0 JS classes.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 13, 2010, 07:55:29 pm
I first need to find out if/how events from the server application can be pushed towards the browser via Ajax using the Java scripts that come with ExtJS. I can't work on the Java stuff, but I do know that I will be able to create add-ons for ExtPascal and for ExtP, that do not need major changes to the existing code but just a few lines included in {$ifdefs and some additional unit's I'd provide.

You probably just mistyped, but it's JavaScript, not Java - two unrelated languages.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 13, 2010, 08:06:18 pm
Thanks, Phil, I'm at home now and will check your suggestions tomorrow.

I just took a look at the ExtJS website and found this example:

http://www.extjs.com/deploy/dev/examples/direct/direct.php

and this description:

http://www.extjs.com/products/extjs/direct.php

It looks very much as if here ExtJS indeed shows that it can handle serve-initiated updates of the controls in the Browser.

As I can't get much of Java, I don't understand how this works.

So this framework indeed seems to be usable for me. Now I need to find out if/how ExtPascal makes use of that.

(BTW.: This is what I meant by "hanging CGI Request:
http://en.wikipedia.org/wiki/Reverse_Ajax
http://en.wikipedia.org/wiki/Comet_%28programming%29 )

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 13, 2010, 11:03:42 pm
Please ask questions like this on the ExtPascal forum, not here.
How to do this ?
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 13, 2010, 11:06:24 pm
Please ask questions like this on the ExtPascal forum, not here.
How to do this ?
-Michael

http://code.google.com/p/extpascal/

Click ExtPascalForm link.

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 13, 2010, 11:07:31 pm
You probably just mistyped, but it's JavaScript, not Java - two unrelated languages.
As you see, Im illiterate on the J* behalf. ;) Thus I'm not willing to look too deep into that but am hopuíng I can use what ExtPascal makes of it.

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 13, 2010, 11:10:02 pm
http://code.google.com/p/extpascal/

Click ExtPascalForm link.
Sorry no link with a similar text exists for me :( .

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 13, 2010, 11:18:07 pm
http://code.google.com/p/extpascal/

Click ExtPascalForm link.
Sorry no link with a similar text exists for me :( .

-Michael

When you scroll down and look on the right side where all the links are, don't you see this?

Groups:  ExtPascal Forum


Anyway, clicking that link takes you here:

http://groups.google.com/group/extpascal

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: bee on January 14, 2010, 07:03:39 am
@mschnell:

First of all, please shift your paradigm regarding web programming. No matter how good is ExtJS, ExtPascal and ExtPToolkit, you still NEED to learn the basic concept of web programming, Ajax (including server push Ajax aka comet as you seem to need it), HTTP communication, CGI and FCGI mechanism. If you still lack of them, we can't help you much.

And, as Phil said, it's better to continue this discussion on ExtPascal group as most of ExtPascal people are there. Only some of them are watching this forum.

Thanks.
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 14, 2010, 09:16:10 am
When you scroll down and look on the right side where all the links are, don't you see this?
Right you are. Now it's there. Yesterday, at home, I'm sure it wasd not there. I did look at this place and additionally I seached the site for all appearances of "extpascal".

Thanks,
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 14, 2010, 09:41:22 am
you still NEED to learn the basic concept of web programming, Ajax (including server push Ajax aka comet as you seem to need it), HTTP communication, CGI and FCGI mechanism. If you still lack of them, we can't help you much.
Thanks for pointing that out. Of course I do have some theoretical knowledge about this. E.g. I do know about the basics (even though I only recently learned that the "revers event transfer via Ajax" is called "Comet" <is this the commonly accepted name right now ? > ) And I of course know since long that I do need these concepts to get the stuff done than I have in mind (provided that I do decide to use a browser at the client site, some dedicated home-brew "remote GUI" program or stuff like VNC would be possible, too.) Right now this still is a research in multiple directions, So I am just starting to play with "Ext..." as a try to do a proof of concept.

I only would decide to use a Browser to enable the remote GUI, if I can find a working Tool kit (or help to enhance  a toolkit in a way) that it's usable to create such a remote GUI for an embedded applications (free running Main-Thread with Event queue handling, no VCL/LCL) without needing to do project specific JavaScript programming. This is not a "Web-centric project", but the remote GUI is just meant to replace the Delphi-VCL-GUI "used once and again for configuration and controlling" of the project to be ported

ExtPascal is the tool kit that comes by far the closest to that goal of anything I found yet. Now I am researching what needs to be done to make it usable (e.g. if/how it allows for Comet technology, need/can  same be added, how ? )

ExtP seems like a great tool top make ExtPascal more usable for my colleagues (educated Delphi programmers) and so I'd like to include it in the "remote GUI tool kit" if possible.

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 14, 2010, 09:54:26 am
And, as Phil said, it's better to continue this discussion on ExtPascal group as most of ExtPascal people are there. Only some of them are watching this forum.
Right you are. Many thanks for the invitation !

I just took a look there and found a post by yourself:
Quote from: bee, Feb, 11, 2009
Wait for ExtJS 3.0 which would support comet a.k.a server push Ajax.
Using this technique, writing a web-based chat program would be a no-
brainer, at least that's what I heard. ;)
Great to find that ExtJS provides Comet out of the box. So I do hope that no JavaScript programming is necessary for my project.

Before I post something there, maybe you might be able to tell me if comet accesses indeed are already possible with ExtPascal and if so perhaps you can point me to an example (Of course the said chat-program would be a great starter). If no, you might be inclined to provide me with some hints how to enable, it either here or in the ExtPascal Forum.

Thanks a lot !
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: kri2512 on January 24, 2010, 04:35:41 pm
Hello,
new to ext pascal and extP toolkit, i work with delphi 2005, and i do not manage to install extp toolkit.
Particulary the orpheus package. i get errors like "margins not declared"....
this property does not exist in Delphi 2005...
is there a way to avoid this ?

regards,
christophe
Title: Re: Status of toolkit for ExtPascal
Post by: kri2512 on January 24, 2010, 05:08:42 pm
Very sorry, another trouble with the Hello_example...
i try to run the delphi-compile.bat, but it generates an error "can not find idcustomhttpserver.dcu"...
although i have modified the delphi path, and indy 10 is correctly installed on my computer ?

could you help me ?

regards,
christophe
Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 24, 2010, 06:25:05 pm
Hello,
new to ext pascal and extP toolkit, i work with delphi 2005, and i do not manage to install extp toolkit.
Particulary the orpheus package. i get errors like "margins not declared"....
this property does not exist in Delphi 2005...
is there a way to avoid this ?

regards,
christophe

Roman Kassebaum maintains the official Delphi version of Orpheus here:

http://sourceforge.net/projects/tporpheus/

Is that what you tried to install? I have not tested this since I use the original Orpheus 4.07 on Delphi 7 and Delphi 2006 and it works perfectly there. I believe he has added Unicode support to the SourceForge Orpheus and that may no longer support Delphi 2005. You could try the original Orpheus 4.07.

You could also try Lazarus with its ported Orpheus here:

http://wiki.lazarus.freepascal.org/OrphPort

Thanks.

-Phil


Title: Re: Status of toolkit for ExtPascal
Post by: Phil on January 24, 2010, 06:33:40 pm
Very sorry, another trouble with the Hello_example...
i try to run the delphi-compile.bat, but it generates an error "can not find idcustomhttpserver.dcu"...
although i have modified the delphi path, and indy 10 is correctly installed on my computer ?

could you help me ?

regards,
christophe

The hello_example project does not use Indy. What did you change?

Thanks.

-Phil
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on January 26, 2010, 04:49:32 pm
The hello example does use indi, if you define the compiler switch to use the internal web server. Supposedly this is what he did.(I did so as well and it did work for me.)

-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: mschnell on February 06, 2010, 01:38:45 pm
Hi Lurkers,

I succeeded in doing the first steps of porting NoGUIApplication to Lazarus. A TTimer works fine in my first "proof of concept" application.

In the end I'm going to create a Lazarus Add-On-Package from this.

Now, if somebody wants to create a free running program with ExtP / ExtPascal / ExtJS, he can build on this.  Such a program can be a kind of Online-Game or an embedded thingy with a web interface for controlling it.

To do this he would need to make sure that ExtP / Extpascal  supports revers HTTP communication ("Comet" see above) or improve ExtP / ExtPascal to do so. (ExtJS is said to already be able to do Comet.)

I myself decided to use do "ifi" instead of "Ext". Ifi uses a native bidirectional TCP/IP protocol instead of HTTP and uses another restricted but extensible count of LCL-compatible visual components instead of the ExtJS controls. Instead of a browser and Google's Java scripts, ifi uses a dedicated Lazarus-generated (but not necessarily project specific) program as a "client".

Have fun !
-Michael
Title: Re: Status of toolkit for ExtPascal
Post by: xinyiman on May 08, 2012, 12:17:17 pm
Hello Phil, user satisfaction with ExtPascal a few weeks and I already had some driving videos on youtube as well as publicize the Italian community of lazarus. But now I have a problem: how do I read a cell in a grid. On ExtPascal Group nobody answers me. Please feel an urgent need to understand how.
Title: ExtPascal for Lazarus 2 just compiled
Post by: matthius on November 19, 2020, 07:01:28 pm
Hello !

Here is Extpascal for Lazarus 2 not tested :
https://sourceforge.net/projects/extpascal/files/ExtPascal%20Ext%203.2.1/ExtPascal.7z/download
Title: Re: Status of toolkit for ExtPascal
Post by: matthius on November 20, 2020, 07:52:08 am
I just repost the file.

I erased lib directory to recompile it.
Title: Re: Status of toolkit for ExtPascal
Post by: progmokus on November 26, 2020, 02:02:56 pm
It cannot be compiled in Windows under Lazarus 2.0.10, the BlockSocket unit refers to functions in BaseUnix eg: fpFD_ZERO etc ...  :(
Title: Re: Status of toolkit for ExtPascal
Post by: matthius on November 29, 2020, 03:38:14 pm
Sorry, i do not use Windows anymore.

All of my new projects use Linux Ubuntu.

I am testing ExtPascal under NGINX. Bad Gateway for the moment.
Title: Re: Status of toolkit for ExtPascal
Post by: progmokus on November 29, 2020, 04:59:11 pm
Hello!
Okay, then you'll install Ubuntu Linux on a virtual machine ... and I'll check it out there.
Thanks!
Title: Re: Status of toolkit for ExtPascal
Post by: matthius on November 30, 2020, 11:54:22 am
I do not know how to test ExtPascal now.
There is no header for the moment.

Someone had helped me at a moment. You can help me to debug it.

I am searching a Lazarus Indy project that is working. Is there any ?

I plan to create a web framework next.
Title: Re: Status of toolkit for ExtPascal
Post by: nouzi on November 30, 2020, 03:24:44 pm
see this
https://www.youtube.com/watch?v=Hxb-An_61D8&list=PLD_vWTtDnhr2IoNzFA95vs0NREgdCYzYg&index=3&t=16s
Title: Re: Status of toolkit for ExtPascal
Post by: matthius on December 01, 2020, 08:18:13 am
OK, i know this project.

But i want to create a BPM DHTML Framework.

I am searching how to configure fcgiwrapper with socket 9000 on my Fast CGI. I want to keep 80 socket. I want to do it without PHP and without script error.
Title: Re: Status of toolkit for ExtPascal
Post by: matthius on December 01, 2020, 08:41:20 am
It seems using another socket. Interesting
Title: Re: Status of toolkit for ExtPascal
Post by: matthius on December 02, 2020, 04:52:45 pm
I have a socket bind error on every of my Fast CGI projects, ether FPWeb.

I use Ubuntu 20.20.
Title: Re: Status of toolkit for ExtPascal
Post by: cappe on September 25, 2021, 12:20:30 pm
Hi, I tried to compile extpascal with lazarus 2.0.12 but it unlocks me when compiling the ide

ide.pas (10,18) Fatal: Could not find AddDirToPkgDlg used by ide.

How should it be installed?
TinyPortal © 2005-2018