Recent

Author Topic: Status of toolkit for ExtPascal  (Read 102187 times)

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #45 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
« Last Edit: January 07, 2010, 10:53:23 pm by mschnell »

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #46 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

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #47 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

« Last Edit: January 08, 2010, 01:55:31 pm by mschnell »

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #48 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

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #49 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
« Last Edit: January 09, 2010, 04:33:39 pm by mschnell »

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Status of toolkit for ExtPascal
« Reply #50 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

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #51 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
« Last Edit: January 11, 2010, 02:17:11 pm by mschnell »

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #52 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
« Last Edit: January 11, 2010, 02:20:16 pm by mschnell »

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #53 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

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #54 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

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Status of toolkit for ExtPascal
« Reply #55 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

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Status of toolkit for ExtPascal
« Reply #56 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

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Status of toolkit for ExtPascal
« Reply #57 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

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Status of toolkit for ExtPascal
« Reply #58 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

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Status of toolkit for ExtPascal
« Reply #59 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

 

TinyPortal © 2005-2018