home *** CD-ROM | disk | FTP | other *** search
- (***************************************
- * WG-VISION 1.0 BEISPIELPROGRAMM *
- ****************************************
- * *
- * Programm mit eingebauten Bildschirm- *
- * schoner auf der Grundlage des *
- * Programms ARTY.PAS von Borland *
- * *
- ****************************************
- * (c) 1993 Dipl.Phys. Mathias Scholz *
- ***************************************)
-
- {$I COMPILER.INC}
-
- program ScreenSv;
-
- uses WApp,
- WDecl,
- WDlg,
- WDriver,
- WEvent,
- Arty,
- dos,
- crt;
-
- const cmNewWindow = 101;
-
- type TApplication=object(TApp)
- ZeroTime,StopTime:LongInt;
- Wait:word;
- constructor Init(Titel:string);
- procedure InitVideoDevice; virtual;
- procedure InitMenuBar; virtual;
- procedure HandleEvent; virtual;
- procedure NewWindow;
- end;
-
- var MyApp:TApplication;
-
- {Implementation TApplication}
-
- constructor TApplication.Init(Titel:string);
- begin
- TApp.Init(Titel);
- ZeroTime:=0; Wait:=10;
- end;
-
- procedure TApplication.InitVideoDevice;
- begin
- Video.Init(VESA,M640x480);
- end;
-
- procedure TApplication.InitMenuBar;
- begin
- MainMenu('~A~uswahl',0);
- SubMenu('~F~enster aufblenden',cmNewWindow,0,0,false,false);
- NewLine;
- SubMenu('E~x~it <alt><x>',cmCloseApplication,0,45,false,false);
- end;
-
- procedure TApplication.HandleEvent;
-
- procedure ScreenSaver;
- var Stunde,Minute,Sekunde,HSec:word;
- begin
- GetTime(Stunde,Minute,Sekunde,HSec);
- if Event.What<>evNothing then ZeroTime:=Stunde*3600+Minute*60+Sekunde
- else StopTime:=Stunde*3600+Minute*60+Sekunde;
- if (StopTime-ZeroTime)>Wait then
- begin
- Mouse.HideMouse;
- DoArt;
- Draw;
- Mouse.ShowMouse;
- end;
- end;
-
- {-------}
-
- begin
- TProgram.HandleEvent;
- ScreenSaver;
- case Event.Command of
- cmNewWindow : NewWindow;
- end; {case}
- end;
-
- procedure TApplication.NewWindow;
- var R:TRect;
- Window:PWindow;
- begin
- R.Assign(60,80,440,280);
- Window:=new(PWindow, Init(R,'Beispiel',winDouble+winPanel+winMenu+winKey));
- InsertDesktop(Window);
- end;
-
- {Hauptprogramm}
-
- begin
- MyApp.Init('Beispielprogramm: Einbau eines Screen-Savers');
- MyApp.Run;
- MyApp.Done;
- END.
-