home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / delphi / lezi1b.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-06-30  |  1.5 KB  |  74 lines

  1. unit T_MioVCL1;
  2.  
  3.  interface
  4.  
  5.  uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
  7.  
  8.  type
  9.   TMioVCL1a = class(TComponent)
  10.   private
  11.     { Private declarations }
  12.     N1,N2,R:Integer;
  13.     Procedure SetNum1(Value:Integer);
  14.     Procedure SetNum2(Value:Integer);
  15.   protected
  16.     { Protected declarations }
  17.   public
  18.     { Public declarations }
  19.   published
  20.     { Published declarations }
  21.     Property Num1:Integer Read N1 Write SetNum1;
  22.     Property Num2:Integer Read N2 Write SetNum2;
  23.     Property Risultato:Integer Read R Write R;
  24.   end;
  25.  
  26.  type
  27.   TMioVCL1b = class(TComponent)
  28.   private
  29.     { Private declarations }
  30.     N1,N2,R:Integer;
  31.     Function GetRisultato:Integer;
  32.   protected
  33.     { Protected declarations }
  34.   public
  35.     { Public declarations }
  36.   published
  37.     { Published declarations }
  38.     Property Num1:Integer Read N1 Write N1;
  39.     Property Num2:Integer Read N2 Write N2;
  40.     Property Risultato:Integer Read GetRisultato Write R;
  41.   end;
  42.  
  43. procedure Register;
  44.  
  45. implementation
  46.  
  47. //Procedure interne del componente TMioVCL1a
  48.  
  49. Procedure TMioVCL1a.SetNum1(Value:Integer);
  50.  Begin
  51.   N1:=Value;
  52.   R:=N1+N2;
  53.  End;
  54.  
  55. Procedure TMioVCL1a.SetNum2(Value:Integer);
  56.  Begin
  57.   N2:=Value;
  58.   R:=N1+N2;
  59.  End;
  60.  
  61. //Funzione interna del componente TMioVCL1b
  62.  
  63. Function TMioVCL1b.GetRisultato:Integer;
  64.  Begin
  65.   Result:=N1+N2;
  66.  End;
  67.  
  68. procedure Register;
  69.  begin
  70.   RegisterComponents('Samples', [TMioVCL1a,TMioVCL1B]);
  71.  end;
  72.  
  73. end.
  74.