Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-12

Regarding "Proting the form editor"

19 messages · 8 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael A. Hess
to Kevin Berry: I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable…
Sebastian Guenther wrote
I don't know if you already noticed this, but I have implemented the DFM reading and writing routines to FCL several weeks ago. This should be a good starting point...

I remember you mentioning it but I assumed we would be using that for the conversion type stuff and not for actually reading and using Delphi DFM forms. I hadn't looked at it but does what you added work with the binary version of DFM, text version, or both?

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Kevin Berry: I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable…
Kevin Berry wrote
Although it is a Text format it won't be interchangeable without using some conversion routine (as you've stated). I always prefer to be able to transfer files directly without doing any conversion though :-)

I don't think we have every planned on the LCL being able to read a Delphi DFM exactly as it is. We always assumed that you would need to run it through some sort of converter.

It will actually be better to use XML since then any kind of tool that can create/read/edit XML would be able to be used to modify the LFM files. So even though the new Delphi format is text the structure is still specific to Delphi and of not much use to any other application.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Kevin Berry: I hope you don't mind me sharing my opinions seeing as though I'm not doing any coding…
Kevin Berry wrote
Wouldn't it be a good idea to support the same format as Delphi 5 - ie. Text.

Interesting! I haven't gotten around to purchasing a copy of Delphi 5 yet so I wasn't aware that they had gone to a text format.

XML sounds intriguing though... That may work very well, but I'm in favour of "compatible" formats to begin with.

Well XML IS a text format. It is just a structured format. You will still be able to go in a edit files with any standard text editor you just need to be sure to adhere to the structure of the code which I am sure you must with the Delphi DFM files as well.

It will be a simple matter to convert any Delphi DFM to our XML based LFM file. :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller

Sam,
I believe the notepad, button, etc forms are working to a point that you could start converting the form editor. We still have issues on the file we will be storing the form info in and what the format of it wil be. I believe we are using XML but it's really never been finalized. I feel starting with straight text would be fine for now but eventually would go to a binary or XML format.

I would love to see the form editor started, but I also understand that we are quite far from getting anything real working....

Shane

>> 12/06/99 09:11AM >>>
Show quoted text 16 lines
-----Original Message----- From: Shane Miller Sent: Monday, December 06, 1999 01:35 PM To: Subject: Re: [lazarus] Setting callbacks I have no problem moving the SetCallback into another function and having it called at a "more appropriate" time. However, we have made some changes (createwnd, interfaceobject) that we shouldn't have made because we are still recovering from these. Lets get something (ANYTHING) up and running as is and then make these changes. The events work now, let's geet the editor working and start developing the IDE. I would hate to make changes that would delay the development of the editor, which we need badly.

OK; Once CreateWnd is working properly and a few basic controls (button, notepad form) I am ready to start porting the form editor.

Sam

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Kevin,

First, feel free to jump in and add your opinion. I prefer code, but opinions are good too. :-)

I agree. I would like to see a compatable file for the DFM's. Maybe we could let the user select what type of output they can generate. Either way, I say lets generate text first, then worry about it later.

Shane

>> 12/06/99 11:48AM >>>

Hi Shane,

I hope you don't mind me sharing my opinions seeing as though I'm not doing any coding yet...

--- Shane Miller wrote 9 lines
Sam, I believe the notepad, button, etc forms are working to a point that you could start converting the form editor. We still have issues on the file we will be storing the form info in and what the format of it wil be. I believe we are using XML but it's really never been finalized. I feel starting with straight text would be fine for now but eventually would go to a binary or XML format.

Wouldn't it be a good idea to support the same format as Delphi 5 - ie. Text. The advantages of a plain text format are that it is very easy to make manual changes using any external tools. I've found this feature of Delphi 5 very good. Of course earlier
versions of Delphi (1-4) used a binary format and
therefore you couldn't use external tools to edit the DFM files, but you could still view them as text in the IDE. XML sounds intriguing though... That may work very well, but I'm in favour of "compatible"
formats to begin with. The reason Inprise went with text format after all this time is because it was
specially requested by third parties I believe...

Cheers,
Kevin.
__________________________________________________ Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one place. Yahoo! Shopping: http://shopping.yahoo.com

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Kevin Berry

Hi Shane,

