home *** CD-ROM | disk | FTP | other *** search
/ TopWare 18: Liquid / Image.iso / liquid / top1143 / gepackt.exe / BSPQTSW.EXE / SCREENSV.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-06-28  |  2.2 KB  |  104 lines

  1. (***************************************
  2. * WG-VISION 1.0   BEISPIELPROGRAMM     *
  3. ****************************************
  4. *                                      *
  5. * Programm mit eingebauten Bildschirm- *
  6. * schoner auf der Grundlage des        *
  7. * Programms ARTY.PAS von Borland       *
  8. *                                      *
  9. ****************************************
  10. * (c) 1993 Dipl.Phys. Mathias Scholz   *
  11. ***************************************)
  12.  
  13. {$I COMPILER.INC}
  14.  
  15. program ScreenSv;
  16.  
  17. uses WApp,
  18.      WDecl,
  19.      WDlg,
  20.      WDriver,
  21.      WEvent,
  22.      Arty,
  23.      dos,
  24.      crt;
  25.  
  26. const cmNewWindow   = 101;
  27.  
  28. type TApplication=object(TApp)
  29.       ZeroTime,StopTime:LongInt;
  30.       Wait:word;
  31.       constructor Init(Titel:string);
  32.       procedure InitVideoDevice; virtual;
  33.       procedure InitMenuBar; virtual;
  34.       procedure HandleEvent; virtual;
  35.       procedure NewWindow;
  36.      end;
  37.  
  38. var MyApp:TApplication;
  39.  
  40. {Implementation TApplication}
  41.  
  42. constructor TApplication.Init(Titel:string);
  43. begin
  44.   TApp.Init(Titel);
  45.   ZeroTime:=0; Wait:=10;
  46. end;
  47.  
  48. procedure TApplication.InitVideoDevice;
  49. begin
  50.   Video.Init(VESA,M640x480);
  51. end;
  52.  
  53. procedure TApplication.InitMenuBar;
  54. begin
  55.   MainMenu('~A~uswahl',0);
  56.    SubMenu('~F~enster aufblenden',cmNewWindow,0,0,false,false);
  57.    NewLine;
  58.    SubMenu('E~x~it    <alt><x>',cmCloseApplication,0,45,false,false);
  59. end;
  60.  
  61. procedure TApplication.HandleEvent;
  62.  
  63. procedure ScreenSaver;
  64. var Stunde,Minute,Sekunde,HSec:word;
  65. begin
  66.   GetTime(Stunde,Minute,Sekunde,HSec);
  67.   if Event.What<>evNothing then ZeroTime:=Stunde*3600+Minute*60+Sekunde
  68.    else StopTime:=Stunde*3600+Minute*60+Sekunde;
  69.   if (StopTime-ZeroTime)>Wait then
  70.    begin
  71.      Mouse.HideMouse;
  72.      DoArt;
  73.      Draw;
  74.      Mouse.ShowMouse;
  75.    end;
  76. end;
  77.  
  78. {-------}
  79.  
  80. begin
  81.   TProgram.HandleEvent;
  82.   ScreenSaver;
  83.   case Event.Command of
  84.    cmNewWindow : NewWindow;
  85.   end; {case}
  86. end;
  87.  
  88. procedure TApplication.NewWindow;
  89. var R:TRect;
  90.     Window:PWindow;
  91. begin
  92.   R.Assign(60,80,440,280);
  93.   Window:=new(PWindow, Init(R,'Beispiel',winDouble+winPanel+winMenu+winKey));
  94.   InsertDesktop(Window);
  95. end;
  96.  
  97. {Hauptprogramm}
  98.  
  99. begin
  100.   MyApp.Init('Beispielprogramm: Einbau eines Screen-Savers');
  101.   MyApp.Run;
  102.   MyApp.Done;
  103. END.
  104.