![]() |
#1
|
|||
|
|||
![]()
I have A connection object derived from TObject that is key in a descendant object.
I want to combine this connection object to TComponent Example :- HTML Code:
TCon = class(TObject) protected FActive: Boolean; function GetActive: Boolean; virtual; abstract; procedure SetActive(const Value: Boolean); virtual; abstract; Function GetDataPostion(RecPos, Size: Integer): Pointer; virtual; abstract; Published property Active: Boolean read GetActive write SetActive default False; End; I want to now build a TComponent descendant that recognises TCon Its got to look like a descendant of TCon so other added objects can see this descendant object is a TCon descendant. I thought may be I should make my rather first major object Component too. Or HTML Code:
MyMajorComponet = class(TComponent, TCon) FCon: TCon; // is this needed or incorrect? FActive: Boolean; function GetActive: Boolean; override; procedure SetActive(const Value: Boolean); override; Function GetDataPostion(RecPos, Size: Integer): Pointer; override; Published property Active: Boolean read GetActive write SetActive default False; End; MyMajorComponet.function GetActive: Boolean; Begin ................. end; MyMajorComponet.procedure SetActive(const Value: Boolean); Begin ............. end; MyMajorComponet.Function GetDataPostion(RecPos, Size: Integer): Pointer; Begin ................ end; |
#2
|
|||
|
|||
![]() Code:
MyMajorComponet = class(TCon) FActive: Boolean; function GetActive: Boolean; override; procedure SetActive(const Value: Boolean); override; Function GetDataPostion(RecPos, Size: Integer): Pointer; override; Published property Active: Boolean read GetActive write SetActive default False; End; MyMajorComponet.function GetActive: Boolean; Begin ................. end; MyMajorComponet.procedure SetActive(const Value: Boolean); Begin ............. end; MyMajorComponet.Function GetDataPostion(RecPos, Size: Integer): Pointer; Begin ................ end; |
![]() |
Thread Tools | |
Display Modes | |
|
|