I hope you don't mind me sharing my opinions seeing as though I'm not doing any coding yet...

--- Shane Miller wrote 9 lines
Sam, I believe the notepad, button, etc forms are working to a point that you could start converting the form editor. We still have issues on the file we will be storing the form info in and what the format of it wil be. I believe we are using XML but it's really never been finalized. I feel starting with straight text would be fine for now but eventually would go to a binary or XML format.

Wouldn't it be a good idea to support the same format as Delphi 5 - ie. Text. The advantages of a plain text format are that it is very easy to make manual changes using any external tools. I've found this feature of Delphi 5 very good. Of course earlier
versions of Delphi (1-4) used a binary format and
therefore you couldn't use external tools to edit the DFM files, but you could still view them as text in the IDE. XML sounds intriguing though... That may work very well, but I'm in favour of "compatible"
formats to begin with. The reason Inprise went with text format after all this time is because it was
specially requested by third parties I believe...

Cheers,
Kevin.
__________________________________________________ Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one place. Yahoo! Shopping: http://shopping.yahoo.com

Reply by email

Kevin Berry

I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable without using some conversion routine (as you've stated). I always
prefer to be able to transfer files directly without doing any conversion though :-)

The way a DFM file (ASCII) is structured it fits very well with the XML format because it is a tree-like structure already. It would be slightly more
efficient in terms of space though (no real problem there). Altough I suppose instead of the "begin"'s and "end"'s you'd have <TAGSTART></TAGEND> everywhere, so they probably would be very similar in terms of size...

I think I'd be happy with either format of course... Better than a binary format!

Cheers,
Kevin.

--- "Michael A. Hess" wrote

[...snip...]

Show quoted text 5 lines
Interesting! I haven't gotten around to purchasing a copy of Delphi 5 yet so I wasn't aware that they had gone to a text format.

[...snip...]

Show quoted text 11 lines
Well XML IS a text format. It is just a structured format. You will still be able to go in a edit files with any standard text editor you just need to be sure to adhere to the structure of the code which I am sure you must with the Delphi DFM files as well. It will be a simple matter to convert any Delphi DFM to our XML based LFM file. :-)

__________________________________________________ Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one place. Yahoo! Shopping: http://shopping.yahoo.com

Reply by email

Michael A. Hess
to Kevin Berry
Sebastian Guenther wrote 13 lines
> I hadn't looked at it but does what you added work with the > binary version of DFM, text version, or both? It can convert DFM->text and text->DFM. Why I mentioned this stuff is because it should be really simple to adapt the sources to create DFM->XML converters and so on. I'm talking about the implementations of the following procedures: procedure ObjectBinaryToText(Input, Output: TStream); procedure ObjectTextToBinary(Input, Output: TStream); procedure ObjectResourceToText(Input, Output: TStream); procedure ObjectTextToResource(Input, Output: TStream);

Yeah I realize that is what you meant. My question was with regard to the new Delphi text form of the DFM. As reported Delphi 5 saves DFM information as text now and not binary as before. Does the above routines take this into account? Since I haven't seen the new Delphi 5 text version of the DFM I can't say for sure whether the new text version matches the same output of the above routines. If it does then it is a mute point. If it is different then is it possible that we could make these routines read either the binary or text version and convert them to the same text output?

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Kevin Berry: I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable…
Sebastian Guenther wrote
Oh, okay. I don't know Delphi 5 but I will try to get the demo version running here within the next few days. Then I can check if the conversion code works or not.

According to Jeff the output from the binary to text is the same as the current method of storage in Delphi 5 so it is a mute point. We can write some form of converter for Delphi 5 and then use the binary to text convert for older Delphi version so that it matches Delphi 5 format and then convert them as well. Seems like we are all set on the front.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Samuel Liddicott
to Jeff Wormsley: As far as I can tell, they are the same. Jeff.
Show quoted text 15 lines
-----Original Message----- From: Jeff Wormsley Sent: Monday, December 06, 1999 10:00 PM To: Subject: Re: [lazarus] Regarding "Proting the form editor" On 12/06/99 at 4:46 PM Michael A. Hess wrote: >Since I haven't seen the new Delphi 5 >text version of the DFM I can't say for sure whether the new text >version matches the same output of the above routines. If it does then >it is a mute point. As far as I can tell, they are the same.

