Re: [Lazarus] lfm file format

2014-04-07 Thread Michael Schnell

On 04/06/2014 09:50 PM, Marc Santhoff wrote:


 floating


Bells ringing Firemonkey :-) ?

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-06 Thread Marc Santhoff
On So, 2014-04-06 at 03:23 +0200, Mattias Gaertner wrote:
 On Sun, 06 Apr 2014 00:49:45 +0200
 Marc Santhoff m.santh...@web.de wrote:
 
  On Sa, 2014-04-05 at 12:23 +0200, Mattias Gaertner wrote:
   On Sat, 05 Apr 2014 12:06:20 +0200
   Marc Santhoff m.santh...@web.de wrote:
   
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.
  
  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.
 
 Yes.
 
  
  Now I'm confused. When and how is XML used to store form descriptions?
 
 Some people use it. The IDE does not.

I see.

  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?

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.
 
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
  
  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?
 
 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.

OK.

-- 
Marc Santhoff m.santh...@web.de


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-06 Thread Michael Van Canneyt



On Sun, 6 Apr 2014, Marc Santhoff wrote:


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?


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.


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.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-06 Thread Marc Santhoff
On So, 2014-04-06 at 21:03 +0200, Michael Van Canneyt wrote:
 
 On Sun, 6 Apr 2014, Marc Santhoff wrote:
 
  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?
 
  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.
 
 Yes !
 
 Please consider donating that to Lazarus :)

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 m.santh...@web.de


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-06 Thread Graeme Geldenhuys
On 2014-04-06 19:53, Marc Santhoff wrote:
 
 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.

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 fields at once. I 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 -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-06 Thread Marc Santhoff
On So, 2014-04-06 at 21:37 +0200, 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 m.santh...@web.de


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] lfm file format

2014-04-05 Thread Marc Santhoff
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

-- 
Marc Santhoff m.santh...@web.de


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-05 Thread Mattias Gaertner
On Sat, 05 Apr 2014 12:06:20 +0200
Marc Santhoff m.santh...@web.de wrote:

 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

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-05 Thread Marc Santhoff
On Sa, 2014-04-05 at 12:23 +0200, Mattias Gaertner wrote:
 On Sat, 05 Apr 2014 12:06:20 +0200
 Marc Santhoff m.santh...@web.de wrote:
 
  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.

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.

  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

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?

-- 
Marc Santhoff m.santh...@web.de


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lfm file format

2014-04-05 Thread Mattias Gaertner
On Sun, 06 Apr 2014 00:49:45 +0200
Marc Santhoff m.santh...@web.de wrote:

 On Sa, 2014-04-05 at 12:23 +0200, Mattias Gaertner wrote:
  On Sat, 05 Apr 2014 12:06:20 +0200
  Marc Santhoff m.santh...@web.de wrote:
  
   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.
 
 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.

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?

 
   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
 
 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?

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

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus