如何在 Delphi 6 - 2007 中保持表单和框架的可编译性?

发布于 2024-08-19 13:30:03 字数 374 浏览 2 评论 0原文

我们最近将长期运行的 Delphi 项目转换为开源项目。许多人已经贡献了补丁,这很好,但不幸的是,使用 Delphi 2006(及更高版本)保存时的表单和框架在 .dfm 中包含旧版本无法处理的新属性。 IDE 可以非常优雅地处理表单(“忽略属性?”),但框架是在运行时加载的,并会导致错误。就我而言,这不是一个选择。

我现在手动从 .dmf 文件中删除了这些属性,但我真的想知道是否有更优雅的解决方案。没有办法从新的 IDE 中以向后兼容的格式保存,不是吗?是否有现有工具可以从 .dfm 中去除不支持的属性?我还缺少其他优雅的解决方案吗?

通常,对于商业项目,我只是将项目升级到适用的最新版本...但由于这是开源的,我真的不想放松那些仍在使用 Delphi 7 的开发人员。这包括我自己, 实际上。

We recently converted our long-running Delphi project to Open Source. Multiple people have contributed patches already, which is great, but unfortunately forms and frames when saved with Delphi 2006 (and later) contain new properties in the .dfm that are not handled by older versions. Forms are handled quite gracefully by the IDE ("ignore propery?"), but frames are loaded at runtime and result in errors. Not an option, as far as I'm concerned.

I now removed those properties from the .dmf files by hand, but I am really wondering if there is a more elegant solution. There is no way to save in a backwards compatible format from the new IDE's, is there? Are there existing tools to strip the nonsupported properties from the .dfm's ? Any other elegant solution I am missing?

Normally, with a commercial project, I'd just upgrade the project to the most recent version applicable... but as this is open source I really don't want to loose out on those developers still working on Delphi 7. That includes myself, actually.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风吹过旳痕迹 2024-08-26 13:30:03

JEDI JVCL 项目使用一个小实用程序 dc.exe(delphi 清理器)和 DFM 中的属性列表,这些属性旧版本的 delphi 中不存在,我的包含以下文本:

*.PopupMode
*.PopupParent
*.ExplicitLeft
*.ExplicitTop
*.ExplicitWidth
*.ExplicitHeight
*.BevelKind
*.BufferDocument
*.DoubleBuffered
*.ParentDoubleBuffered
*.DisableHyperlinks
*.AlwaysEnquoteFloats
*.PixelsPerInch

我从批处理文件运行此 dc.exe 实用程序,该实用程序在提交之前清理我的 dfms
改变到颠覆。我的批处理文件中的语法是:

dc.exe -s -fd10.txt *.dfm -i

您可以在以下位置获取我的东西:

http://sites.google.com/site/warrenpostma/files

The JEDI JVCL project uses a little utility dc.exe (delphi cleaner) and a list of properties in DFMs that are not present in older versions of delphi, mine contains the following text:

*.PopupMode
*.PopupParent
*.ExplicitLeft
*.ExplicitTop
*.ExplicitWidth
*.ExplicitHeight
*.BevelKind
*.BufferDocument
*.DoubleBuffered
*.ParentDoubleBuffered
*.DisableHyperlinks
*.AlwaysEnquoteFloats
*.PixelsPerInch

I run this dc.exe utility from a batch file which cleans my dfms before I commit
changes to subversion. The syntax in my batch file for this is:

dc.exe -s -fd10.txt *.dfm -i

You can grab my stuff at:

http://sites.google.com/site/warrenpostma/files
橪书 2024-08-26 13:30:03

您可以尝试 Andy 的 DFMCheck。它可以自动打开和关闭项目中的所有表单和框架,这使得 IDE 删除未知属性(如 Marco 写道)。

You can try Andy's DFMCheck. It can automatically open and close all forms and frames in a project, which makes the IDE remove unknown properties (as Marco wrote).

风铃鹿 2024-08-26 13:30:03

好吧,为了完整起见:

在支持的最旧的 Delphi 中打开 dfms,让它删除所有未知属性,更改属性并保存。

就您的目的而言,沃伦的解决方案更好,但它可以是一种解决方法。当我们使用双 D7-D2006 时,我曾经这样做过一段时间。

Well, for sake of completeness:

Open the dfms in the oldest Delphi supported, let it remove all unknown properties, change a property and save.

For your purposes, Warren's solution is better, but it can be a workaround. I did it for a while when we were dual D7-D2006ing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文