Recent

Author Topic: Form to HTML  (Read 13913 times)

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Form to HTML
« on: September 16, 2009, 09:42:19 am »
Dear all,

I remember seeing a utility here, a year ago I think, that allowed you to convert a Lazarus and even a Delphi form to html retainning a great many features.

Can any one please point me to that again?

Paul

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Form to HTML
« Reply #1 on: September 16, 2009, 01:59:53 pm »
This may be what I was looking for:

  fmtophp

 http://web.fastermac.net/~MacPgmr/PhpTk/PhpTkStatus.html

Does any one know if  there is anything that does straight html?

Paul

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Form to HTML
« Reply #2 on: September 17, 2009, 04:37:02 am »
And why would you want to do that?

Thanks.

-Phil

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Form to HTML
« Reply #3 on: September 18, 2009, 12:49:06 am »
Thanks for asking Phil,

I don't want the whole frame work which is required underneath that.

Paul

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Form to HTML
« Reply #4 on: September 18, 2009, 01:15:06 am »
Still not sure if I understand what you're trying to do.

Do you want to convert the form into something for use on the Web? Like a Web app?

If so, take a look at this:

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

Includes a converter that converts Delphi/Lazarus form designs to ExtPascal code.

Thanks.

-Phil

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Form to HTML
« Reply #5 on: September 18, 2009, 03:16:01 am »
Sounds awesome - I'll have a look,

Thanks Phil

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Form to HTML
« Reply #6 on: April 21, 2011, 09:07:25 am »
This posting has recently appeared over on wiki.lazarus.freepascal.org http://wiki.lazarus.freepascal.org/DELPHI_FORM_TO_HTML_CONVERTER

I had a look at trying to make it install as a component putting the recommended .pas into a new component, but it seems quite a bit of work, possibility outside my experience, is needed to port it to Lazarus, unless I am missing something really obvious.

Is there anywhere on the wiki or elsewhere, where details are kept of who might be looking into a project like that please?

Paul

Blue1987

  • Full Member
  • ***
  • Posts: 165
Re: Form to HTML
« Reply #7 on: April 21, 2011, 10:28:49 am »
I need pretty the same...

I am programming an educational simulation of a preysVSpredators model (the file I attach), and now I would like to make it a web application (I mean, making it work inside a html web page)... is it possible? (or do I have to manually translate it in java or sth else?)

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Form to HTML
« Reply #8 on: April 21, 2011, 12:02:56 pm »
Dear Blue1987,

Have a look at these things one a previous post in this thread http://www.lazarus.freepascal.org/index.php/topic,7478.msg35479.html#msg35479

And this thread

http://www.lazarus.freepascal.org/index.php?topic=5832.0

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

http://www.pradoframework.com/forum/index.php?topic=10344.msg48164#msg48164

You'll get your simillar look in the browser, but with most options you'll still need to rewrite your business logic in the html or php.

Paul

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Form to HTML
« Reply #9 on: April 25, 2011, 05:27:10 pm »
Mmm I am testing this: http://www.unigui.com/ now, seems a perfect solution, lets see if it works ;-)

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 117
Re: Form to HTML
« Reply #10 on: April 26, 2011, 08:25:16 am »
That looks very good, have you got it running with Lazarus? I could only find mention of Delphi 2006+ and we were last on Delphi 2005 Pro %)

Sometimes I don't think I would need the full on Ext Js or the php Vcl thing, and actually need something a bit simpler.

If http://wiki.lazarus.freepascal.org/DELPHI_FORM_TO_HTML_CONVERTER is going to be too hard to convert to Lazarus ...

I have been looking at the XML export of the Lazarus form.

It is very well formed and leads me to speculate about writing something to convert specified elements into html (jQuery even) with attached .css and skeleton .js

In a sense I would find it very useful just to have a utlity for Lazarus forms that will produce .html and .css with a dummied up .js perhaps auto writing in appropriate jQuery skeletons or simple JavaScript barebone function holders - when obvious.

Then I can take my Lazarus client project and start the process of moving it to the intranet/ or web. When needed. I dont mind hand coding the rest of the business logic, it woiuld be  neat just to have the WYSIWYG part covered.

                <component name="Button1" class="TButton">
                  <properties>
                    <integer name="Left" value="585"/>
                    <integer name="Height" value="25"/>
                    <integer name="Top" value="362"/>
                    <integer name="Width" value="75"/>
                    <string name="Caption" value="Button1"/>
                    <integer name="TabOrder" value="1"/>
                  </properties>
                </component>

Unlike the text of the .lfm,  the xml export has no indication of any event  handling

      object Button1: TButton
        Left = 585
        Height = 25
        Top = 362
        Width = 75
        Caption = 'Button1'
        OnClick = Button1Click
        TabOrder = 1
      end 

Is there any option to turn on the XML export of the form with inclusion of indications of events and procedure names? Or I suppose I could just parse the .lfm text

(For the .js just need to think about there being an indication at least of any wanted event handling on each element that needs to be written in JavaScript/jQuery etc.  Be nice if I could pick up  the Lazarus procedures themselves and put them as comments in the generated JavaScript function place holders)

When a Lazarus project is compiled, does it still "know" it's text origins. I.e. could I walk the application as an object (while running) and get enough out of it to create my html, css and Js skeleton? Would a running Lazarus application still "know" what the comments were in procedures - the very inner text of the procedures themselves? That would be a neat OO and clean way to do this if so. Just add a routine (even as a component) to run through the application while running to make the necessary files on disk.

Thoughts to this point any way...

Paul

 

TinyPortal © 2005-2018