The "common Delphi paradigm" is event (event handler). Eg, you can write
type
TMessageProc = procedure(const AMsg: String);
procedure DoSomething(OnProgress: TMessageProc);
begin
// ...
if Assigned(OnProgress) then OnProgress('123');
// ...
end;
Normally the events in Delphi are implemented as methods, so the standard Delphi code for the above example is:
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure ShowProgress(const AMsg: String);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
type
TMessageProc = procedure(const AMsg: String) of object; // declare event type
procedure DoSomething(OnProgress: TMessageProc);
begin
// ...
if Assigned(OnProgress) then OnProgress('123'); // trigger event
// ...
end;
procedure TForm1.ShowProgress(const AMsg: String); // event handler
begin
Label1.Caption:= AMsg;
Application.ProcessMessages;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
DoSomething(ShowProgress);
end;
There is nothing wrong in declaring your personal event types, but sure you can find standard events in VCL. For example, classes.pas unit containes the declaration
TGetStrProc = procedure(const S: string) of object;