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
application/ms-tnef