Alexsander Rosa wrote:
I think it would be nice if we could share a project between the two
IDE's, including the forms. Everytime I need to mantain the "original"
Delphi project, i know that my "under conversion" Lazarus project is
getting more and more obsolete. More over, a lot of
properties/components had to be removed just because they are not
compatible. I can IFDEF the PAS files, but there's nothing I can do
about LFM/DFM files.

I think some changes could be made to make it possible; if someone can
point other problems I did not mention, please add to the list. The
PAS files are not problem: both IDE use them and IFDEF's work fine.
The changes would be:

- allow dpr/dfm extensions (instead of lpr/lfm); with IFDEFs it's
possible to share a project source (dpr), and we could figure a way to
share forms (see later);

- make Lazarus write into dof files (along with lpi files), so the
changes made in Lazarus would be replicated in Delphi - the contrary
would not work, but it's a minor problem;

The DFM/LFM files have no IFDEF counterpart, but a workaround could be
devised. We could add to ALL forms a invisible ComboBox (or Memo, or
any component that have a TStringList, preferrably the one with the
smaller footprint). The component would have a specific weird name,
like cbx_Lazarus_Specific_Data or something like that.

The TStringList would have a list of strings that would be interpreted
by Lazarus only; in Delphi it would be almost ignored, as it's
invisible and could be small and in a position that would not
interfere with the rest of the form. Its strings would be added to the
binary, but that's a minor problem.

Lazarus' form processor would need a pre-processor that would
interpret the contents of the strings and generate a new, in-memory,
LFM file. The syntax of the strings would allow to do basically the
following:

- ADD to a $component a $property with a given $value; this would
simply generate a line in the format "Property = Value" inside the
correspondent "object" section. This would be automatically added for
Lazarus-only properties in components that both Delphi and Lazarus
have. How the IDE would know if a given property is Lazarus-only? I do
not know.

- DEL a $property from a $component; it's the opposite of the ADD
directive, it would remove a Delphi-only property from a given
component. When opening a Delphi form and some property is unknown,
instead of just igore/abort we could "comment out" them.

- ADDOBJ/ENDADD; it would enclose an entire Lazarus-only Component;
the correspondent PAS file would need to have the appropriate IFDEF's.
Also could be automatically added, assuming the IDE can know when to
do this.

- DELOBJ $object; it would remove an entire Delphi-only Component; the
DELOBJ could be inserted automatically when opening a DFM file. The
correspondent PAS file would need to have the appropriate IFDEF's.

I know I may be a dreamer here, and I am fully aware that it would be
a "dirty hack", but during the last months I've been doing tests and
conversions between Delphi and Lazarus and this kind of thing would be
great. I'm asking for comments on this.

--
Atenciosamente,

Alexsander da Rosa

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


CrossFPC is already able to eat dfm files. This should be included into Lazarus.

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to