Drawing on a DataModule in Delphi

做~自己de王妃 提交于 2019-12-08 15:56:16

问题


I wonder how difficult it would be to be able to have a custom background or be able to draw on the datamodule canvas somehow so that the relationships of all the datasets can be nicely represented with arrows and stuff. Way back in Delphi 7 or so I seem to remember some sort of datamodule designer which has disappeared (I always found it annoying anyway).

Does anyone know if this is possible through some sort of IDE plugin or something?


回答1:


TDataModule is a direct descendant of TComponent, and as such, it doens't have a Canvas or any such painting provisioned in it. As is, there is no way to draw or paint on it.

It is conceivable that you could create a descendent that has a TCanvas, but you'd have to really hack into the IDE to get it to be drawn on at design-time. It is an interesting idea, however.

There used to be a "Diagram" tab on the designer for Datamodules. It did have the ability to put notes, boxes with text, and data relations. It was not very understood or used, and the feature was dropped, I guess. (Before my time at CodeGear...)




回答2:


Or, you may change the datamodule to a form. Leave it visible during development, for testing, documentation and debugging; and turn it it invisible for production. On the form you may put a visio viewer component and some datagrids, accessed thru a tab rack, for quick browsing of the data.




回答3:


I believe that some way to organize the components in visible groups on screen could be nice... I have a report DM which have tons of datasets, dataset providers and Rave DataSources (circa 40 components).... If I could create some groups to differentiate which is used in what report.

But this in DM designer itself, not on a separate drawing space...



来源:https://stackoverflow.com/questions/1056472/drawing-on-a-datamodule-in-delphi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!