[DUG] descending from TWebModule

David Brennan dugdavid at dbsolutions.co.nz
Thu Jun 9 12:57:12 NZST 2005


Phil,

 

It was actually commented in the uses clause of my sample: 

 

uses

  Classes, DsgnIntf,

  DmDesigner, // Contains TDataModuleDesignerCustomModule

  WctlForm; // Contains TWinControlCustomModule

 

So it should be in DmDesigner, but I'm using Delphi 5 and it is possible it
has been moved. You won't have source .pas files for these unfortunately.
You also won't be able to directly recompile them. Our unit which registers
these designers for our custom TDbbForm, TDbbDataModule etc is in a separate
design time only package which uses the DsnIDE50 package which contains the
compiled code for the design units like DmDesigner. I assume the Delphi 6
package would be called DsnIDE60 (or similar) but simply creating a package
with your register unit and compiling it should bring up a dialog to
automatically add the required packages.

 

As for what they are, yes, I believe the CustomModules and their associated
objects/units are all about bringing up the design time representation of
the Form/DataModule/Frame which is where you drag components around and set
their properties. If you don't register a CustomModule then the design time
representation doesn't work properly - for example any properties you have
added won't appear in the object inspector.

 

Disclaimer: Things might be slightly different in Delphi 6 with this stuff.

 

David.

 

  _____  

From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Phil Middlemiss
Sent: Thursday, 9 June 2005 12:28 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] descending from TWebModule

 

Dave, I can't find TDataModuleDesignerCustomModule anywhere - which unit is
it in? I'm using Delphi 6 which has DesignIntf, not DsgnIntf.

There is a TCustomModule in DesignEditors.pas, but if I try to use that then
DesignEditors wont compile since it requires Proxies.pas which is not
provided, and there is no dcu provided for DesignEditors either.
I'm not very familiar with the ToolsAPI classes so the help is much
appreciated. BTW, what actually *is* the "designer"? I am assuming that, for
the TForm for example, it is the representation of the TForm that lets you
manipulate components on it and interact with the ObjectInspector - is that
correct?

Cheers,
Phil.

David Brennan wrote: 

Phil,
 
Neither do TForm or TDataModule - they aren't meant to. TCustomModule is (to
my knowledge) a helper class used by DsgnIntf to provide the design time
interface used for Forms, DataModules, Frames, etc. 
 
TWebModule is a descendent of TDataModule. You should therefore be able to
use the standard TDataModuleDesignerCustomModule. That is:
 
 RegisterNoIcon([TPhilsWebModule]);
 RegisterCustomModule(TPhilsWebModule, TDataModuleDesignerCustomModule);
 
You could also make your own descendent of TDataModuleDesignerCustomModule
if you wanted but I doubt you actually want to change the designer
behaviour.
 
That should work fine unless TWebModules have a special designer (I don't
use them myself so I wouldn't know). If they do then you will need to try to
work out which unit contains the designer for TWebModule (which is a matter
of guessing since Delphi doesn't include the source code for most of these
design interface units). 
 
Unless of course I am misunderstanding what you are trying to do?
 
David.
 
-----Original Message-----
Unfortunately that didn't work since the TWebModule does not descend 
from TCustomModule.
 
Phil.
 
David Brennan wrote:
 
  

Phil,
 
....
 
 
procedure Register;
begin
 RegisterNoIcon([TDbbDataModule]);
 RegisterCustomModule(TDbbDataModule, TDataModuleDesignerCustomModule);
 RegisterNoIcon([TDbbForm]);
 RegisterCustomModule(TDbbForm, TDbbFormCustomModule);
 
 // Note: DON'T call RegisterNoIcon for TDbbFrame. This will disable copy
and
 // paste of TDbbFrame descendents and make it impossible to place a new
 // TDbbFrame descendent on a form.
 RegisterCustomModule(TDbbFrame, TDbbFrameCustomModule);
 
end;
 
 
...
 
 
 
    

_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
 
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
 
 
 
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20050609/b6c6fc7b/attachment-0001.html


More information about the Delphi mailing list