Some of the earlier Delphi releases were sensitive to locale settings when doing ObjectBinaryToText and back again. I think this is fixed - . is used exclusively as the decimal seperator in forms.

Sam

Reply by email

Samuel Liddicott
to Michael A. Hess: According to Jeff the output from the binary to text is the same as the current method of…
Show quoted text 18 lines
-----Original Message----- From: Michael A. Hess Sent: Monday, December 06, 1999 11:07 PM To: Subject: Re: [lazarus] Regarding "Proting the form editor" Sebastian Guenther wrote: > > Oh, okay. I don't know Delphi 5 but I will try to get the demo version > running here within the next few days. Then I can check if the > conversion code works or not. According to Jeff the output from the binary to text is the same as the current method of storage in Delphi 5 so it is a mute point. We can write some form of converter for Delphi 5 and then use the binary to text convert for older Delphi version so that it matches Delphi 5 format and then convert them as well. Seems like we are all set on the front.

Fedit can load and save text files as well as DFM anyway.

Sam

Reply by email

Jeffrey A. Wormsley
to Kevin Berry: I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable…
PM Michael A. Hess wrote 5 lines
According to Jeff the output from the binary to text is the same as the current method of storage in Delphi 5 so it is a mute point. We can write some form of converter for Delphi 5 and then use the binary to text convert for older Delphi version so that it matches Delphi 5 format and then convert them as well. Seems like we are all set on the front.

Probably best to wrap the conversion routines with a test for text vs binary. This should be easy enough, just open the dfm file, see if the first 5 bytes are 'object' and if so, load as text and convert to xml, if not, load as binary and convert to xml.

If I get a chance, I'll am one of my very rare free nights.

Jeff.

Reply by email

Sebastian Guenther
to Kevin Berry: I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable…
"Michael A. Hess" wrote 5 lines
According to Jeff the output from the binary to text is the same as the current method of storage in Delphi 5 so it is a mute point. We can write some form of converter for Delphi 5 and then use the binary to text convert for older Delphi version so that it matches Delphi 5 format and then convert them as well.

Yes; the most important fact is that we could do virtually anything now.

- Sebastian

Reply by email

Sebastian Guenther
to Kevin Berry: I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable…
"Michael A. Hess" wrote
I remember you mentioning it but I assumed we would be using that for the conversion type stuff and not for actually reading and using Delphi DFM forms.

of course

I hadn't looked at it but does what you added work with the binary version of DFM, text version, or both?

It can convert DFM->text and text->DFM. Why I mentioned this stuff is because it should be really simple to adapt the sources to create DFM->XML converters and so on.
I'm talking about the implementations of the following procedures:

  procedure ObjectBinaryToText(Input, Output: TStream);
  procedure ObjectTextToBinary(Input, Output: TStream);
  procedure ObjectResourceToText(Input, Output: TStream);
  procedure ObjectTextToResource(Input, Output: TStream);

They are defined in the Classes units.
The source can be found in fcl/inc/classes.inc

cu,
Sebastian

Reply by email

Sylvain Lamothe
to Kevin Berry: I'm aware of what XML is :-) Although it is a Text format it won't be interchangeable…
Show quoted text 13 lines
Sebastian Guenther wrote: > > Oh, okay. I don't know Delphi 5 but I will try to get the demo version > running here within the next few days. Then I can check if the > conversion code works or not. Michael A. Hess wrote: According to Jeff the output from the binary to text is the same as the current method of storage in Delphi 5 so it is a mute point. We can write some form of converter for Delphi 5 and then use the binary to text convert for older Delphi version so that it matches Delphi 5 format and then convert them as well. Seems like we are all set on the front.

I've been lurking for quite a while (since Megido) and i will give you a hand with coding after the holidays season. I'll get more free time then and i hope i could get Linux hook on to the net by then and it will give me the time to learn using the GTK.

In my opinion you don't need to do a converter for Delphi 5 since the version 5 support both DFM format i.e. Text and Binary. In the environment options
of Delphi 5 there's an option to for that purpose, so if someone want to port his app
from Delphi 5 to Lazarus the only thing he has to do is to set the dfm option to binary
and do a save all.

If you're interested, there's a freeware implementation with source in delphi of the SAX
parser (Simple Api Xml).

Sylvain

Reply by email