程序包中的帧继承和重复文件 [英] Frame inheritance and duplicate files in packages

查看:138
本文介绍了程序包中的帧继承和重复文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用TFrames和ModelMaker开发了许多组件 - 我发现视觉设计/开发+继承+ ModelMaker的组合非常引人注目。然后我注册这些TFrame后代,一个注册单元,并且它们成为从那里的基于调色板的组件。我正在使用Delphi 2007。

I have been developing a number of components using TFrames and ModelMaker -- I've found the combination of visual design/development + inheritance + ModelMaker to be very compelling. I then register these TFrame descendants w/a registration unit, and they become full-fledges palette-based components from there. I'm using Delphi 2007.

在我学习一下这个过程的小小的阻碍之前,我发现一些我遇到的TFrame问题后代流不正确(通常以IDE中的形式出现,而不是框架)可以通过引入我自己的TBaseFrame类来完全消除,该类从TFrame继承,没有chanegs,然后使用THAT作为基类来开发组件(添加方法,属性等)。如果我将属性和方法等添加到直接从TFrame继承的类/框架中,则dfm文件流经常会被困惑。

Early in my learning about the little "snags" of this process, I found that a number of the problems I would run into with TFrame descendants streaming incorrectly (often appearing as forms in the IDE, rather than frames) could be completely eliminated by introducing my own "TBaseFrame" class which inherits from TFrame with no chanegs, and then use THAT as the base class to develop components from (adding methods, properties, etc). If I added properties and methods, etc. to a class/frame inheriting directly from TFrame, the dfm file streaming would often get confused.

所以,总体来说,一旦我得到了扭结了。

So, overall it's worked great, once I got the kinks worked out.

但是,昨天我遇到了一个新问题:

Yesterday, though, I ran into a new problem:

我将所得到的组件安装在包装集合中,按照有意义的方式进行分组(即App 1的所有面板都在一个包中,App 2的查看器在另一个中)。

I install the resulting components in package sets, grouped in ways that make sense (i.e. all of the "panels" for App 1 are in one package, a number of "viewers" for App 2 are in another, etc).

如果包装中未包含TBaseFrame类,则继承的TFrame-descendant组件将不会在IDE中加载。但是,如果我将TBaseFrame添加到程序包中,那么当Delphi报表中有多个程序包中有相同的源文件PAS文件时,我遇到了Delphi的冲突。

If the TBaseFrame class is not included in the package, the inheriting TFrame-descendant component will not load in the IDE. BUT, if I add TBaseFrame to the package, I run into the conflict Delphi reports when it has the same source PAS file in more than one package.

可以把我所有的框架=基础的组件放在一个巨大的包中,但我真的很喜欢不要,因为我可以清楚地看到,随着时间的推移,这将会变得太大/不合时宜我打算开发多少套。有没有其他方法可以解决这个冲突?

I could put ALL of my frame=based components into one giant package, but I'd really, really prefer not to, as I can clearly see that will get too large / out of hand over time, given the nature of how many sets I plan on developing. Is there any other way to resolve this conflict?

更新 - 有一个把戏让它正常工作的技巧 - 请务必阅读下面的意见。

Update -- there is a trick to getting this to work "properly" -- be sure to read the comments below.

推荐答案

您是否尝试将您的TBaseFrame放在一个单独的包中,所有其他包裹需要?

Have you tried to put your TBaseFrame in one separate package that would be "required" by all other packages?

这篇关于程序包中的帧继承和重复文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