Passer une procédure en paramètre ?
J'aimerais transmettre ma procedure AfficherProduit à ma méthode InitNouveauBouton, mais je n'y arrive pas...
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
procedure TfraChoix.AfficherProduit(Sender: TObject);
var
frmReception: TfrmReception;
begin
frmReception := TfrmReception.Create(Self, TOutlookButton(Sender).Tag);
try
frmReception.ShowModal
finally
frmReception.Release;
end;
end; |
Code:
1 2 3 4 5 6
|
constructor TfraChoix.Create(AOwner: TComponent);
begin
inherited;
FDataOutlookBar.InitNouveauBouton(AfficherProduit);
end; |
Code:
1 2 3 4 5
| procedure TDataOutlookBar.InitNouveauBouton(...???? );
begin
obbBouton := TOutlookButton.Create(FOutlookBar);
obbBouton.OnClick := AfficherProduit;
end; |
Merci d'avance !