[Lazarus] Convert standard Lazarus application (Tforms and TButtons etc) into >>> a web application

ik idokan at gmail.com
Fri Dec 24 10:59:46 CET 2010


Please see my answers inline.

2010/12/24 Peter E Williams <pewslinuxvault at gmail.com>

> Hi all,
> Please excuse me if this is an obvious question.
> I have an application called Adv_Player which I programmed in Delphi 7
> Enterprise project and I have since converted it to a Lazarus
> project. (It is a very stable and fully test application available for
> Windows XP from my download page in a setup exe file).
> Yes, I still have all the fully working original source code.
> Now I want to convert it into a web based application. I know that Delphi 7
> Enterprise can do this but I never got around to investigating HOW to go
> about doing this.
> The application has a Adv_Main : TForm and lots of TEdit's, TButton's and
> TCheckbox'es and TRadioButton's and a few TGroupBox'es (or do I mean
> TRadioGroup ?) and TFrame's and maybe a TSplitter.
> The rest of the work is all done with my own code and reads and write some
> text files with readln and writeln statements. These can be thought of as
> comma separated value files.

First tip: HTTP is a stateless protocol. And you can get many requests at
the same time, so handling text files by yourself is not recommended.

There are databases such as Redis <http://redis.io/> (it's non SQL based
database) that know how to work with key-value data, but know how to handle
multiple requests. And can save you a lot of issues with it.

> Questions:
> What do I need to do in order for my application (currently about 5-6
> TForms) into a web based application? Another application has about 10-12
> TForms in it.

Translate your forms into HTML
One of the things I want to do but lack the time to do is to write a Lazarus
Widget that is actually translating normal GUI forms into HTML Forms, but
that's just a dream for now.

> How many of those components do I keep and what needs to be replaced and
> with what equivalent components. E.g. what is the web based version of
> TButton or TEdit etc?

Everything should be in HTML regarding what the client see. The logic is in
the Server side.

> How do I tell Lazarus that my binary file will be launched from within my
> html code?

You do not :) You have a web server. It tells regarding your route how the
request will be handled, and send it to your application (CGI -> Common
Gateway Interface) to work with it if configured properly.

> Can Lazarus do this?

Yes, I'm writing a commercial app just now using fpWeb and Lazarus.

> Would I be correct in assuming that ShowMessage() would not work it was
> hosted on a website?

For that there is a dynamic language called JavaScript (or Emca Script) that
does this. And client side work can also be done with it, but please note
that on the server side, you can not assume that the data itself is valid if
you tried to sanitize it in client side, so Javascript is to help your users
not to help yourself (please remember it).

You have also a lot of Javascript libraries. for webapps, you have ExtJS,
and Lazarus have also ExtPascal for that. But if your application is
commercial, you must buy a license for ExtJS afaik.
You have also dojo, jquery mootools and more that provide a better
javascript framework to work with.

> I want to how it on my own website which is hosted by Hosted24.com with my
> Silver membership payment plan.
> I also have Dreamweaver 3, Studio MX (including Dreamweaver MX) and
> KompoZer for Mint 10 and Wine 1.3.

Personally I use regular editor such as vim, lazarus (it's not an IDE for
non pascal code), kate/gedit for this type of tasks. In Linux you also have
dedicated editors for working with web based technology, and you can use
Oracle's NetBeans as an IDE, but for me as I said, I use regular text
editors for that.

> Regards,
>     PEW
> Fond Regards, Peter Eric WILLIAMS
> --- Hobart, Tasmania, Australia
> --- Phone: +61 (03) 6236-9675
> My free websites are:  http://pewink.info   (&)
>    http://pewslinuxvault.googlepages.com
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
LINESIP - Opening the source for communication
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20101224/7c9a8376/attachment-0007.html>

More information about the Lazarus mailing list