Delphi:如何锁定 dfm-s 使其不改变...?

发布于 2024-09-02 15:11:53 字数 405 浏览 1 评论 0原文

我们很久以前就使用过Delphi 6。我们的问题是,Delphi 在 DFM 方面存在两个问题:

1.) 当某些链接资源(如DataSet)将被删除时,Delphi很多时候忘记询问您“某些资源已链接,您需要重定向...”。当实际表单未添加到项目中或未打开时,就会发生这种情况。

2.) 当我们只打开DFM,并且只看到一些东西时,我们可以改变它(活动TabSheet,表单位置)。 然后 Delphi 自动保存表单 - 有时它会删除链接。 另一个问题是我们使用了 SVN,并且 SVN 检测到这些更改...

我们认为我们将 DFM 文件更改为只读,但这也会阻止 SVN 的使用...

所以有人请帮助我们:有 Delphi 一些扩展(如 gexpert)可以锁定 DFM 以避免更改,以及其他一些工具来查看数据集是否以其他形式使用?

We used Delphi 6 long times ago. Our problem, that Delphi have two problems with DFMs:

1.)
When some linked resource (like DataSet) will removed, Delphi many times forget to ask you that "some of the resources are linked, you need to redirect...". This happens, when the actual form is not added to the project, or it is not opened.

2.)
When we only open the DFM, and only see some thing, may we change it (active TabSheet, form position).
Then Delphi auto save the form - and sometimes it drops the links.
Another problem with this that we used SVN, and SVN detect these changes...

We thought that we change DFM files to read only, but this can prevent the usage of SVN too...

So somebody please help us: have the Delphi some extension (like gexpert) that can lock the DFMs to avoid changes, and some other tool to see that dataset is used in other forms or not?

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

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

发布评论

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

评论(1

∝单色的世界 2024-09-09 15:11:53

你有点欺骗德尔福。它的构建是为了完全管理对偶性 *.pas 和 *.dfm,知道如何维护链接(并且通过表单继承,最好打开所有堆栈)。

如果你想手动干预,你必须知道自己在做什么,并且非常小心地去做。除了编辑私有部分之前的表单代码部分之外,您不应该在 dfm 内部摆弄更多的事情。

当我必须手动编辑 dfm 时,我要做的是确保它没有在 delphi 中以任何方式打开(注意表单继承),然后在另一个编辑器中编辑它。
另外,当我重新检查 pas/dfm 时,我会对 dfm 进行比较,以确保它没有发生任何问题。

You're kinda cheating on Delphi. It is built to manage the duality *.pas and *.dfm altogether, knowing how to maintain the links (and with form inheritance, it's better to have all the stack open).

If you want to manually interfere, you have to know what you are doing and do it very carefully. You're not supposed to fiddle with the dfm insides more than to edit the form code portion before the private section.

What I do when I have to edit the dfm manually is to make sure it's not open in any way in delphi (beware form inheritance) and then edit it in another editor.
Also when I check the pas/dfm back in, I do a diff on the dfm to make sure nothing bad happened to it.

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