mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:29:27 +02:00
* Bugfix of procedrual variables of methods (Bug report 2588)
This commit is contained in:
parent
4eac90e5d4
commit
f09c1e8e63
58
tests/tbs/tb0455.pp
Normal file
58
tests/tbs/tb0455.pp
Normal file
@ -0,0 +1,58 @@
|
||||
{$IFDEF FPC}
|
||||
{$MODE DELPHI}
|
||||
{$ENDIF}
|
||||
uses windows,classes;
|
||||
|
||||
|
||||
type
|
||||
TNotifyEventA = procedure (Sender:TObject) of object;
|
||||
|
||||
TwolBrushes = class
|
||||
public
|
||||
FOnChange :TNotifyEventA;
|
||||
procedure Wol_Changed;
|
||||
property OnChange :TNotifyEventA read FOnChange Write FOnChange;
|
||||
end;
|
||||
|
||||
|
||||
TWOLBetaObject = class
|
||||
public
|
||||
mylocalvar : integer;
|
||||
constructor Create(AOwner:TOBject);
|
||||
protected
|
||||
procedure DoBrushChange(Sender:TObject);
|
||||
private
|
||||
FBrush : TWolBrushes;
|
||||
end;
|
||||
|
||||
|
||||
procedure TWOLBetaObject.DoBrushChange(Sender:TObject);
|
||||
var DC:HDC;
|
||||
begin
|
||||
mylocalvar:=12;
|
||||
WriteLn('OK!');
|
||||
end;
|
||||
|
||||
|
||||
procedure TwolBrushes.WOL_Changed;
|
||||
begin
|
||||
if Assigned(FOnChange) then FOnChange(Self);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
constructor TWOLBetaObject.Create(AOwner:TOBject);
|
||||
begin
|
||||
Inherited Create;
|
||||
FBrush :=TWOLBrushes.Create;
|
||||
FBrush.OnChange:=DoBrushChange;
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
cla1: TWolbetaObject;
|
||||
begin
|
||||
cla1:=TWolBetaObject.create(nil);
|
||||
cla1.FBrush.WOL_Changed;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user