Title: Message
What about something like:
 
TMyControl = class(TCustomPanel)
private
  FControl : TWinControl; // owned and parented by TMyControl
  ...
public
  property BackgroundColor : TColor ...
  ... // manually re-declare and implement relevant TWinControl properties
end;
 
from which you could subclass TMyEdit, TMyListBox etc.
 
 
-----Original Message-----
From: Donovan J. Edye [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 31 October 2002 4:02 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: OOP Design Question....

G'Day,

I want to add some special functionality to some existing VCL controls. As an example I want to change the background colour of the control when it changes. (For my TEdit when the user types in the control, For TListBox when the item index changes etc.)

So I will be inheriting my classes from say TEdit and TListBox. Has anyone got any suggestions on how I could structure things so that the additional functionality (changing bg colour for eg) can be kept in once place and not have to be modified for each custom control.

Although both TEdit and TListBox have a common ancestor TWinControl I do not want to implement from there as I would have to implement TEdit control functionality. If I had a component that descended from TGraphicsControl then I would have an even bigger problem as I would have to go up to TComponent.

The only possible solution I can see at the moment is having this additional functionality in a seperate helper class. Anybody else got any other ideas?

TIA

-- Donovan
----------------------------------------------------------------------
Donovan J. Edye [
www.edye.wattle.id.au]
Namadgi Systems [
www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': "...Uh Oh...."
----------------------------------------------------------------------
GXExplorer [
http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
----------------------------------------------------------------------


Attention: The information contained in this message and/or attachments from AgResearch Limited is intended only for the persons or entities to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipients is prohibited by AgResearch Limited. If you have received this message in error, please notify the sender immediately.


Reply via email to