Search code examples
delphidatamodule

Drawing on a DataModule in Delphi


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?


Solution

  • 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...)