Hi,
ist there a complete documentation of Lazarus' LFM xml file format?
Maybe someone having good knowledge of the IDE source code can name the unit(s) where writing and reading forms is handled?
TIA,
Marc

Mailing lists / lazarus / 2014-04
13 messages · 6 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
ist there a complete documentation of Lazarus' LFM xml file format?
Maybe someone having good knowledge of the IDE source code can name the unit(s) where writing and reading forms is handled?
TIA,
Marc
Hi, ist there a complete documentation of Lazarus' LFM xml file format?
No.
If someone wants to start one I will help.
Note: The xml format has not yet implemented all features.
Maybe someone having good knowledge of the IDE source code can name the unit(s) where writing and reading forms is handled?
xml "driver" reader/writer:
components/lazutils/laz_xmlstreaming.pas
Component streaming in general:
unit classes, see TReader/TWriter
IDE additions:
designer/jitforms.pp
Mattias
Oops, I confused something. I silently assumed .lfm's are stored in XML, but they are not. In fact the storage format is someting like XML without tags but python-like syntactical indentation.
Now I'm confused. When and how is XML used to store form descriptions? What use cases is it made for?
What I really want to do is to write some form descriptions (and code) by a generator program. If there is any existing code that can be reused it would be very helpful.
So for not generating form code myself I would learn to use jitforms unit. Do you see any problems in writing the code to a file instead of using it like in lazarus' desing mode?
Yes.
Now I'm confused. When and how is XML used to store form descriptions?
Some people use it. The IDE does not.
What use cases is it made for?
Some people prefer xml.
What I really want to do is to write some form descriptions (and code) by a generator program. If there is any existing code that can be reused it would be very helpful.
This is too vague. What do you want to achieve?
The jitforms unit is only useful if you want to write a form designer, which can load arbitrary forms with unknown classes. Normal loading/saving only needs the stuff of the RTL+LCL.
Mattias
I see.
I'm thinking about a programm that:
- opens a database
- generates form and source for each table
- uses mapping db-type -> gui component
- uses configuration
If you ever used the "Database Form Wizard/Assistant" of Openoffice you know what I want. Not exctly that way, but in result a basic form that can be trimmed to fit by hand afterwards.
OK.
Yes !
Please consider donating that to Lazarus :)
If you do, here some ideas:
- Allow both grid/detail form.
- Let the user control to some extent the kind of control that is generated.
- Having the ability to specify lookup controls for foreign key fields are important. That may include creating a new dataset that fetches data from the referenced table.
I have created such a wizard for Delphi (closed source) and it really helps creating forms very quickly. Having this available in Lazarus would be a real asset.
Michael.
I see. I'm thinking about a programm that: - opens a database - generates form and source…
Marc Santhoff wroteIf you ever used the "Database Form Wizard/Assistant" of Openoffice you know what I want. Not exctly that way, but in result a basic form that can be trimmed to fit by hand afterwards.
I've never tried that.... but closer to home, Delphi IDE has something similar built-in (if we are talking about the same thing). I don't know if Lazarus has that.
I don't use TDataset, so might get the terminology wrong, so bare with me. In Delphi you can hook up a TDataset to a database table. Then view the TFields of that dataset. Drag those fields and drop them on the Form Designer. The form Design will then automatically insert a TLabel and appropriate DB-aware component, and hook that up to the TDataset. You can use multi-select and drag all remember using this back in Delphi 7 days to knock out prototype applications, but that was also around the time I stopped using TDataset and DB-aware components.
Like I mentioned, I don't know if Lazarus supports that - I would be surprised if it doesn't. Lazarus has many hidden features.
Regards,
- Graeme -
Yes ! Please consider donating that to Lazarus :) If you do, here some ideas: - Allow…
I thought about it, could be a good idea to get help.
If you do, here some ideas: - Allow both grid/detail form.
Try the Wizard of Openoffice, the third (or so) step let's the user switch between
- grid
- label above input field
- label in front of input field
- flating left to right, top to bottom (I'm not interested in this)
- Let the user control to some extent the kind of control that is generated.
See mapping above. I was thinking about a type->component list to use at generation time.
- Having the ability to specify lookup controls for foreign key fields are important. That may include creating a new dataset that fetches data from the referenced table.
I know, that's what e.g. Butler (java, on sourceforge) does. Not sure if this is too much work for a first start.
I have created such a wizard for Delphi (closed source) and it really helps creating forms very quickly. Having this available in Lazarus would be a real asset.
To reduce workload my idea is to have a standalone program. This saves me from learning Lazarus' internals and wizard API. Maybe someone else could take this task somewhen.
Currently I'm only in a pre-planning phase, my goal know is to check how much work this would be, because it's a spare time effort.
[I knew I would open a can of worms ;)]
Marc Santhoff wrote- flating left to right, top to bottom (I'm not interested in this)
floating
Currently I'm only in a pre-planning phase, my goal know is to check how
now
Marc Santhoff wrotefloating
Bells ringing "Firemonkey" :-) ?
-Michael
I've never tried that.... but closer to home, Delphi IDE has something similar built-in…
On 06/04/2014 21:34, Graeme Geldenhuys wrote:
<snip>
I don't use TDataset, so might get the terminology wrong, so bare with me.
I know summer is theoretically coming to the UK & The Netherlands, but this may be going too far ;)
Apart from that, having some kind of wizard that provides this functionality would be nice, yes.
Reinier Olislagers wroteI know summer is theoretically coming to the UK & The Netherlands, but this may be going too far ;)
Oops, minor typo - with a totally different outcome! :-D
Regards,
- Graeme -
<snip> I know summer is theoretically coming to the UK & The Netherlands, but this may be…
Reinier Olislagers wroteApart from that, having some kind of wizard that provides this functionality would be nice, yes.
I just tested with Lazarus. That functionality I describe with Delphi, doesn't work in Lazarus IDE.
Regards,
- Graeme -