Autor Beitrag
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 24.01.11 11:12 
Hallo,

ich benutze einen Eventlistener, der ähnlich wie in Java arbeitet. Dafür habe ich eine Collection definiert, die dann auch im Objektinspektor sichtbar und editierbar ist. Das heißt ich kann jetzt mehrere Ereignisprozeduren oder -objekte einem Event hinzufügen.

Jetzt steht das natürlich auf der Seite Eigenschaften statt Ereignisse im Objektinspektor. Die Frage ist ganz einfach: Gibt es eine Möglichkeit solche Sachen explizit auf die Seite der Ereignisse zu bekommen?

Vielen Dank,
schönen Gruß,
Sebastian
Tankard
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Administrator
Beiträge: 217
Erhaltene Danke: 96



BeitragVerfasst: Mo 24.01.11 13:54 
hi
schon lange her, aber wenn du die sachen mit TNotifyEvent deklariert hast, landen die eigentlich automatisch auf der ereignissseite.

gruss
tankard

ausblenden volle Höhe Delphi-Quelltext
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:
30:
31:
32:
33:
34:
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TComponentXYZ = class(TComponent)
  private
    { Private declarations }
    FBeforeConnect: TNotifyEvent;

  public
    { Public declarations }
  published
  property
    BeforeConnect: TNotifyEvent
      read FBeforeConnect write FBeforeConnect;

  end;

implementation

procedure Register;
begin
  RegisterComponents('Component', [TComponentXYZ]);
end;

initialization
Register;

end.
jaenicke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 24.01.11 14:55 
Wenn ich da eine procedure of object draus mache, auch. Aber es geht ja gerade darum, dass es sich um ein Objekt handelt. Dieses benutzt wie gesagt eine Liste von Handlern, so wie bei Java.
Tilman
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1405
Erhaltene Danke: 51

Win 7, Android
Turbo Delphi, Eclipse
BeitragVerfasst: Mo 24.01.11 15:07 
Ich glaube wenn das Object von TComponent abgeleitet ist, dann wird es auf beiden Seiten angezeigt (siehe TPopupMenu).

_________________
Bringe einen Menschen zum grübeln, dann kannst du heimlich seinen Reis essen.
(Koreanisches Sprichwort)
jaenicke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 24.01.11 15:15 
Stimmt, hmm, eigentlich muss das in diesem Fall von TCollection abgeleitet sein, damit Delphi das automatisch als Liste anzeigt. Aber vielleicht kann ich das irgendwie basteln. Danke.

Trotzdem wäre es mir natürlich lieber, wenn es direkt ginge.