问题描述
很久以前,我们使用Delphi 6.我们的问题是,Delphi在DFM方面存在两个问题:
We used Delphi 6 long times ago. Our problem, that Delphi have two problems with DFMs:
1.)当某些链接的资源(如DataSet)将被删除时,Delphi常常会忘记询问您某些资源已链接,您需要重定向...".当实际的表单未添加到项目中或未打开时,就会发生这种情况.
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.)当我们仅打开DFM并且仅看到某些东西时,可以更改它(活动的TabSheet,窗体位置).然后,Delphi会自动保存表单-有时会删除链接.另一个与此有关的问题是我们使用了SVN,而SVN可以检测到这些更改...
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...
我们认为我们将DFM文件更改为只读,但这也可能会阻止SVN的使用...
We thought that we change DFM files to read only, but this can prevent the usage of SVN too...
所以有人请帮助我们:为Delphi提供一些扩展名(例如gexpert),该扩展名可以锁定DFM以避免更改,还有其他工具可以查看数据集是否以其他形式使用?
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?
推荐答案
您有点在Delphi上作弊.它是专门用来管理双重性* .pas和* .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).
如果要手动干预,则必须知道自己在做什么,并且要非常小心.除了在专用部分之前编辑表单代码部分外,您不应摆弄dfm内部内容.
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.
当我必须手动编辑dfm时,我要执行的操作是确保未在delphi中以任何方式打开它(请注意表单继承),然后在另一个编辑器中对其进行编辑.同样,当我重新签入pas/dfm时,我会对dfm进行了比较以确保它没有发生任何问题.
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.
这篇关于Delphi:如何锁定dfm-s使其不变...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!