home *** CD-ROM | disk | FTP | other *** search
/ Chip: Shareware for Win 95 / Chip-Shareware-Win95.bin / ostatni / delphi / delphi1 / lmdtoolb.exe / demos / scrsaver / main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-09-08  |  2.8 KB  |  105 lines

  1. unit Main;
  2. {
  3.  Demo-Program for TLMDScreensavers.
  4.  
  5.  There are only a few lines of code implemented, but it
  6.  is a funtionable ScreenSaver... (we had not time to implement
  7.  flying toasters or something similar <g>
  8.  
  9.  The screensaver will change the backgroundcolor of the saverform every
  10.  second. We include a outcommended Paint-Procedure to show the technique displaying
  11.  the restored Desktop. Take a look at this if you need something like that.
  12.  
  13.  Besides there is a demonstration of the OnCheckPassword and OnSetupDlg. We implemented
  14.  a small password-dialog for demonstration purposes.
  15.  
  16.  Note:
  17.  If you want to test your Setup-Dialog, you have to set as Parameter '/c'. Windows will
  18.  try to start your screensaver with this parameter to request an existing Setup-Dialog ('/s' for
  19.  starting the screensaver). You have to set this parameter in the Parameters-Option in Delphi's
  20.  Start-Menu. If there is no use of a setup-dialog, forget this note.
  21.  
  22.  To implement this demo-saver into your windows environment, rename the exe-File
  23.  to a scr-File and copy it to your windows directory.
  24.  
  25.  This program is freeware. Use it and enjoy!
  26.  If you made any improvements it would be nice to send them to me.
  27.  
  28.  ⌐ 1995 by LMD Innovative
  29.  
  30.  ------------------------------------------------------------------
  31.  History:
  32.  0.01.00 (08.09.95): First Version
  33.  
  34.  Author: RM}
  35.  
  36.  
  37. interface
  38.  
  39. uses
  40.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  41.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Menus, Lmdscrsv, pwdl, pwchange;
  42.  
  43. type
  44.   TMainForm = class(TForm)
  45.     saver: TLMDScreenSaver;
  46.     Timer1: TTimer;
  47.     procedure FormPaint(Sender: TObject);
  48.     procedure saverCheckPassWord(Sender: TObject; var CanClose: Boolean);
  49.     procedure saverSetupDlg(Sender: TObject);
  50.     procedure Timer1Timer(Sender: TObject);
  51.   end;
  52.  
  53. var
  54.   MainForm: TMainForm;
  55.  
  56. implementation
  57.  
  58. {$R *.DFM}
  59.  
  60. procedure TMainForm.FormPaint(Sender: TObject);
  61. begin
  62.  
  63.   {set the savebackground property true and use this lines -
  64.    the desktop will be shown... - certainly you should manipulate the
  65.    desktop for a sophisticated saver! <g>}
  66.   {if saver.Bitmap<>nil then
  67.     Canvas.copyrect(rect(0,0,Width,Height), saver.Bitmap.Canvas, rect(0,0,Width,Height));}
  68.  
  69. end;
  70.  
  71. procedure TMainForm.saverCheckPassWord(Sender: TObject;
  72.   var CanClose: Boolean);
  73. var PWDlg:TPWDlg;
  74.  
  75. begin
  76.  
  77.    {look the use of the Canclose-variable!}
  78.    PWDlg:=TPWDLG.Create(application);
  79.    if PWDLG.ShowModal<>mrOK then CanClose:=False;
  80.    PWDlg.Free;
  81.  
  82. end;
  83.  
  84. procedure TMainForm.saverSetupDlg(Sender: TObject);
  85. var PWCH:TPWCH;
  86.  
  87. begin
  88.  
  89.   PWCH:=TPWCH.Create(application);
  90.   PWCH.ShowModal;
  91.   PWCH.Free;
  92.  
  93. end;
  94.  
  95. procedure TMainForm.Timer1Timer(Sender: TObject);
  96. begin
  97.  
  98.   color:=TColor(Random(65000));
  99. end;
  100.  
  101. initialization
  102. Randomize;
  103.  
  104. end.
  105.