[Lazarus] Change the default name of an event handler

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Aug 1 23:20:28 CEST 2012


On Mon, 30 Jul 2012 08:54:00 +0200
Yann Bat <batyann811 at gmail.com> wrote:

> Don't no if it's because of my poor english or because of my questions are
> stupid but I didn't get much answers... :-(
> 
> How can I change the default name from DataModuleCreate to ZModuleCreate ?
> >
> 
> I suppose that the default name of an event handler is built from the name
> of the class that introduced the event so may be there is no simple way to
> change that...

The default component name is fetched from the
TProjectFileDescriptor.DefaultResourceName.


> > When I create a new TZModule it's small. Can I change the default size of
> > newly created TZModule  ?
 >
> 
> I found that this can be done overriding Create to set a value to
> DesignSize.
> 
> constructor TZModule.Create(TheOwner: TComponent);
> var
>   Size : TPoint;
> begin
>   inherited Create(TheOwner);
> 
>   Size.X := 320;
>   Size.Y := 200;
>   DesignSize := Size;
> end;
> 
> May this can be done in the default constructor of TDataModule ? Without
> that the window representing a newly created TDataModule in the IDE is so
> small that it needs manual resizing before any use.

Yes. Feel free to propose a change to the FPC bug tracker.
I increased the minimum size in the IDE for TDataModule to 150x150.

Mattias




More information about the Lazarus mailing list