AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Objekt Kommunikation

Ein Thema von peschai · begonnen am 2. Jul 2009 · letzter Beitrag vom 19. Okt 2009
Antwort Antwort
fajac

Registriert seit: 1. Jul 2009
60 Beiträge
 
#1

Re: Objekt Kommunikation

  Alt 2. Jul 2009, 12:08
Ein Event ist die Lösung. z.B.

Delphi-Quellcode:
type
  TObjectData = class
  private
    FNotify : TNotifyEvent;
  public
    property OnNotify : TNotifyEvent read FNotify write FNotify;
    procedure NotifyGUI;
  end;


implementation

procedure TObjectData.NotifyGUI;
begin
  if Assigned (FNotify) then
    FNotify (Self);
end;
und in UnitGUI:
Delphi-Quellcode:

type
  TObjectGUI = class
  private
    Data : TObjectData;
    procedure OnNotify (Sender : TObject);
  public
    Constructor Create;
  end;

implementation

constructor TObjectGUI.Create;
begin
  Data := TObjectData.Create;
  Data.OnNotify := OnNotify;
end;

procedure OnNotify (Sender : TObject);
begin
  { Wird aufgerufen wenn in TObjectData NotifyGUI durchlaufen wird. }
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:47 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz