home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue41 / System / Unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1998-12-06  |  991 b   |  53 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls,
  7.   UCAniIcon;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Timer1: TTimer;
  12.     procedure FormCreate(Sender: TObject);
  13.     procedure FormDestroy(Sender: TObject);
  14.     procedure Timer1Timer(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.     ani: TAniIcon;
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.  
  25. implementation
  26.  
  27. {$R *.DFM}
  28.  
  29. procedure TForm1.FormCreate(Sender: TObject);
  30. begin
  31.     ani := TAniIcon.Create;
  32.     ani.LoadFromFile ('c:\windows\cursors\s_busy.ani');
  33.     ani.BackgroundColor := Self.Color;
  34.     Caption := ani.Title;
  35.  
  36.     Timer1.Interval := 50;
  37.     Timer1.Enabled := True;
  38. end;
  39.  
  40. procedure TForm1.FormDestroy(Sender: TObject);
  41. begin
  42.     ani.Free;
  43. end;
  44.  
  45. procedure TForm1.Timer1Timer(Sender: TObject);
  46. begin
  47.     ani.Animate;
  48.     ani.Draw (Canvas, Rect (0, 0, ani.Width, ani.Height));
  49. end;
  50.  
  51. end.
  52.  
  53.