Einzelnen Beitrag anzeigen

NeoXan
(Gast)

n/a Beiträge
 
#1

OnClick bei Selfmade Class

  Alt 16. Feb 2004, 15:29
Delphi-Quellcode:
 
var
 Rondo : array[1..4 ] of TRondo;
...

Rondo[1].OnClick := Rondo[1].OnChoose;
Delphi-Quellcode:
type
  TRondo = class (TPanel)
  private
    Fx, Fy, Fr: single;
    Fcol: TColor;
  public
  procedure Init(xx,yy: integer; col:TColor);
  procedure Show;
  procedure OnChoose(Sender: TObject);

  published
  property x : single read Fx write Fx;
  property y : single read Fy write Fy;
  property r : single read Fr write Fr;
  property col : TColor read Fcol write Fcol;
end;

...

procedure TRondo.Show;
var b: Tcolor;
begin
 with frmMain.imgMain.Canvas do
  begin
   Brush.Color := color;
   Ellipse(Round(x-r),Round(y-r),Round(x+r),Round(y+r));
   Brush.Color := b;
  end;
end;

procedure TRondo.OnChoose(Sender: TObject);
begin
ShowMessage('ASF');
end;
...und wenn ich versuche meine Ellipse anzuklicken passiert nischts
  Mit Zitat antworten Zitat