home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / Chip_2000-02_cd.bin / zkuste / Delphi / navody / tt / objvm.exe / UNITS / LangProc.pas < prev    next >
Pascal/Delphi Source File  |  1998-06-26  |  1KB  |  39 lines

  1. {see TLangProc}
  2. unit LangProc;
  3.  
  4. interface
  5. uses VisualValue,
  6.      LangValue,Classes;
  7.  
  8. type
  9.         {TExecEvent is an event to implement Exec method of TLangProc}
  10.         {see Exec method reference for details }
  11.      TExecEvent=procedure (Sender:TVisualValue;S:IValStack;MustReturn:boolean)
  12.                 of object;
  13. type TLangProc=class(TVisualValue)
  14.       protected
  15.          fOnExec:TExecEvent;
  16.       public
  17.          procedure Exec(S:IValStack;MustReturn:boolean);override;
  18.          function  CreateSame(o:TComponent):TVisualValue;override;
  19.       published
  20.          property OnExec:TExecEvent read fOnExec write fOnExec;
  21.            {This event is triggered on procedure call }
  22.            {see Exec method for details }
  23.       end;
  24. implementation
  25. procedure TLangProc.Exec;
  26.           begin
  27.             if Assigned(fOnExec) then
  28.             begin
  29.               OnExec(Self,S,MustReturn);
  30.             end;
  31.           end;
  32. function  TLangProc.CreateSame;
  33.           begin
  34.             Result:=Inherited CreateSame(o);
  35.             (Result as TLangProc).OnExec:=OnExec;
  36.           end;
  37.  
  38. end.
  39.