Why don't you want to use the same components at design-time?

----- Original Message ----- 
From: Carl Reynolds <[EMAIL PROTECTED]>
To: Multiple recipients of list offtopic <[EMAIL PROTECTED]>
Sent: Thursday, September 23, 1999 9:29 AM
Subject: [DUG-OFFTOPIC]: DELPHI WISH LIST - subclass form components


> What I'd like to see:
> 
> The ability to subclass components on the form at runtime.  No mucking
> about with the Tag property required.  Something like
> 
> type
>   TMyButton = class(TButton)
>   public
>     constructor Create(AOwner: TComponent); override;
>     procedure SetButtonStyle(ADefault: boolean); override;
>   end;
> 
>   TForm1 = class(TForm)
>     Button1: TButton as TMyButton;
>         // At design time, creates a TButton on the form, but 
>         // the unit compiles as if Button1 was a TMyButton.
>         // At runtime, creates a TMyButton.
>     procedure Button1Click(Sender: TObject);
>   private
>     { Private declarations }
>   public
>     { Public declarations }
>   end;
> 
> implementation
> 
> {$R *.DFM}
> ...
> 
> There is a question of which way you choose to go at load time - whether
> to set the inherited TButton properties of Button1 from the form
> settings (which would always succeed), or to attempt to set the
> TMyButton properties (my preference: it's probably more useful).  Each
> way would dictate a different approach to coding.
> 
> Comments?
> 
> Carl Reynolds                      Ph: +64-9-4154790
> CJN Technologies Ltd.             Fax: +64-9-4154791
> [EMAIL PROTECTED]                DDI: +64-9-4154795
> PO Box 302-278, North Harbour, Auckland, New Zealand
> 12 Piermark Drive, North Harbour Estate, Auckland, NZ
> Visit our website at http://www.cjntech.co.nz/
> 
> > ----------------------------------------------------------------------
> > -----
> >   New Zealand Delphi Users group - Offtopic List -
> > [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> 

---------------------------------------------------------------------------
  New Zealand Delphi Users group - Offtopic List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to