la Procedure Notification
Bonjour !!
J'ai un petit probleme
j'ai creer 2 classes, une qui descent de TPersistent(TOptionQuery) et l'autre de TMyQuery(TMyBaseQuery)
j'ai declarer une instance de la premiere dans la deuxieme
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
type
TOptionQuery = class(TPersistent)
.....
published
.....
property CxEditor : TCxDBTextEditor read CxEditor write SetCxEditor ;
end;
TMyBaseQuery= class(TMyQuery)
....
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
constructor Create(AOwner: TComponent);override;
Destructor Destroy; override;
procedure Notification()
published
property QOption: TOptionQuery read FQOption write FQOption;
end;
// cxEditor est un control de type TDBEdit
........
procedure TMyBaseQuery.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited Notification(AComponent,Operation);
if (Operation=opRemove) and (AComponent=QOption.CxEditor) then
QOption.CxEditor := nil;
end; |
maintenant !! quand je pose le composant TmybaseQuery sur la forme et je relie sa properiete QOption.CxEditor a un composant de type TCxDBEditor (cxEdit1 )tout marche bien !!! mais le probleme survient lorsque je supprime ce dernier(cxEdit1),l'IDE delphi genere alors des messages d'erruer ...
et pourtant j'ai reecrit la procedure Notification .
que dois-je faire ...
merci pour votre aide